10 #include <tbb/spin_mutex.h>
13 #include <matrix/vlVector.h>
19 struct DtEmitterSystemBeamStateData;
20 class DtEmitterSystemStateComponent;
39 , myJammingModeSequence(0)
41 , myFrequencyRange(0.)
45 , myElevationCenter(0.)
46 , myElevationSweep(0.)
50 , myBeamParameterIndex(0)
52 , myHighDensity(false)
60 : myEmitterNumber(orig.myEmitterNumber)
61 , myBeamId(orig.myBeamId)
62 , myBeamType(orig.myBeamType)
63 , myJammingModeSequence(orig.myJammingModeSequence)
64 , myFrequency(orig.myFrequency)
65 , myFrequencyRange(orig.myFrequencyRange)
67 , myAzimuthCenter(orig.myAzimuthCenter)
68 , myAzimuthSweep(orig.myAzimuthSweep)
69 , myElevationCenter(orig.myElevationCenter)
70 , myElevationSweep(orig.myElevationSweep)
72 , myPulseWidth(orig.myPulseWidth)
73 , mySweepSync(orig.mySweepSync)
74 , myBeamParameterIndex(orig.myBeamParameterIndex)
75 , myBeamFunction(orig.myBeamFunction)
76 , myHighDensity(orig.myHighDensity)
77 , myTrackJamTargets(orig.myTrackJamTargets)
78 , myPrfJitter(orig.myPrfJitter)
79 , myBeamWidth(orig.myBeamWidth)
80 , myScanData(orig.myScanData)
119 && (myERP == rhs.
myERP)
124 && (myPRF == rhs.
myPRF)
160 void addTrackJamTarget(const
DtUUID& s) { myTrackJamTargets.insert(s); };
169 unsigned short myBeamId;
242 std::vector<DtEmitterSystemBeamStateData>::iterator iter = beams.begin();
243 std::vector<DtEmitterSystemBeamStateData>::iterator end = beams.end();
246 if (iter->beamId() == beamId)
259 std::vector<DtEmitterSystemBeamStateData>::const_iterator iter = beams.begin();
260 std::vector<DtEmitterSystemBeamStateData>::const_iterator end = beams.end();
263 if (iter->beamId() == beamId)
276 std::vector<DtEmitterSystemBeamStateData>::iterator iter = beams.begin();
277 std::vector<DtEmitterSystemBeamStateData>::iterator end = beams.end();
280 if (iter->beamId() == beamIndex)
292 return (beamsTrackingObject(type, gid).
size() != 0);
297 std::vector<DtEmitterSystemBeamStateData>::const_iterator iter = beams.begin();
298 std::vector<DtEmitterSystemBeamStateData>::const_iterator end = beams.end();
299 std::vector<const DtEmitterSystemBeamStateData*> lst;
301 while (iter != beams.end())
303 if ((iter->beamType() == type) && iter->hasTrackJamTarget(gid))
305 lst.push_back(&(*iter));
316 unsigned short id = nextBeamId();
321 beams.push_back(data);
323 return &beams[beams.size() - 1];
333 return (*
this)[beamId];
338 return (*
this)[beamId];
343 if (index < beams.size())
345 return &beams[index];
353 if (index < beams.size())
355 return &beams[index];
368 std::vector<DtEmitterSystemBeamStateData> beams{};
370 mutable unsigned short nextId{ 0 };
376 , myEmitterFunction(0)
377 , myEmitterNumber(0xFFFFFFFF)
383 , mySystemName(orig.mySystemName)
384 , myEmitterFunction(orig.myEmitterFunction)
385 , myMountLocation(orig.myMountLocation)
386 , myBeamsList(orig.myBeamsList)
387 , myEmitterNumber(orig.myEmitterNumber)
388 , myGlobalId(orig.myGlobalId)
407 return myBeamsList.beamByBeamId(beamId);
412 return myBeamsList.beamByBeamId(beamId);
417 return myBeamsList.beamByBeamIndex(beamId);
422 return myBeamsList.beamByBeamIndex(beamId);
425 unsigned int numBeams()
const {
return myBeamsList.size(); };
429 const std::vector<DtEmitterSystemBeamStateData>&
rawBeams()
const {
return myBeamsList.beams; };
430 std::vector<DtEmitterSystemBeamStateData>&
rawBeams() {
return myBeamsList.beams; };
444 return myBeamsList.beamsTrackingObject(type, gid);
468 void removeBeam(
unsigned short beamId) { myBeamsList.removeBeam(beamId); };
483 unsigned int myEmitterNumber;
485 unsigned int mySystemName;
487 unsigned int myEmitterFunction;
489 DtVector myMountLocation;
504 : DtFrameStateInterface(storage)
518 virtual
unsigned int emitterNumber()
const {
throw DtUnimplementedMethod(
"The const emitterNumber() const method is unimplemented"); };
546 virtual const std::vector<DtEmitterSystemBeamStateData>& beams()
const override;
547 virtual std::vector<DtEmitterSystemBeamStateData>& beams()
override;
549 virtual const DtUUID hostId()
const override;
551 virtual const DtString& globalId()
const override;
552 virtual void setGlobalId(
const DtString&)
override;
554 virtual const unsigned int& systemName()
const override;
555 virtual void setSystemName(
const unsigned int&)
override;
557 virtual unsigned int emitterNumber()
const override;
558 virtual void setEmitterNumber(
const unsigned int&)
override;
560 virtual const unsigned int& emitterFunction()
const override;
561 virtual void setEmitterFunction(
const unsigned int&)
override;
563 virtual const bool& on()
const override;
564 virtual void setOn(
const bool&)
override;
566 virtual const DtVector& mountLocation()
const override;
567 virtual void setMountLocation(
const DtVector&)
override;
569 virtual const unsigned int numBeams()
const override;
577 virtual void removeAllBeams()
override;
578 virtual void removeBeam(
unsigned short beamId)
override;
581 virtual const std::vector<const DtEmitterSystemBeamStateData*> beamsTrackingObject(
583 virtual const std::vector<const DtEmitterSystemBeamStateData*> beamsTrackingObject(
584 const DtUUID& gid)
const override;
585 virtual const std::vector<const DtEmitterSystemBeamStateData*> beamsJammingObject(
586 const DtUUID& gid)
const override;
588 virtual bool tracking(
const DtUUID& gid)
const override;
589 virtual bool jamming(
const DtUUID& gid)
const override;
598 virtual void makeReadOnly()
override {};
602 unsigned short myNextBeamId;
616 virtual const std::vector<DtEmitterSystemBeamStateData>& beams()
const override;
617 virtual const DtUUID hostId()
const override;
618 virtual const DtString& globalId()
const override;
619 virtual const unsigned int& systemName()
const override;
620 virtual unsigned int emitterNumber()
const override;
621 virtual const unsigned int& emitterFunction()
const override;
622 virtual const bool& on()
const override;
623 virtual const DtVector& mountLocation()
const override;
624 virtual const unsigned int numBeams()
const override;
627 virtual bool tracking(
const DtUUID& gid)
const override;
628 virtual bool jamming(
const DtUUID& gid)
const override;
629 virtual const std::vector<const DtEmitterSystemBeamStateData*> beamsTrackingObject(
631 virtual const std::vector<const DtEmitterSystemBeamStateData*> beamsTrackingObject(
632 const DtUUID& gid)
const override;
633 virtual const std::vector<const DtEmitterSystemBeamStateData*> beamsJammingObject(
634 const DtUUID& gid)
const override;
661 virtual bool forceAdvance()
override;
665 if (myNextFrameState.isWritable())
667 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
670 myCurrentFrameState.emitComponentUpdated();
675 myCurrentFrameState.updateStateData(sd);
676 myNextFrameState.updateStateData(sd);
682 myCurrentFrameState.aboutToBeDeleted();
683 myNextFrameState.aboutToBeDeleted();
std::vector< DtEmitterSystemBeamStateData > beams
List of beam state data records for this emitter system.
Definition: emitterSystemStateComponent.h:368
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual DtFrameStateInterface * nextFrameState() override
Returns the writable next frame state. Throws if not double-buffered.
Definition: emitterSystemStateComponent.h:657
unsigned int mySystemName
DIS/SISO system name code describing the emission type.
Definition: emitterSystemStateComponent.h:485
const std::vector< DtEmitterSystemBeamStateData > & rawBeams() const
Definition: emitterSystemStateComponent.h:429
DtVrfMakRadarBeamScanData myScanData
Scan pattern data for this beam.
Definition: emitterSystemStateComponent.h:207
std::set< DtUUID > myTrackJamTargets
Set of entity UUIDs currently being tracked or jammed by this beam.
Definition: emitterSystemStateComponent.h:209
void removeAllBeams()
Definition: emitterSystemStateComponent.h:361
virtual const DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:521
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
DtEmitterSystemBeamStateData * addBeam()
Definition: emitterSystemStateComponent.h:426
std::vector< const DtEmitterSystemBeamStateData * > beamsJammingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:452
3) Define the current frame class. This will be used for read access.
Definition: emitterSystemStateComponent.h:608
DtEmitterSystemBeamStateData * operator[](unsigned short beamId)
Definition: emitterSystemStateComponent.h:240
unsigned short myBeamId
Unique identifier for this beam within the emitter system.
Definition: emitterSystemStateComponent.h:165
#define UNDEFINED_METHOD(Type, Method,...)
Defines a virtual non-const method with variadic parameters that throws DtUnimplementedMethod, requiring an override in a derived class.
Definition: doubleBufferedDataStorage.h:138
bool operator!=(const DtEmitterSystemBeamStateData &rhs) const
Definition: emitterSystemStateComponent.h:137
std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(DtEmitterSystemBeamStateData::BeamType type, const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:295
Container managing the collection of beams associated with an emitter system.
Definition: emitterSystemStateComponent.h:216
DtString myGlobalId
Globally unique string identifier for this emitter, patterned after the DIS/HLA global ID...
Definition: emitterSystemStateComponent.h:468
double myAzimuthSweep
Azimuth sweep width of the beam in radians.
Definition: emitterSystemStateComponent.h:185
Definition: emitterSystemStateComponent.h:31
virtual const DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamIndex) const
Definition: emitterSystemStateComponent.h:520
std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:447
double myFrequency
Center frequency of the emission in Hz.
Definition: emitterSystemStateComponent.h:177
double myPRF
Pulse repetition frequency in Hz.
Definition: emitterSystemStateComponent.h:191
bool myOn
Whether this emitter system is currently active.
Definition: emitterSystemStateComponent.h:481
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
const DtEmitterSystemBeamStateData * operator[](unsigned short beamId) const
Definition: emitterSystemStateComponent.h:257
DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId)
Definition: emitterSystemStateComponent.h:331
void removeBeam(unsigned short beamId)
Definition: emitterSystemStateComponent.h:468
voidpf void uLong size
Definition: ioapi.h:39
virtual void aboutToBeDeleted() override
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
Definition: emitterSystemStateComponent.h:679
unsigned int myEmitterNumber
Emitter number identifying this system within the host entity.
Definition: emitterSystemStateComponent.h:483
DtEmitterSystemStateComponentData myData
Writable state data for the next simulation frame.
Definition: emitterSystemStateComponent.h:604
#define UNDEFINED_RETURNREF_ACCESSORS(ReturnType, Member)
Defines both const and non-const virtual reference accessors that throw DtUnimplementedMethod, requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:74
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Defines a virtual const accessor that throws DtUnimplementedMethod, marking the method as requiring a...
Definition: doubleBufferedDataStorage.h:53
virtual void removeTrackJamTarget(const DtUUID &globalId, DtEmitterSystemBeamStateData::BeamType)
Definition: emitterSystemStateComponent.h:530
virtual const std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:526
Contains the DtUUID class declaration.
bool myHighDensity
Whether this beam reports high-density track/jam targets.
Definition: emitterSystemStateComponent.h:201
DtEmitterSystemBeams myBeamsList
Collection of beams associated with this emitter system.
Definition: emitterSystemStateComponent.h:491
DtEmitterSystemBeamStateData(const DtEmitterSystemBeamStateData &orig)
Definition: emitterSystemStateComponent.h:59
void removeAllBeams()
Definition: emitterSystemStateComponent.h:467
DtEmitterSystemBeamStateData & operator=(const DtEmitterSystemBeamStateData &rhs)
Definition: emitterSystemStateComponent.h:84
Full state data for an electromagnetic emitter system, including its configuration and all associated...
Definition: emitterSystemStateComponent.h:213
virtual const DtFrameStateInterface * currentFrameState() const override
Returns the read-only current frame state. Throws if not double-buffered.
Definition: emitterSystemStateComponent.h:656
bool tracking(DtEmitterSystemBeamStateData::BeamType type, const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:290
int myBeamType
Type of beam (RegularBeam/RadarBeam or JamBeam)
Definition: emitterSystemStateComponent.h:173
bool(*)(const DtUUID &target, const DtEmitterSystemBeamStateData &beam, void *usr) DtVerifyTrackJamTargetCallback
Definition: emitterSystemStateComponent.h:22
DtEmitterSystemStateComponentData & operator=(const DtEmitterSystemStateComponentData &rhs)
Definition: emitterSystemStateComponent.h:392
virtual DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId)
Definition: emitterSystemStateComponent.h:523
std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(DtEmitterSystemBeamStateData::BeamType type, const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:442
DtEmitterSystemBeamStateData()
Definition: emitterSystemStateComponent.h:35
const DtEmitterSystemStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: emitterSystemStateComponent.h:543
DtEmitterSystemBeams & operator=(const DtEmitterSystemBeams &rhs)
Definition: emitterSystemStateComponent.h:228
unsigned int myBeamFunction
Function code describing the role of this beam (e.g., search, acquisition, track) ...
Definition: emitterSystemStateComponent.h:199
DtVector myMountLocation
Location of the emitter antenna relative to the entity's reference point.
Definition: emitterSystemStateComponent.h:489
DtEmitterSystemStateComponentData myData
Read-only snapshot of the emitter system state for the current simulation frame.
Definition: emitterSystemStateComponent.h:645
void advanceFrame(const DtEmitterSystemStateComponentData &data)
Definition: emitterSystemStateComponent.h:638
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: emitterSystemStateComponent.h:650
DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short index)
Definition: emitterSystemStateComponent.h:341
#define UNDEFINED_CONST_METHOD(Type, Method,...)
Defines a virtual const method with variadic parameters that throws DtUnimplementedMethod, requiring an override in a derived class.
Definition: doubleBufferedDataStorage.h:130
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
unsigned int myJammingModeSequence
Jamming mode sequence number.
Definition: emitterSystemStateComponent.h:175
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Macro to define all required static and virtual state component type methods. Place in the public sec...
Definition: stateComponent.h:272
virtual const std::vector< const DtEmitterSystemBeamStateData * > beamsJammingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:527
bool jamming(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:457
bool operator==(const DtEmitterSystemBeamStateData &rhs) const
Definition: emitterSystemStateComponent.h:111
double myElevationSweep
Elevation sweep width of the beam in radians.
Definition: emitterSystemStateComponent.h:189
double myPulseWidth
Pulse width in seconds.
Definition: emitterSystemStateComponent.h:193
DtEmitterSystemBeams(const DtEmitterSystemBeams &orig)
Definition: emitterSystemStateComponent.h:223
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
double mySweepSync
Sweep synchronization value.
Definition: emitterSystemStateComponent.h:195
void setTrackJamTargets(const std::set< DtUUID > &t)
Definition: emitterSystemStateComponent.h:165
int size() const
Definition: emitterSystemStateComponent.h:235
bool isDoubleBuffered()
Definition: emitterSystemStateComponent.h:655
DtEmitterSystemStateComponentNextFrame myNextFrameState
Next-frame state used for write access by the simulation controller.
Definition: emitterSystemStateComponent.h:690
DtEmitterSystemStateComponentData(const DtEmitterSystemStateComponentData &orig)
Definition: emitterSystemStateComponent.h:381
const DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:420
BeamType
Definition: emitterSystemStateComponent.h:27
const DtEmitterSystemStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: emitterSystemStateComponent.h:614
DtEmitterSystemStateComponentData & frameState()
Definition: emitterSystemStateComponent.h:544
const DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short index) const
Definition: emitterSystemStateComponent.h:351
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
virtual DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamIndex)
Definition: emitterSystemStateComponent.h:522
const DtEmitterSystemBeams & beams() const
Definition: emitterSystemStateComponent.h:428
unsigned int myEmitterNumber
Emitter number this beam belongs to.
Definition: emitterSystemStateComponent.h:171
bool jamming(const DtUUID &gid)
Definition: emitterSystemStateComponent.h:462
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: emitterSystemStateComponent.h:498
std::vector< DtEmitterSystemBeamStateData > & rawBeams()
Definition: emitterSystemStateComponent.h:430
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: emitterSystemStateComponent.h:673
DtEmitterSystemBeams & beams()
Definition: emitterSystemStateComponent.h:427
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual const-reference accessor and an undefined virtual setter, both throwing DtUnimplementedMethod and requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:112
bool tracking(const DtUUID &gid)
Definition: emitterSystemStateComponent.h:437
DtEmitterSystemBeamStateData * addBeam()
Definition: emitterSystemStateComponent.h:314
bool myPrfJitter
Whether pulse repetition frequency jitter is active.
Definition: emitterSystemStateComponent.h:203
double myERP
Effective radiated power in dBm.
Definition: emitterSystemStateComponent.h:181
const DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:410
DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId)
Definition: emitterSystemStateComponent.h:405
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
static const char * SystemName
Definition: vrfXmlTypes.h:46
2) Define the next frame class. This will be used for write access.
Definition: emitterSystemStateComponent.h:537
bool hasTrackJamTarget(const DtUUID &s) const
Definition: emitterSystemStateComponent.h:163
const DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:336
unsigned short nextBeamId() const
Definition: emitterSystemStateComponent.h:326
virtual void setEmitterNumber(const unsigned int &)
Definition: emitterSystemStateComponent.h:519
DtEmitterSystemStateComponentCurrentFrame myCurrentFrameState
Current-frame state used for read-only access by consumers.
Definition: emitterSystemStateComponent.h:688
double myAzimuthCenter
Azimuth center angle of the beam in radians.
Definition: emitterSystemStateComponent.h:183
unsigned int myEmitterFunction
Function code describing the purpose of this emitter system.
Definition: emitterSystemStateComponent.h:487
void removeTrackJamTarget(const DtUUID &s)
Definition: emitterSystemStateComponent.h:161
unsigned int numBeams() const
Definition: emitterSystemStateComponent.h:425
DtStateComponentCreator< DtEmitterSystemStateComponentImplementation > DtEmitterSystemStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: emitterSystemStateComponent.h:695
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
virtual void makeWritable() override
Override to make component writable.
Definition: emitterSystemStateComponent.h:595
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: emitterSystemStateComponent.h:663
unsigned int myBeamParameterIndex
Index into the beam data records for additional beam parameters.
Definition: emitterSystemStateComponent.h:197
Definition: stateComponent.h:85
double myBeamWidth
Width of the beam in radians.
Definition: emitterSystemStateComponent.h:205
virtual const DtFrameStateInterface * nextFrameState() const override
Returns the read-only next frame state. Throws if not double-buffered.
Definition: emitterSystemStateComponent.h:658
double myFrequencyRange
Frequency range (bandwidth) of the emission in Hz.
Definition: emitterSystemStateComponent.h:179
Contains the DtStateComponent class declaration.
DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamId)
Definition: emitterSystemStateComponent.h:415
void removeBeam(unsigned int beamIndex)
Definition: emitterSystemStateComponent.h:274
void clearTrackJamTargets()
Definition: emitterSystemStateComponent.h:164
State data for a single electromagnetic emission beam within an emitter system.
Definition: emitterSystemStateComponent.h:25
Definition: emitterSystemStateComponent.h:32
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
bool tracking(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:432
const std::set< DtUUID > & trackJamTargets() const
Definition: emitterSystemStateComponent.h:162
virtual void addTrackJamTarget(const DtUUID &globalId, DtEmitterSystemBeamStateData::BeamType, DtVerifyTrackJamTargetCallback=nullptr, void *userData=nullptr)
Definition: emitterSystemStateComponent.h:528
Definition: vrfMakRadarBeamScanData.h:31
DtEmitterSystemStateComponentData()
Definition: emitterSystemStateComponent.h:373
DtEmitterSystemBeams()
Definition: emitterSystemStateComponent.h:219
double myElevationCenter
Elevation center angle of the beam in radians.
Definition: emitterSystemStateComponent.h:187