12 #include <matrix/vlVector.h>
23 , myAzimuthBeamWidth(0.)
24 , myElevationCenter(0.)
25 , myElevationBeamWidth(0.)
26 , myActiveEmissionParameterIndex(0)
32 : mySystemId(orig.mySystemId)
33 , myBeamId(orig.myBeamId)
34 , myAzimuthCenter(orig.myAzimuthCenter)
35 , myAzimuthBeamWidth(orig.myAzimuthBeamWidth)
36 , myElevationCenter(orig.myElevationCenter)
37 , myElevationBeamWidth(orig.myElevationBeamWidth)
38 , myActiveEmissionParameterIndex(orig.myActiveEmissionParameterIndex)
39 , myScanPattern(orig.myScanPattern)
67 unsigned int myBeamId;
68 unsigned int mySystemId;
69 double myAzimuthCenter;
70 double myAzimuthBeamWidth;
71 double myElevationCenter;
72 double myElevationBeamWidth;
73 unsigned int myActiveEmissionParameterIndex;
74 unsigned int myScanPattern;
105 std::vector<DtActiveSonarBeamStateData>::iterator iter = beams.begin();
106 std::vector<DtActiveSonarBeamStateData>::iterator end = beams.end();
109 if (iter->beamId() == beamId)
122 std::vector<DtActiveSonarBeamStateData>::const_iterator iter = beams.begin();
123 std::vector<DtActiveSonarBeamStateData>::const_iterator end = beams.end();
126 if (iter->beamId() == beamId)
139 std::vector<DtActiveSonarBeamStateData>::iterator iter = beams.begin();
140 std::vector<DtActiveSonarBeamStateData>::iterator end = beams.end();
143 if (iter->beamId() == beamId)
155 return (*
this)[beamId];
160 return (*
this)[beamId];
165 if (index < beams.size())
167 return &beams[index];
175 if (index < beams.size())
177 return &beams[index];
185 unsigned short id = nextBeamId();
190 beams.push_back(data);
192 return &beams[beams.size() - 1];
206 std::vector<DtActiveSonarBeamStateData> beams{};
207 unsigned short nextId{ 0 };
213 , mySystemFunction(0)
219 : myPublish(orig.myPublish)
220 , mySystemName(orig.mySystemName)
221 , mySystemFunction(orig.mySystemFunction)
222 , myMountLocation(orig.myMountLocation)
223 , myBeamsList(orig.myBeamsList)
224 , mySystemId(orig.mySystemId)
228 DtActiveSonarStateComponentData&
operator=(
const DtActiveSonarStateComponentData& rhs)
242 return myBeamsList.beamByBeamId(beamId);
247 return myBeamsList.beamByBeamId(beamId);
252 return myBeamsList.beamByBeamIndex(beamId);
257 return myBeamsList.beamByBeamIndex(beamId);
260 unsigned int numBeams()
const {
return myBeamsList.size(); };
264 const std::vector<DtActiveSonarBeamStateData>&
rawBeams()
const {
return myBeamsList.beams; };
265 std::vector<DtActiveSonarBeamStateData>&
rawBeams() {
return myBeamsList.beams; };
267 void removeBeam(
unsigned short beamId) { myBeamsList.removeBeam(beamId); };
277 unsigned int mySystemId;
278 unsigned int mySystemName;
279 unsigned int mySystemFunction;
280 DtVector myMountLocation;
292 : DtFrameStateInterface(storage)
305 virtual const DtActiveSonarBeamStateData* beamByBeamIndex(
unsigned short beamIndex)
const {
throw DtUnimplementedMethod(
"The const beamByBeamIndex() const method is unimplemented"); };
309 virtual const DtActiveSonarStateComponentData&
frameState()
const {
throw DtUnimplementedMethod(
"The const DtActiveSonarStateComponentData& const frameState() method is unimplemented"); };
322 virtual const std::vector<DtActiveSonarBeamStateData>& beams()
const override;
323 virtual std::vector<DtActiveSonarBeamStateData>& beams()
override;
325 virtual const DtUUID hostId()
const override;
327 virtual const unsigned int& systemName()
const override;
328 virtual void setSystemName(
const unsigned int&)
override;
330 virtual const unsigned int& systemFunction()
const override;
331 virtual void setSystemFunction(
const unsigned int&)
override;
333 virtual const bool& publish()
const override;
334 virtual void setPublish(
const bool&)
override;
336 virtual const DtVector& mountLocation()
const override;
337 virtual void setMountLocation(
const DtVector&)
override;
339 virtual const unsigned int numBeams()
const override;
347 virtual void removeAllBeams()
override;
348 virtual void removeBeam(
unsigned short beamId)
override;
355 virtual void makeReadOnly()
override {};
358 unsigned short myNextBeamId;
370 virtual const std::vector<DtActiveSonarBeamStateData>& beams()
const override;
371 virtual const DtUUID hostId()
const override;
372 virtual const unsigned int& systemName()
const override;
373 virtual const unsigned int& systemFunction()
const override;
374 virtual const bool& publish()
const override;
375 virtual const DtVector& mountLocation()
const override;
376 virtual const unsigned int numBeams()
const override;
405 if (myNextFrameState.isWritable())
407 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
410 myCurrentFrameState.emitComponentUpdated();
415 myCurrentFrameState.updateStateData(sd);
416 myNextFrameState.updateStateData(sd);
422 myCurrentFrameState.aboutToBeDeleted();
423 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
double myAzimuthBeamWidth
Definition: activeSonarStateComponent.h:70
Definition: activeSonarStateComponent.h:79
void removeAllBeams()
Definition: activeSonarStateComponent.h:266
unsigned int myActiveEmissionParameterIndex
Definition: activeSonarStateComponent.h:73
Definition: stateDataTypes.h:23
unsigned int numBeams() const
Definition: activeSonarStateComponent.h:260
DtVector myMountLocation
Definition: activeSonarStateComponent.h:280
The DtActiveSonarStateComponentList is a collection of emitter systems and the beams they represent...
Definition: activeSonarStateComponent.h:17
DtActiveSonarBeamStateData * operator[](unsigned short beamId)
Definition: activeSonarStateComponent.h:103
virtual DtActiveSonarBeamStateData * beamByBeamId(unsigned short beamId)
Definition: activeSonarStateComponent.h:308
#define UNDEFINED_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:68
unsigned int myScanPattern
Definition: activeSonarStateComponent.h:74
unsigned int mySystemId
Definition: activeSonarStateComponent.h:68
DtActiveSonarBeamStateData * beamByBeamIndex(unsigned short beamId)
Definition: activeSonarStateComponent.h:250
const DtActiveSonarBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: activeSonarStateComponent.h:158
const DtActiveSonarBeamStateData * operator[](unsigned short beamId) const
Definition: activeSonarStateComponent.h:120
const DtActiveSonarBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: activeSonarStateComponent.h:245
virtual void aboutToBeDeleted() override
Definition: activeSonarStateComponent.h:419
Definition: stateComponent.h:269
DtActiveSonarStateComponentData & frameState()
Definition: activeSonarStateComponent.h:321
virtual DtFrameStateInterface * nextFrameState() override
Definition: activeSonarStateComponent.h:400
virtual DtActiveSonarBeamStateData * beamByBeamIndex(unsigned short beamIndex)
Definition: activeSonarStateComponent.h:307
unsigned int mySystemId
Definition: activeSonarStateComponent.h:277
#define UNDEFINED_RETURNREF_ACCESSORS(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:40
unsigned int mySystemFunction
Definition: activeSonarStateComponent.h:279
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
Contains the DtUUID class declaration.
const std::vector< DtActiveSonarBeamStateData > & rawBeams() const
Definition: activeSonarStateComponent.h:264
void advanceFrame(const DtActiveSonarStateComponentData &data)
Definition: activeSonarStateComponent.h:382
unsigned int myBeamId
Definition: activeSonarStateComponent.h:67
std::vector< DtActiveSonarBeamStateData > & rawBeams()
Definition: activeSonarStateComponent.h:265
unsigned int mySystemName
Definition: activeSonarStateComponent.h:278
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: activeSonarStateComponent.h:413
const DtActiveSonarBeams & beams() const
Definition: activeSonarStateComponent.h:263
DtActiveSonarBeamStateData(const DtActiveSonarBeamStateData &orig)
Definition: activeSonarStateComponent.h:31
DtActiveSonarStateComponentNextFrame myNextFrameState
Definition: activeSonarStateComponent.h:428
double myElevationCenter
Definition: activeSonarStateComponent.h:71
virtual const DtActiveSonarStateComponentData & frameState() const override
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: activeSonarStateComponent.h:369
virtual const DtActiveSonarBeamStateData * beamByBeamId(unsigned short beamId) const
Definition: activeSonarStateComponent.h:306
double myElevationBeamWidth
Definition: activeSonarStateComponent.h:72
DtActiveSonarBeamStateData * beamByBeamId(unsigned short beamId)
Definition: activeSonarStateComponent.h:240
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: activeSonarStateComponent.h:403
void removeBeam(unsigned short beamId)
Definition: activeSonarStateComponent.h:267
const DtActiveSonarBeamStateData * beamByBeamIndex(unsigned short beamId) const
Definition: activeSonarStateComponent.h:255
Definition: activeSonarStateComponent.h:77
DtActiveSonarBeamStateData * beamByBeamId(unsigned short beamId)
Definition: activeSonarStateComponent.h:153
DtActiveSonarStateComponentData myData
Definition: activeSonarStateComponent.h:388
3) Define the current frame class. This will be used for read access.
Definition: activeSonarStateComponent.h:363
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
DtActiveSonarBeamStateData()
Definition: activeSonarStateComponent.h:19
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
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: activeSonarStateComponent.h:286
DtActiveSonarStateComponentData(const DtActiveSonarStateComponentData &orig)
Definition: activeSonarStateComponent.h:218
void removeBeam(unsigned short beamId)
Definition: activeSonarStateComponent.h:137
DtActiveSonarBeams(const DtActiveSonarBeams &orig)
Definition: activeSonarStateComponent.h:86
DtActiveSonarBeamStateData * addBeam()
Definition: activeSonarStateComponent.h:183
DtActiveSonarStateComponentData & operator=(const DtActiveSonarStateComponentData &rhs)
Definition: activeSonarStateComponent.h:228
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
DtActiveSonarBeamStateData & operator=(const DtActiveSonarBeamStateData &rhs)
Definition: activeSonarStateComponent.h:43
virtual void aboutToBeDeleted()
bool myPublish
Definition: activeSonarStateComponent.h:267
DtActiveSonarBeams()
Definition: activeSonarStateComponent.h:82
2) Define the next frame class. This will be used for write access.
Definition: activeSonarStateComponent.h:314
virtual void makeWritable() override
Override to make component writable.
Definition: activeSonarStateComponent.h:352
int size() const
Definition: activeSonarStateComponent.h:98
std::vector< DtActiveSonarBeamStateData > beams
Definition: activeSonarStateComponent.h:206
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
DtActiveSonarBeams & beams()
Definition: activeSonarStateComponent.h:262
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
static const char * SystemName
Definition: vrfXmlTypes.h:46
Definition: stateComponent.h:87
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: activeSonarStateComponent.h:393
DtActiveSonarBeamStateData * beamByBeamIndex(unsigned short index)
Definition: activeSonarStateComponent.h:163
DtActiveSonarStateComponentData()
Definition: activeSonarStateComponent.h:210
#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
bool isDoubleBuffered()
Definition: activeSonarStateComponent.h:398
DtStateComponentCreator< DtActiveSonarStateComponentImplementation > DtActiveSonarStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: activeSonarStateComponent.h:433
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: activeSonarStateComponent.h:401
virtual const DtActiveSonarStateComponentData & frameState() const override
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: activeSonarStateComponent.h:320
Contains the DtStateComponent class declaration.
const DtActiveSonarBeamStateData * beamByBeamIndex(unsigned short index) const
Definition: activeSonarStateComponent.h:173
unsigned short nextBeamId()
Definition: activeSonarStateComponent.h:195
DtActiveSonarBeams & operator=(const DtActiveSonarBeams &rhs)
Definition: activeSonarStateComponent.h:91
void removeAllBeams()
Definition: activeSonarStateComponent.h:200
DtActiveSonarStateComponentData myData
Definition: activeSonarStateComponent.h:359
DtActiveSonarBeamStateData * addBeam()
Definition: activeSonarStateComponent.h:261
double myAzimuthCenter
Definition: activeSonarStateComponent.h:69
virtual const DtActiveSonarStateComponentData & frameState() const
Definition: activeSonarStateComponent.h:309
DtActiveSonarStateComponentCurrentFrame myCurrentFrameState
Definition: activeSonarStateComponent.h:427
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: activeSonarStateComponent.h:399
DtActiveSonarBeams myBeamsList
Definition: activeSonarStateComponent.h:281