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 virtual const DtUUID hostId()
const override;
137 virtual const bool& publish()
const override;
138 virtual void setPublish(
const bool&)
override;
140 virtual const bool hullMaskerOn()
const override;
141 virtual void setHullMaskerOn(
const bool&)
override;
143 virtual const int& passiveParameterIndex()
const override;
144 virtual void setPassiveParameterIndex(
const int&)
override;
146 virtual const unsigned int propulsionPlantConfiguration()
const override;
147 virtual void setPropulsionPlantConfiguration(
const unsigned int&)
override;
153 virtual void makeWritable()
override;
156 virtual void makeReadOnly()
override;
173 virtual const DtUUID hostId()
const override;
174 virtual const bool& publish()
const override;
175 virtual const bool hullMaskerOn()
const override;
177 virtual const int& passiveParameterIndex()
const override;
178 virtual const unsigned int propulsionPlantConfiguration()
const override;
179 bool readComponentValid()
const;
181 bool findReadComponent();
184 void handleDataUpdated();
212 if (myNextFrameState.isWritable())
214 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
217 myCurrentFrameState.emitComponentUpdated();
222 myCurrentFrameState.updateStateData(sd);
223 myNextFrameState.updateStateData(sd);
229 myCurrentFrameState.aboutToBeDeleted();
230 myNextFrameState.aboutToBeDeleted();
234 virtual bool forceAdvance()
override;
237 virtual void firstFrameAdvance()
override;
Definition: stateComponent.h:88
UUID is a unique ID wrapper class.
Definition: uuid.h:59
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:200
std::vector< UnderwaterAcousticShaftSpeed > ShaftData
Definition: underwaterAcousticsStateComponent.h:91
DtUnderwaterAcousticsStateComponentData myData
Definition: underwaterAcousticsStateComponent.h:193
LOM::WritePropulsionNoiseRepository myWritePropulsionNoiseRepository
Definition: underwaterAcousticsStateComponent.h:160
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: underwaterAcousticsStateComponent.h:210
3) Define the current frame class. This will be used for read access.
Definition: underwaterAcousticsStateComponent.h:164
DtUnderwaterAcousticsStateComponentData myData
Definition: underwaterAcousticsStateComponent.h:159
LOM::ReadPropulsionNoiseRepository myReadPropulsionNoiseRepository
Definition: underwaterAcousticsStateComponent.h:194
Definition: stateComponent.h:269
UnderwaterAcousticShaftSpeed()
Definition: underwaterAcousticsStateComponent.h:24
DtUnderwaterAcousticsStateComponentData(const DtUnderwaterAcousticsStateComponentData &orig)
Definition: underwaterAcousticsStateComponent.h:75
DtUnderwaterAcousticsStateComponentNextFrame myNextFrameState
Definition: underwaterAcousticsStateComponent.h:241
DtUnderwaterAcousticsStateComponentCurrentFrame myCurrentFrameState
Definition: underwaterAcousticsStateComponent.h:240
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
Contains the DtUUID class declaration.
virtual void aboutToBeDeleted() override
Definition: underwaterAcousticsStateComponent.h:226
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:398
unsigned short myShaftRPM_RateOfChange
Definition: underwaterAcousticsStateComponent.h:66
int myPassiveParameterIndex
Definition: underwaterAcousticsStateComponent.h:101
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
void advanceFrame(const DtUnderwaterAcousticsStateComponentData &data)
Definition: underwaterAcousticsStateComponent.h:187
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: underwaterAcousticsStateComponent.h:206
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:384
bool isDoubleBuffered()
Definition: underwaterAcousticsStateComponent.h:205
#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:195
bool myFoundComponent
Definition: underwaterAcousticsStateComponent.h:242
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
virtual DtFrameStateInterface * nextFrameState() override
Definition: underwaterAcousticsStateComponent.h:207
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
unsigned short myCurrentShaftRPM
Definition: underwaterAcousticsStateComponent.h:64
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
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: underwaterAcousticsStateComponent.h:208
#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
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: underwaterAcousticsStateComponent.h:220
const DtUnderwaterAcousticsStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: underwaterAcousticsStateComponent.h:171
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:247
Definition: underwaterAcousticsStateComponent.h:20
Contains the DtStateComponent class declaration.
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
bool operator!=(const UnderwaterAcousticShaftSpeed &rhs) const
Definition: underwaterAcousticsStateComponent.h:54
unsigned short myOrderedShaftRPM
Definition: underwaterAcousticsStateComponent.h:65
DtUnderwaterAcousticsStateComponentData & frameState()
Definition: underwaterAcousticsStateComponent.h:133