12#ifndef WSFJTIDS_SLOTGROUP_HPP
13#define WSFJTIDS_SLOTGROUP_HPP
15#include "wsf_mil_export.h"
19#include <unordered_set>
31#include "UtCallback.hpp"
51 const std::string& aGroupName,
52 const std::string& aSourceGroupName);
90 double GetNextTransmitTime(
double aSimTime);
92 bool DebugEnabled()
const;
96 bool Initialize(
double aSimTime);
98 bool ProcessInput(UtInput& aInput);
100 void PurgeQueuedMessages();
102 void RemoveFromNetwork();
104 bool SendMessage(
double aSimTime,
const WsfMessage& aMessage,
WsfPlatform* aRecipientPtr,
bool aSource =
true);
106 void StartupTransmitEvents(
double aSimTime);
108 double TransmitCompleteEvent(
double aSimTime);
110 void TransmitEventsStopped();
151 EventDisposition Execute()
override;
177 class CommEvent :
public WsfEvent
186 EventDisposition Execute()
override;
188 static void ScheduleBeginTransmitEvent(
double aSimTime, WsfSimulation& aSimulation, WsfJTIDS_SlotGroup* aGroupPtr);
189 static void ScheduleTransmitCompleteEvent(
double aSimTime, WsfSimulation& aSimulation, WsfJTIDS_SlotGroup* aGroupPtr);
192 CommEvent(
double aSimTime, EventType aEventType, WsfJTIDS_SlotGroup* aGroupPtr);
194 double mLastStatusChangeTime;
195 EventType mEventType;
196 size_t mPlatformIndex;
197 WsfJTIDS_SlotGroup* mGroupPtr;
201 struct make_unique_comm_event : CommEvent
203 template<
typename... Args>
204 make_unique_comm_event(Args&&... args)
205 : CommEvent(std::forward<Args>(
args)...)
215 NetGroup(
WsfStringId aGroupName,
int aNetwork,
int aTSEC);
216 ~NetGroup() =
default;
221 std::vector<WsfJTIDS_SlotGroup*> mGroupList;
227 TimeSlotBlock(
int aOffset,
int aInterval,
char aType)
229 , mInterval(aInterval)
238 void AddToTransmitQueue(
double aSimTime, QueueEntry* aEntryPtr);
240 int ComputeTimeSlotsNeeded(
const WsfMessage& aMessage)
const;
242 void ComputeTransmitStartStopTime(
double aSimTime,
243 int aTimeSlotsNeeded,
246 int& aTransmitSlotIndex);
248 void DeliverMessage(
double aSimTime, QueueEntry& aQueueEntry);
250 virtual std::string GetFullName()
const;
252 void ProcessPackingFormat(UtInput& aInput, PackingFormat& aPackingFormat);
254 void ProcessTimeSlotBlock(UtInput& aInput,
char aBlockType);
256 bool ProcessNPG(UtInput& aInput);
258 wsf::comm::SlotGroupLayerJTIDS* mLayerPtr;
266 PackingFormat mPackingLimit;
269 int mPerUnitSlotsPerFrame;
270 std::vector<TimeSlotBlock> mTimeSlotBlocks;
272 std::vector<int> mSlots;
273 std::vector<int> mTransmitSlots;
276 std::list<QueueEntry*> mTransmitQueue;
282 int mPairedRelaySlotOffset;
288 WsfJTIDS_SlotGroup* mPairedRelayPtr;
291 std::vector<NetGroup>::size_type mNetGroupIndex;
293 static std::vector<NetGroup> mNetGroups;
295 bool mIsUsingTransmitEvents;
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfCommandChain.hpp:36
Definition WsfJTIDS_SlotGroup.hpp:113
std::unordered_set< size_t > RecipientList
Definition WsfJTIDS_SlotGroup.hpp:115
RecipientList mRecipients
Definition WsfJTIDS_SlotGroup.hpp:126
double mBeginTransmitTime
Definition WsfJTIDS_SlotGroup.hpp:121
QueueEntry(double aTimeQueued, std::unique_ptr< WsfMessage > aMessage, RecipientList &&aRecipients)
Definition WsfJTIDS_SlotGroup.cpp:1120
wsf::comm::Message * mMessagePtr
Definition WsfJTIDS_SlotGroup.hpp:123
int mTransmitSlotIndex
Definition WsfJTIDS_SlotGroup.hpp:125
double mTransmitCompleteTime
Definition WsfJTIDS_SlotGroup.hpp:122
double mTimeQueued
Definition WsfJTIDS_SlotGroup.hpp:120
int mTimeSlotsNeeded
Definition WsfJTIDS_SlotGroup.hpp:124
double mEndTime
Definition WsfJTIDS_SlotGroup.hpp:154
QueueEntry * mEntry
Definition WsfJTIDS_SlotGroup.hpp:157
WsfSimulation * mSimulationPtr
Definition WsfJTIDS_SlotGroup.hpp:156
void InitializeEvent(double aSimTime, double aEndTime, double aInterval, WsfSimulation *aSimulationPtr, QueueEntry *aEntry, wsf::comm::Comm *aTerminal)
Definition WsfJTIDS_SlotGroup.hpp:137
TransmitHeartbeatEvent(double aSimTime)
Definition WsfJTIDS_SlotGroup.hpp:133
TransmitHeartbeatEvent()=default
double mInterval
Definition WsfJTIDS_SlotGroup.hpp:155
wsf::comm::Comm * mTerminal
Definition WsfJTIDS_SlotGroup.hpp:158
double mTimeNow
Definition WsfJTIDS_SlotGroup.hpp:153
int GetTransmitSlotsPerFrame() const
Returns the number of slots allocated for transmitting.
Definition WsfJTIDS_SlotGroup.hpp:88
double BeginTransmitEvent(double aSimTime)
Definition WsfJTIDS_SlotGroup.cpp:825
int GetNPG() const
Return the Network Participation Group.
Definition WsfJTIDS_SlotGroup.hpp:82
void AddToNetwork()
Add the slot group to the corresponding network.
Definition WsfJTIDS_SlotGroup.cpp:114
UtCallbackListN< void(double, const WsfMessage *, int, WsfJTIDS_SlotGroup *)> MessageSent
Definition WsfJTIDS_SlotGroup.hpp:66
WsfJTIDS_SlotGroup(wsf::comm::SlotGroupLayerJTIDS *aLayerPtr, const std::string &aGroupName, const std::string &aSourceGroupName)
Construct a slot group.
Definition WsfJTIDS_SlotGroup.cpp:36
int GetMSEC() const
Return the JTIDS MSEC value.
Definition WsfJTIDS_SlotGroup.hpp:79
int GetNetwork() const
Return the JTIDS network number.
Definition WsfJTIDS_SlotGroup.hpp:73
static void ClearNetGroups()
Definition WsfJTIDS_SlotGroup.cpp:108
int GetSlotsPerFrame() const
Returns the number of slots per frame.
Definition WsfJTIDS_SlotGroup.hpp:85
WsfStringId GetNameId() const
Return the name ID of the slot group.
Definition WsfJTIDS_SlotGroup.hpp:70
int GetTSEC() const
Return the JTIDS TSEC value.
Definition WsfJTIDS_SlotGroup.hpp:76
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfComm.hpp:43
Definition WsfCommMessage.hpp:51
Definition WsfCommSlotGroupLayerJTIDS.hpp:35
str args
Definition MessageDefines_Generate.py:21
Definition WsfComm.cpp:34
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32