11 #include <legionStandardOM/sets/readPropulsionNoiseRepository.hpp>
12 #include <legionStandardOM/sets/writePropulsionNoiseRepository.hpp>
15 #include <vlutil/vlString.h>
16 #include <matrix/vlVector.h>
25 : myCurrentShaftRPM(0.)
26 , myOrderedShaftRPM(0.)
27 , myShaftRPM_RateOfChange(0.)
32 : myCurrentShaftRPM(orig.myCurrentShaftRPM)
33 , myOrderedShaftRPM(orig.myOrderedShaftRPM)
34 , myShaftRPM_RateOfChange(orig.myShaftRPM_RateOfChange)
56 return !(*
this == rhs);
64 unsigned short myCurrentShaftRPM;
65 unsigned short myOrderedShaftRPM;
66 unsigned short myShaftRPM_RateOfChange;
71 , myPassiveParameterIndex(1)
76 : myPublish(orig.myPublish)
77 , myShaftData(orig.myShaftData)
78 , myPassiveParameterIndex(orig.myPassiveParameterIndex)
91 typedef std::vector<UnderwaterAcousticShaftSpeed>
ShaftData;
96 ShaftData& shaftData() {
return myShaftData; };
135 const DtUUID hostId()
const;
137 const bool& publish()
const;
138 void setPublish(
const bool&);
140 const bool hullMaskerOn()
const;
141 void setHullMaskerOn(
const bool&);
143 const int& passiveParameterIndex()
const;
144 void setPassiveParameterIndex(
const int&);
146 const unsigned int propulsionPlantConfiguration()
const;
147 void setPropulsionPlantConfiguration(
const unsigned int&);
153 virtual void makeWritable();
156 virtual void makeReadOnly();
174 const DtUUID hostId()
const;
175 const bool& publish()
const;
176 const bool hullMaskerOn()
const;
178 const int& passiveParameterIndex()
const;
179 const unsigned int propulsionPlantConfiguration()
const;
180 bool readComponentValid()
const;
182 bool findReadComponent();
185 void handleDataUpdated();
214 if (myNextFrameState.isWritable())
216 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
219 myCurrentFrameState.emitComponentUpdated();
224 myCurrentFrameState.updateStateData(sd);
225 myNextFrameState.updateStateData(sd);
231 myCurrentFrameState.aboutToBeDeleted();
232 myNextFrameState.aboutToBeDeleted();
236 virtual bool forceAdvance();
239 virtual void firstFrameAdvance()
override;
Definition: stateComponent.h:83
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
const DtFrameStateInterface * currentFrameState() const
Definition: underwaterAcousticsStateComponent.h:208
bool myPublish
Definition: underwaterAcousticsStateComponent.h:96
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: underwaterAcousticsStateComponent.h:202
std::vector< UnderwaterAcousticShaftSpeed > ShaftData
Definition: underwaterAcousticsStateComponent.h:91
DtUnderwaterAcousticsStateComponentData myData
Definition: underwaterAcousticsStateComponent.h:194
LOM::WritePropulsionNoiseRepository myWritePropulsionNoiseRepository
Definition: underwaterAcousticsStateComponent.h:160
virtual const DtFrameStateInterface * nextFrameState() const
Definition: underwaterAcousticsStateComponent.h:210
3) Define the current frame class. This will be used for read access.
Definition: underwaterAcousticsStateComponent.h:165
DtUnderwaterAcousticsStateComponentData myData
Definition: underwaterAcousticsStateComponent.h:159
LOM::ReadPropulsionNoiseRepository myReadPropulsionNoiseRepository
Definition: underwaterAcousticsStateComponent.h:195
Definition: stateComponent.h:257
UnderwaterAcousticShaftSpeed()
Definition: underwaterAcousticsStateComponent.h:24
DtUnderwaterAcousticsStateComponentData(const DtUnderwaterAcousticsStateComponentData &orig)
Definition: underwaterAcousticsStateComponent.h:75
DtUnderwaterAcousticsStateComponentNextFrame myNextFrameState
Definition: underwaterAcousticsStateComponent.h:243
DtStateData * myStateData
Definition: underwaterAcousticsStateComponent.h:161
DtUnderwaterAcousticsStateComponentCurrentFrame myCurrentFrameState
Definition: underwaterAcousticsStateComponent.h:242
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: underwaterAcousticsStateComponent.h:222
Contains the DtUUID class declaration.
virtual void aboutToBeDeleted() override
Definition: underwaterAcousticsStateComponent.h:228
UnderwaterAcousticShaftSpeed(const UnderwaterAcousticShaftSpeed &orig)
Definition: underwaterAcousticsStateComponent.h:31
ShaftData myShaftData
Definition: underwaterAcousticsStateComponent.h:100
const DtUnderwaterAcousticsStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: underwaterAcousticsStateComponent.h:132
bool operator==(const UnderwaterAcousticShaftSpeed &rhs) const
Definition: underwaterAcousticsStateComponent.h:47
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
unsigned short myShaftRPM_RateOfChange
Definition: underwaterAcousticsStateComponent.h:66
int myPassiveParameterIndex
Definition: underwaterAcousticsStateComponent.h:101
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
void advanceFrame(const DtUnderwaterAcousticsStateComponentData &data)
Definition: underwaterAcousticsStateComponent.h:188
UnderwaterAcousticShaftSpeed & operator=(const UnderwaterAcousticShaftSpeed &rhs)
Definition: underwaterAcousticsStateComponent.h:38
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:365
bool isDoubleBuffered()
Definition: underwaterAcousticsStateComponent.h:207
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
DtUnderwaterAcousticsStateComponentData & operator=(const DtUnderwaterAcousticsStateComponentData &rhs)
Definition: underwaterAcousticsStateComponent.h:82
virtual void aboutToBeDeleted()
unsigned int myCallbackHandle
Definition: underwaterAcousticsStateComponent.h:197
bool myFoundComponent
Definition: underwaterAcousticsStateComponent.h:244
virtual DtFrameStateInterface * nextFrameState()
Definition: underwaterAcousticsStateComponent.h:209
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
unsigned short myCurrentShaftRPM
Definition: underwaterAcousticsStateComponent.h:64
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: underwaterAcousticsStateComponent.h:212
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: underwaterAcousticsStateComponent.h:106
#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
Definition: underwaterAcousticsStateComponent.h:22
const DtUnderwaterAcousticsStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: underwaterAcousticsStateComponent.h:172
2) Define the next frame class. This will be used for write access.
Definition: underwaterAcousticsStateComponent.h:125
DtStateComponentCreator< DtUnderwaterAcousticsStateComponentImplementation > DtUnderwaterAcousticsStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: underwaterAcousticsStateComponent.h:249
Definition: underwaterAcousticsStateComponent.h:20
Contains the DtStateComponent class declaration.
DtStateData * myStateData
Definition: underwaterAcousticsStateComponent.h:196
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 operator!=(const UnderwaterAcousticShaftSpeed &rhs) const
Definition: underwaterAcousticsStateComponent.h:54
unsigned short myOrderedShaftRPM
Definition: underwaterAcousticsStateComponent.h:65
DtUnderwaterAcousticsStateComponentData & frameState()
Definition: underwaterAcousticsStateComponent.h:133