10 #include <vlpi/netStructs.h>
11 #include <vlutil/vlString.h>
13 #include "legionDataStore/writeStateInstance.h"
14 #include "legionDataStore/readStateInstance.h"
15 #include "vrfOM/sets/writeSimulationDateTimeRepository.hpp"
16 #include "vrfOM/sets/readSimulationDateTimeRepository.hpp"
29 myScenarioStartTimeAtLocalOnFirstObjectCreationToTime = 36000;
30 myUpdateWhenTimeChangedBy = 60.;
31 myDateAndTimeOfDay = 43200.0;
32 myNetworkDateAndTimeOfDay = 0.;
33 myScenarioStartTimeIsLocal =
true;
57 return (myDateAndTimeOfDay != 43200.0);
63 DEFINE_ACCESSOR_MUTATOR(
int, scenarioStartTimeAtLocalOnFirstObjectCreationToTime, ScenarioStartTimeAtLocalOnFirstObjectCreationToTime)
67 int myScenarioStartTimeAtLocalOnFirstObjectCreationToTime;
68 double myUpdateWhenTimeChangedBy;
69 double myDateAndTimeOfDay;
70 double myNetworkDateAndTimeOfDay;
74 bool myScenarioStartTimeIsLocal;
85 : DtFrameStateInterface(storage)
95 virtual
void setDateAndTimeOfDay(const
double&,
bool markModified = false) {
throw DtUnimplementedMethod(
"void setDateAndTimeOfDay(double, bool markModified = false) is not implemented for this class."); };
117 virtual const double dateAndTimeOfDay()
const override;
118 virtual void setDateAndTimeOfDay(
const double&,
bool markModified =
false)
override;
120 virtual const double networkDateAndTimeOfDay()
const override;
121 virtual void setNetworkDateAndTimeOfDay(
const double&)
override;
123 virtual const double updateWhenTimeChangedBy()
const override;
124 virtual void setUpdateWhenTimeChangedBy(
const double&)
override;
126 virtual const double timeOfDayAdvancementSpeed()
const override;
127 virtual void setTimeOfDayAdvancementSpeed(
const double&)
override;
129 virtual const bool useDayNightIlluminationModel()
const override;
130 virtual void setUseDayNightIlluminationModel(
const bool&)
override;
132 virtual const int scenarioStartTimeAtLocalOnFirstObjectCreationToTime()
const override;
133 virtual void setScenarioStartTimeAtLocalOnFirstObjectCreationToTime(
const int&)
override;
136 virtual void setTimeToLocalOnFirstPlacement(
const bool&)
override;
137 virtual const bool timeToLocalOnFirstPlacement()
const override;
140 virtual void setUserModifiedTime(
const bool&)
override;
141 virtual const bool userModifiedTime()
const override;
144 virtual void setAlreadySetTimePlacement(
const bool&)
override;
145 virtual const bool alreadySetTimePlacement()
const override;
148 virtual void setCanSetScenarioPreStartTime(
const bool&)
override;
149 virtual const bool canSetScenarioPreStartTime()
const override;
153 virtual void setScenarioStartTimeIsLocal(
const bool&)
override;
154 virtual const bool scenarioStartTimeIsLocal()
const override;
156 virtual const DtString timeOfDayString()
const override;
159 virtual void setTimeOfDay(
const double& value)
override;
162 virtual const double timeOfDay()
const override;
165 virtual void makeWritable()
override;
168 virtual void makeReadOnly()
override;
185 bool readComponentValid()
const;
186 bool findReadComponent();
188 virtual const double updateWhenTimeChangedBy()
const override;
189 virtual const double dateAndTimeOfDay()
const override;
190 virtual const double networkDateAndTimeOfDay()
const override;
191 virtual const double timeOfDayAdvancementSpeed()
const override;
192 virtual const bool useDayNightIlluminationModel()
const override;
193 virtual const int scenarioStartTimeAtLocalOnFirstObjectCreationToTime()
const override;
194 virtual const DtString timeOfDayString()
const override;
195 virtual const bool timeToLocalOnFirstPlacement()
const override;
196 virtual const bool userModifiedTime()
const override;
197 virtual const bool scenarioStartTimeIsLocal()
const override;
200 virtual const bool alreadySetTimePlacement()
const override;
202 virtual const bool canSetScenarioPreStartTime()
const override;
203 virtual const double timeOfDay()
const override;
206 void dateAndTimeOfDayChanged();
232 virtual void updateDataStorage()
override;
236 myCurrentFrameState.updateStateData(sd);
237 myNextFrameState.updateStateData(sd);
241 virtual bool forceAdvance()
override;
244 virtual void firstFrameAdvance()
override;
251 myCurrentFrameState.aboutToBeDeleted();
252 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:64
bool dateAndTimeOfDayHasBeenSet() const
Definition: timeAndDateStateComponent.h:55
Definition: stateDataTypes.h:23
DtTimeAndDateStateComponentData myData
Definition: timeAndDateStateComponent.h:217
bool myFoundComponent
Definition: timeAndDateStateComponent.h:258
Definition: stateComponent.h:82
DtTimeAndDateStateComponentData(const DtTimeAndDateStateComponentData &orig)
Definition: timeAndDateStateComponent.h:36
2) Define the next frame class. This will be used for write access.
Definition: timeAndDateStateComponent.h:108
DtTimeAndDateStateComponentData & operator=(const DtTimeAndDateStateComponentData &rhs)
Definition: timeAndDateStateComponent.h:45
Definition: stateComponent.h:269
int myScenarioStartTimeAtLocalOnFirstObjectCreationToTime
Definition: timeAndDateStateComponent.h:67
virtual void aboutToBeDeleted() override
Definition: timeAndDateStateComponent.h:248
unsigned int myCallbackHandle
Definition: timeAndDateStateComponent.h:216
3) Define the current frame class. This will be used for read access.
Definition: timeAndDateStateComponent.h:176
void advanceFrame(const DtTimeAndDateStateComponentData &data)
Definition: timeAndDateStateComponent.h:209
DtTimeAndDateStateComponentData()
Definition: timeAndDateStateComponent.h:27
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
Contains the DtUUID class declaration.
double myUpdateWhenTimeChangedBy
Definition: timeAndDateStateComponent.h:68
virtual DtFrameStateInterface * nextFrameState() override
Definition: timeAndDateStateComponent.h:229
DtStateComponentCreator< DtTimeAndDateStateComponentImplementation > DtTimeAndDateStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: timeAndDateStateComponent.h:263
const DtTimeAndDateStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: timeAndDateStateComponent.h:183
double myDateAndTimeOfDay
Definition: timeAndDateStateComponent.h:69
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: timeAndDateStateComponent.h:79
DtTimeAndDateStateComponentNextFrame myNextFrameState
Definition: timeAndDateStateComponent.h:257
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
Contains the enums for cloud layers.
DtTimeAndDateStateComponentData & frameState()
Definition: timeAndDateStateComponent.h:115
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
bool myScenarioStartTimeIsLocal
If this is true (default) the time of day is to be considered a local time. If false, UTC time and this will be considered adjusted for local time.
Definition: timeAndDateStateComponent.h:74
double myNetworkDateAndTimeOfDay
Definition: timeAndDateStateComponent.h:70
virtual void aboutToBeDeleted()
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: timeAndDateStateComponent.h:230
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: timeAndDateStateComponent.h:234
DtTimeAndDateStateComponentCurrentFrame myCurrentFrameState
Definition: timeAndDateStateComponent.h:256
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: timeAndDateStateComponent.h:222
VRF::WriteSimulationDateTimeRepository myWriteSimulationDateTimeRepository
Definition: timeAndDateStateComponent.h:171
DtTimeAndDateStateComponentData myData
Definition: timeAndDateStateComponent.h:172
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: timeAndDateStateComponent.h:228
static DtUUID DtGlobalWeatherObjectUUID("VRF_UUID:73666f77-63d6-e041-a002-f2690e990574")
#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
VRF::ReadSimulationDateTimeRepository myReadSimulationDateTimeRepository
Definition: timeAndDateStateComponent.h:215
dateAndTimeOfDay is a possible dead reckoned date and time of day. networkDateAndTimeOfDay is the exa...
Definition: timeAndDateStateComponent.h:25
Contains the DtStateComponent class declaration.
bool isDoubleBuffered()
Definition: timeAndDateStateComponent.h:227
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
const DtTimeAndDateStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: timeAndDateStateComponent.h:114