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"
27 myScenarioStartTimeAtLocalOnFirstObjectCreationToTime = 36000;
28 myUpdateWhenTimeChangedBy = 60.;
29 myDateAndTimeOfDay = 43200.0;
30 myScenarioStartTimeIsLocal =
true;
52 return (myDateAndTimeOfDay != 43200.0);
57 DEFINE_ACCESSOR_MUTATOR(
int, scenarioStartTimeAtLocalOnFirstObjectCreationToTime, ScenarioStartTimeAtLocalOnFirstObjectCreationToTime)
61 int myScenarioStartTimeAtLocalOnFirstObjectCreationToTime;
62 double myUpdateWhenTimeChangedBy;
63 double myDateAndTimeOfDay;
67 bool myScenarioStartTimeIsLocal;
78 : DtFrameStateInterface(storage)
87 virtual
void setDateAndTimeOfDay(const
double&,
bool markModified = false) {
throw DtUnimplementedMethod(
"void setDateAndTimeOfDay(double, bool markModified = false) is not implemented for this class."); };
109 const double dateAndTimeOfDay()
const;
110 void setDateAndTimeOfDay(
const double&,
bool markModified =
false);
112 const double updateWhenTimeChangedBy()
const;
113 void setUpdateWhenTimeChangedBy(
const double&);
115 const double timeOfDayAdvancementSpeed()
const;
116 void setTimeOfDayAdvancementSpeed(
const double&);
118 const bool useDayNightIlluminationModel()
const;
119 void setUseDayNightIlluminationModel(
const bool&);
121 const int scenarioStartTimeAtLocalOnFirstObjectCreationToTime()
const;
122 void setScenarioStartTimeAtLocalOnFirstObjectCreationToTime(
const int&);
125 void setTimeToLocalOnFirstPlacement(
const bool&);
126 const bool timeToLocalOnFirstPlacement()
const;
129 void setUserModifiedTime(
const bool&);
130 const bool userModifiedTime()
const;
133 void setAlreadySetTimePlacement(
const bool&);
134 const bool alreadySetTimePlacement()
const;
137 void setCanSetScenarioPreStartTime(
const bool&);
138 const bool canSetScenarioPreStartTime()
const;
142 void setScenarioStartTimeIsLocal(
const bool&);
143 const bool scenarioStartTimeIsLocal()
const;
145 const DtString timeOfDayString()
const;
148 void setTimeOfDay(
const double& value);
151 const double timeOfDay()
const;
154 virtual void makeWritable();
157 virtual void makeReadOnly();
175 bool readComponentValid()
const;
176 bool findReadComponent();
178 const double updateWhenTimeChangedBy()
const;
179 const double dateAndTimeOfDay()
const;
180 const double timeOfDayAdvancementSpeed()
const;
181 const bool useDayNightIlluminationModel()
const;
182 const int scenarioStartTimeAtLocalOnFirstObjectCreationToTime()
const;
183 const DtString timeOfDayString()
const;
184 const bool timeToLocalOnFirstPlacement()
const;
185 const bool userModifiedTime()
const;
186 const bool scenarioStartTimeIsLocal()
const;
189 const bool alreadySetTimePlacement()
const;
191 const bool canSetScenarioPreStartTime()
const;
192 const double timeOfDay()
const;
195 void dateAndTimeOfDayChanged();
222 void updateDataStorage();
226 myCurrentFrameState.updateStateData(sd);
227 myNextFrameState.updateStateData(sd);
231 virtual bool forceAdvance();
234 virtual void firstFrameAdvance()
override;
241 myCurrentFrameState.aboutToBeDeleted();
242 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:63
bool dateAndTimeOfDayHasBeenSet() const
Definition: timeAndDateStateComponent.h:50
Definition: stateDataTypes.h:23
DtTimeAndDateStateComponentData myData
Definition: timeAndDateStateComponent.h:207
bool myFoundComponent
Definition: timeAndDateStateComponent.h:248
Definition: stateComponent.h:79
DtTimeAndDateStateComponentData(const DtTimeAndDateStateComponentData &orig)
Definition: timeAndDateStateComponent.h:33
2) Define the next frame class. This will be used for write access.
Definition: timeAndDateStateComponent.h:100
DtTimeAndDateStateComponentData & operator=(const DtTimeAndDateStateComponentData &rhs)
Definition: timeAndDateStateComponent.h:41
Definition: stateComponent.h:266
int myScenarioStartTimeAtLocalOnFirstObjectCreationToTime
Definition: timeAndDateStateComponent.h:61
DtStateData * myStateData
Definition: timeAndDateStateComponent.h:206
virtual void aboutToBeDeleted() override
Definition: timeAndDateStateComponent.h:238
unsigned int myCallbackHandle
Definition: timeAndDateStateComponent.h:205
3) Define the current frame class. This will be used for read access.
Definition: timeAndDateStateComponent.h:166
void advanceFrame(const DtTimeAndDateStateComponentData &data)
Definition: timeAndDateStateComponent.h:198
virtual DtFrameStateInterface * nextFrameState()
Definition: timeAndDateStateComponent.h:219
DtTimeAndDateStateComponentData()
Definition: timeAndDateStateComponent.h:25
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
Contains the DtUUID class declaration.
double myUpdateWhenTimeChangedBy
Definition: timeAndDateStateComponent.h:62
DtStateComponentCreator< DtTimeAndDateStateComponentImplementation > DtTimeAndDateStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: timeAndDateStateComponent.h:253
const DtTimeAndDateStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: timeAndDateStateComponent.h:173
double myDateAndTimeOfDay
Definition: timeAndDateStateComponent.h:63
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:72
DtTimeAndDateStateComponentNextFrame myNextFrameState
Definition: timeAndDateStateComponent.h:247
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
Contains the enums for cloud layers.
DtTimeAndDateStateComponentData & frameState()
Definition: timeAndDateStateComponent.h:107
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
#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:67
virtual void aboutToBeDeleted()
virtual const DtFrameStateInterface * nextFrameState() const
Definition: timeAndDateStateComponent.h:220
const DtFrameStateInterface * currentFrameState() const
Definition: timeAndDateStateComponent.h:218
DtTimeAndDateStateComponentCurrentFrame myCurrentFrameState
Definition: timeAndDateStateComponent.h:246
#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:212
VRF::WriteSimulationDateTimeRepository myWriteSimulationDateTimeRepository
Definition: timeAndDateStateComponent.h:160
DtTimeAndDateStateComponentData myData
Definition: timeAndDateStateComponent.h:162
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:204
Definition: timeAndDateStateComponent.h:23
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: timeAndDateStateComponent.h:224
Contains the DtStateComponent class declaration.
bool isDoubleBuffered()
Definition: timeAndDateStateComponent.h:217
DtStateData * myStateData
Definition: timeAndDateStateComponent.h:161
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
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:106