10 #include <tbb/spin_mutex.h>
13 #include <matrix/vlVector.h>
18 struct DtEmitterSystemBeamStateData;
19 class DtEmitterSystemStateComponent;
38 , myJammingModeSequence(0)
40 , myFrequencyRange(0.)
44 , myElevationCenter(0.)
45 , myElevationSweep(0.)
49 , myBeamParameterIndex(0)
51 , myHighDensity(false)
56 : mySystemId(orig.mySystemId)
57 , myBeamId(orig.myBeamId)
58 , myBeamType(orig.myBeamType)
59 , myJammingModeSequence(orig.myJammingModeSequence)
60 , myFrequency(orig.myFrequency)
61 , myFrequencyRange(orig.myFrequencyRange)
63 , myAzimuthCenter(orig.myAzimuthCenter)
64 , myAzimuthSweep(orig.myAzimuthSweep)
65 , myElevationCenter(orig.myElevationCenter)
66 , myElevationSweep(orig.myElevationSweep)
68 , myPulseWidth(orig.myPulseWidth)
69 , mySweepSync(orig.mySweepSync)
70 , myBeamParameterIndex(orig.myBeamParameterIndex)
71 , myBeamFunction(orig.myBeamFunction)
72 , myHighDensity(orig.myHighDensity)
73 , myTrackJamTargets(orig.myTrackJamTargets)
109 (myERP == rhs.
myERP) &&
114 (myPRF == rhs.
myPRF) &&
143 void addTrackJamTarget(const
DtUUID& s) { myTrackJamTargets.insert(s); };
151 unsigned short myBeamId;
199 std::vector<DtEmitterSystemBeamStateData>::iterator iter = beams.begin();
200 std::vector<DtEmitterSystemBeamStateData>::iterator end = beams.end();
203 if (iter->beamId() == beamId)
216 std::vector<DtEmitterSystemBeamStateData>::const_iterator iter = beams.begin();
217 std::vector<DtEmitterSystemBeamStateData>::const_iterator end = beams.end();
220 if (iter->beamId() == beamId)
233 std::vector<DtEmitterSystemBeamStateData>::iterator iter = beams.begin();
234 std::vector<DtEmitterSystemBeamStateData>::iterator end = beams.end();
237 if (iter->beamId() == beamIndex)
249 return (beamsTrackingObject(type, gid).
size() != 0);
254 std::vector<DtEmitterSystemBeamStateData>::const_iterator iter = beams.begin();
255 std::vector<DtEmitterSystemBeamStateData>::const_iterator end = beams.end();
256 std::vector<const DtEmitterSystemBeamStateData*> lst;
258 while (iter != beams.end())
260 if ((iter->beamType() == type) && iter->hasTrackJamTarget(gid))
262 lst.push_back(&(*iter));
273 unsigned short id = nextBeamId();
278 beams.push_back(data);
280 return &beams[beams.size() - 1];
290 return (*
this)[beamId];
295 return (*
this)[beamId];
300 if (index < beams.size())
302 return &beams[index];
310 if (index < beams.size())
312 return &beams[index];
324 std::vector<DtEmitterSystemBeamStateData>
beams;
331 , myEmitterFunction(0)
338 , mySystemName(orig.mySystemName)
339 , myEmitterFunction(orig.myEmitterFunction)
340 , myMountLocation(orig.myMountLocation)
341 , myBeamsList(orig.myBeamsList)
342 , mySystemId(orig.mySystemId)
343 , myGlobalId(orig.myGlobalId)
362 return myBeamsList.beamByBeamId(beamId);
367 return myBeamsList.beamByBeamId(beamId);
372 return myBeamsList.beamByBeamIndex(beamId);
377 return myBeamsList.beamByBeamIndex(beamId);
380 unsigned int numBeams()
const {
return myBeamsList.size(); };
384 const std::vector<DtEmitterSystemBeamStateData>&
rawBeams()
const {
return myBeamsList.beams; };
385 std::vector<DtEmitterSystemBeamStateData>&
rawBeams() {
return myBeamsList.beams; };
399 return myBeamsList.beamsTrackingObject(type, gid);
423 void removeBeam(
unsigned short beamId) { myBeamsList.removeBeam(beamId); };
435 unsigned int mySystemId;
436 unsigned int mySystemName;
437 unsigned int myEmitterFunction;
438 DtVector myMountLocation;
452 : DtFrameStateInterface(storage)
466 virtual const DtEmitterSystemBeamStateData* beamByBeamIndex(
unsigned short beamIndex)
const {
throw DtUnimplementedMethod(
"The const beamByBeamIndex() const method is unimplemented"); };
492 const std::vector<DtEmitterSystemBeamStateData>& beams()
const;
493 std::vector<DtEmitterSystemBeamStateData>& beams();
495 const DtUUID hostId()
const;
500 const unsigned int& systemName()
const;
501 void setSystemName(
const unsigned int&);
503 const unsigned int& emitterFunction()
const;
504 void setEmitterFunction(
const unsigned int&);
506 const bool& on()
const;
507 void setOn(
const bool&);
509 const DtVector& mountLocation()
const;
510 void setMountLocation(
const DtVector&);
512 const unsigned int numBeams()
const;
520 void removeAllBeams();
521 void removeBeam(
unsigned short beamId);
525 const std::vector<const DtEmitterSystemBeamStateData*> beamsTrackingObject(
const DtUUID& gid)
const;
526 const std::vector<const DtEmitterSystemBeamStateData*> beamsJammingObject(
const DtUUID& gid)
const;
528 bool tracking(
const DtUUID& gid)
const;
529 bool jamming(
const DtUUID& gid)
const;
538 virtual void makeReadOnly() {};
541 unsigned short myNextBeamId;
555 const std::vector<DtEmitterSystemBeamStateData>& beams()
const;
556 const DtUUID hostId()
const;
558 const unsigned int& systemName()
const;
559 const unsigned int& emitterFunction()
const;
560 const bool& on()
const;
561 const DtVector& mountLocation()
const;
562 const unsigned int numBeams()
const;
565 bool tracking(
const DtUUID& gid)
const;
566 bool jamming(
const DtUUID& gid)
const;
568 const std::vector<const DtEmitterSystemBeamStateData*> beamsTrackingObject(
const DtUUID& gid)
const;
569 const std::vector<const DtEmitterSystemBeamStateData*> beamsJammingObject(
const DtUUID& gid)
const;
596 virtual bool forceAdvance();
600 if (myNextFrameState.isWritable())
602 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
605 myCurrentFrameState.emitComponentUpdated();
610 myCurrentFrameState.updateStateData(sd);
611 myNextFrameState.updateStateData(sd);
617 myCurrentFrameState.aboutToBeDeleted();
618 myNextFrameState.aboutToBeDeleted();
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: emitterSystemStateComponent.h:598
std::vector< DtEmitterSystemBeamStateData > beams
Definition: emitterSystemStateComponent.h:324
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
unsigned int mySystemName
Definition: emitterSystemStateComponent.h:436
const std::vector< DtEmitterSystemBeamStateData > & rawBeams() const
Definition: emitterSystemStateComponent.h:384
std::set< DtUUID > myTrackJamTargets
Definition: emitterSystemStateComponent.h:168
DtStateData * myStateData
Definition: emitterSystemStateComponent.h:579
void removeAllBeams()
Definition: emitterSystemStateComponent.h:318
virtual const DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:467
bool(* DtVerifyTrackJamTargetCallback)(const DtUUID &target, const DtEmitterSystemBeamStateData &beam, void *usr)
Definition: emitterSystemStateComponent.h:21
Definition: stateDataTypes.h:23
DtEmitterSystemBeamStateData * addBeam()
Definition: emitterSystemStateComponent.h:381
std::vector< const DtEmitterSystemBeamStateData * > beamsJammingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:407
3) Define the current frame class. This will be used for read access.
Definition: emitterSystemStateComponent.h:547
DtEmitterSystemBeamStateData * operator[](unsigned short beamId)
Definition: emitterSystemStateComponent.h:197
unsigned short myBeamId
Definition: emitterSystemStateComponent.h:148
#define UNDEFINED_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:68
bool operator!=(const DtEmitterSystemBeamStateData &rhs) const
Definition: emitterSystemStateComponent.h:123
std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(DtEmitterSystemBeamStateData::BeamType type, const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:252
Definition: emitterSystemStateComponent.h:173
DtString myGlobalId
Definition: emitterSystemStateComponent.h:423
unsigned int mySystemId
Definition: emitterSystemStateComponent.h:152
double myAzimuthSweep
Definition: emitterSystemStateComponent.h:159
Definition: emitterSystemStateComponent.h:30
virtual void makeWritable()
Override to make component writable.
Definition: emitterSystemStateComponent.h:535
std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:402
double myFrequency
Definition: emitterSystemStateComponent.h:155
double myPRF
Definition: emitterSystemStateComponent.h:162
bool myOn
This ID will uniquely identify the emitter. Patterned after the DIS/HLA global id.
Definition: emitterSystemStateComponent.h:434
Definition: stateComponent.h:257
const DtEmitterSystemBeamStateData * operator[](unsigned short beamId) const
Definition: emitterSystemStateComponent.h:214
DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId)
Definition: emitterSystemStateComponent.h:288
void removeBeam(unsigned short beamId)
Definition: emitterSystemStateComponent.h:423
voidpf void uLong size
Definition: ioapi.h:39
virtual void aboutToBeDeleted() override
Definition: emitterSystemStateComponent.h:614
DtEmitterSystemStateComponentData myData
Definition: emitterSystemStateComponent.h:543
#define UNDEFINED_RETURNREF_ACCESSORS(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:40
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
virtual const DtFrameStateInterface * nextFrameState() const
Definition: emitterSystemStateComponent.h:593
unsigned short nextId
Definition: emitterSystemStateComponent.h:325
virtual void removeTrackJamTarget(const DtUUID &globalId, DtEmitterSystemBeamStateData::BeamType)
Definition: emitterSystemStateComponent.h:476
virtual const std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:472
Contains the DtUUID class declaration.
bool myHighDensity
Definition: emitterSystemStateComponent.h:167
DtEmitterSystemBeams myBeamsList
Definition: emitterSystemStateComponent.h:439
DtEmitterSystemBeamStateData(const DtEmitterSystemBeamStateData &orig)
Definition: emitterSystemStateComponent.h:55
void removeAllBeams()
Definition: emitterSystemStateComponent.h:422
DtEmitterSystemBeamStateData & operator=(const DtEmitterSystemBeamStateData &rhs)
Definition: emitterSystemStateComponent.h:77
virtual void addTrackJamTarget(const DtUUID &globalId, DtEmitterSystemBeamStateData::BeamType, DtVerifyTrackJamTargetCallback=0, void *userData=0)
Definition: emitterSystemStateComponent.h:474
Definition: emitterSystemStateComponent.h:171
bool tracking(DtEmitterSystemBeamStateData::BeamType type, const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:247
int myBeamType
Definition: emitterSystemStateComponent.h:153
DtEmitterSystemStateComponentData & operator=(const DtEmitterSystemStateComponentData &rhs)
Definition: emitterSystemStateComponent.h:347
virtual DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId)
Definition: emitterSystemStateComponent.h:469
std::vector< const DtEmitterSystemBeamStateData * > beamsTrackingObject(DtEmitterSystemBeamStateData::BeamType type, const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:397
DtEmitterSystemBeamStateData()
Definition: emitterSystemStateComponent.h:34
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:489
DtStateData * myStateData
Definition: emitterSystemStateComponent.h:542
DtEmitterSystemBeams & operator=(const DtEmitterSystemBeams &rhs)
Definition: emitterSystemStateComponent.h:185
unsigned int myBeamFunction
Definition: emitterSystemStateComponent.h:166
DtVector myMountLocation
Definition: emitterSystemStateComponent.h:438
DtEmitterSystemStateComponentData myData
Definition: emitterSystemStateComponent.h:580
void advanceFrame(const DtEmitterSystemStateComponentData &data)
Definition: emitterSystemStateComponent.h:573
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: emitterSystemStateComponent.h:585
DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short index)
Definition: emitterSystemStateComponent.h:298
#define UNDEFINED_CONST_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:65
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
unsigned int myJammingModeSequence
Definition: emitterSystemStateComponent.h:154
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
virtual const std::vector< const DtEmitterSystemBeamStateData * > beamsJammingObject(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:473
bool jamming(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:412
bool operator==(const DtEmitterSystemBeamStateData &rhs) const
Definition: emitterSystemStateComponent.h:101
double myElevationSweep
Definition: emitterSystemStateComponent.h:161
double myPulseWidth
Definition: emitterSystemStateComponent.h:163
DtEmitterSystemBeams(const DtEmitterSystemBeams &orig)
Definition: emitterSystemStateComponent.h:180
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:365
double mySweepSync
Definition: emitterSystemStateComponent.h:164
void setTrackJamTargets(const std::set< DtUUID > &t)
Definition: emitterSystemStateComponent.h:148
int size() const
Definition: emitterSystemStateComponent.h:192
bool isDoubleBuffered()
Definition: emitterSystemStateComponent.h:590
DtEmitterSystemStateComponentNextFrame myNextFrameState
Definition: emitterSystemStateComponent.h:623
DtEmitterSystemStateComponentData(const DtEmitterSystemStateComponentData &orig)
Definition: emitterSystemStateComponent.h:336
const DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:375
BeamType
Definition: emitterSystemStateComponent.h:26
const DtEmitterSystemStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: emitterSystemStateComponent.h:553
DtEmitterSystemStateComponentData & frameState()
Definition: emitterSystemStateComponent.h:490
const DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short index) const
Definition: emitterSystemStateComponent.h:308
virtual void aboutToBeDeleted()
virtual DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamIndex)
Definition: emitterSystemStateComponent.h:468
const DtEmitterSystemBeams & beams() const
Definition: emitterSystemStateComponent.h:383
bool jamming(const DtUUID &gid)
Definition: emitterSystemStateComponent.h:417
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:446
std::vector< DtEmitterSystemBeamStateData > & rawBeams()
Definition: emitterSystemStateComponent.h:385
DtEmitterSystemBeams & beams()
Definition: emitterSystemStateComponent.h:382
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
bool tracking(const DtUUID &gid)
Definition: emitterSystemStateComponent.h:392
DtEmitterSystemBeamStateData * addBeam()
Definition: emitterSystemStateComponent.h:271
double myERP
Definition: emitterSystemStateComponent.h:157
const DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:365
DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId)
Definition: emitterSystemStateComponent.h:360
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
static const char * SystemName
Definition: vrfXmlTypes.h:48
2) Define the next frame class. This will be used for write access.
Definition: emitterSystemStateComponent.h:483
bool hasTrackJamTarget(const DtUUID &s) const
Definition: emitterSystemStateComponent.h:146
const DtEmitterSystemBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: emitterSystemStateComponent.h:293
unsigned short nextBeamId() const
Definition: emitterSystemStateComponent.h:283
DtEmitterSystemStateComponentCurrentFrame myCurrentFrameState
Definition: emitterSystemStateComponent.h:622
unsigned int mySystemId
Definition: emitterSystemStateComponent.h:435
double myAzimuthCenter
Definition: emitterSystemStateComponent.h:158
unsigned int myEmitterFunction
Definition: emitterSystemStateComponent.h:437
void removeTrackJamTarget(const DtUUID &s)
Definition: emitterSystemStateComponent.h:144
unsigned int numBeams() const
Definition: emitterSystemStateComponent.h:380
DtStateComponentCreator< DtEmitterSystemStateComponentImplementation > DtEmitterSystemStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: emitterSystemStateComponent.h:628
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:26
unsigned int myBeamParameterIndex
Definition: emitterSystemStateComponent.h:165
Definition: stateComponent.h:80
double myFrequencyRange
Definition: emitterSystemStateComponent.h:156
virtual DtFrameStateInterface * nextFrameState()
Definition: emitterSystemStateComponent.h:592
const DtFrameStateInterface * currentFrameState() const
Definition: emitterSystemStateComponent.h:591
Contains the DtStateComponent class declaration.
DtEmitterSystemBeamStateData * beamByBeamIndex(unsigned short beamId)
Definition: emitterSystemStateComponent.h:370
void removeBeam(unsigned int beamIndex)
Definition: emitterSystemStateComponent.h:231
void clearTrackJamTargets()
Definition: emitterSystemStateComponent.h:147
The DtEmitterSystemStateComponentList is a collection of emitter systems and the beams they represent...
Definition: emitterSystemStateComponent.h:24
Definition: emitterSystemStateComponent.h:31
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
bool tracking(const DtUUID &gid) const
Definition: emitterSystemStateComponent.h:387
const std::set< DtUUID > & trackJamTargets() const
Definition: emitterSystemStateComponent.h:145
DtEmitterSystemStateComponentData()
Definition: emitterSystemStateComponent.h:328
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: emitterSystemStateComponent.h:608
DtEmitterSystemBeams()
Definition: emitterSystemStateComponent.h:176
double myElevationCenter
Definition: emitterSystemStateComponent.h:160