![]() |
VR-Forces 4.3 Class Documentation
|
Description: The Exercise Clock keeps track of current simulated time. More...

Public Member Functions | |
| DtExerciseClock () | |
| default constructor | |
| DtExerciseClock (DtSimManager *simManager) | |
| useful constructor | |
| DtExerciseClock (const DtExerciseClock &orig) | |
| copy constructor | |
| DtExerciseClock & | operator= (const DtExerciseClock &orig) |
| assignment operator | |
| virtual | ~DtExerciseClock () |
| destructor | |
| virtual void | init () |
| Initializes the clock - must be called before any other member functions are called. | |
| virtual void | reset () |
| Initialize the clock to 00:00:00 elapsed time. | |
| virtual void | tick () |
| Advance simulation time, if not paused. | |
| virtual void | pause () |
| Tell tick() not to advance simulation time. | |
| virtual void | resume () |
| Tells tick() to resume advancing simluation time. | |
| virtual bool | isPaused () const |
| Returns true if system is paused, false otherwise. | |
| virtual void | setFixedFrameMode (DtTime dT) |
| Tells the exercise clock to use a best effort fixed frame (constant dT). | |
| virtual bool | isFixedFrameMode () |
| virtual void | setRunToCompleteFrameMode () |
| Go into variable frame (run to complete) mode. | |
| virtual bool | isRunToCompleteFrameMode () |
| virtual void | setHybridFrameMode (DtTime dT) |
| Go into a hybrid mode of fixed dT run-to complete. | |
| virtual bool | isHybridFrameMode () |
| virtual void | setFixedFrameRate (DtTime dT) |
| Change the value to be used in fixed frame or hybrid frame mode. | |
| virtual DtTime | fixedFrameRate () |
| Get the curent rate if in fixed frame or hybrid frame mode; otherwise, returns 0.0. | |
| virtual void | setTimeMultiplier (DtFloat64 timeMultiplier) |
| Set faster or slower than real-time operation (the range of values for which the system will perform in a rational manner have yet to be determined.) | |
| virtual DtFloat64 | timeMultiplier () const |
| Returns time multiplier, a real scalar. | |
| virtual DtString & | elapsedSimTimeString (DtString &strBuffer) const |
| Returns elapsed time as a string in the form ddd:hh:mm:ss. | |
| virtual void | setExerciseStartTime (DtTime time) |
| Set exercise start time in seconds. | |
| virtual DtTime | exerciseStartTime () const |
| Use this to get the time the exercise started, expressed in seconds. | |
| virtual DtString & | exerciseStartTimeString (DtString &strBuffer) const |
| virtual DtTime | exerciseTime () const |
| Returns current exercise time (exercise start time + elapsed time). | |
| virtual DtString & | exerciseTimeString (DtString &strBuffer) const |
| virtual void | set_dT (DtTime dT) |
| Force a dT value (if called after tick!); note - this does not update elapsed time. | |
| virtual DtTime | dT () const |
| Returns dT, in seconds. | |
| virtual double | simTimeScale () const |
| virtual void | registerInterfaceCallbacks () |
| Register callbacks on the sim manager's interface message executive. | |
Public Member Functions inherited from DtSimClock | |
| DtSimClock () | |
| DtSimClock (const DtSimClock &orig) | |
| DtSimClock & | operator= (const DtSimClock &orig) |
| virtual | ~DtSimClock () |
Static Public Member Functions | |
| static void | setTimeMultiplierCallback (DtSimMessage *msg, void *usr) |
| Callback registered on the simManager's Message executive. | |
| static void | frameModeCallback (DtSimMessage *msg, void *usr) |
| Callback registered on the simManager's Message executive. | |
Static Public Member Functions inherited from DtSimClock | |
| static DtTime | stringToSeconds (const DtString &timeString) |
| static conversion functions | |
| static DtString & | secondsToElapsedTimeString (DtTime seconds, DtString &strBuffer) |
| static DtString & | secondsToExerciseTimeString (DtTime seconds, DtString &strBuffer) |
| static void | secondsToDaysHoursMinutesSeconds (DtTime secondsInput, int &days, int &hours, int &minutes, DtTime &seconds) |
| static DtTime | daysHoursMinutesSecondsToSeconds (DtTime days, DtTime hours, DtTime minutes, DtTime seconds) |
| static bool | processElapsedTimeString (const char *input, int &numDigitsFound, int &value1, int &value2, int &value3, int &value4) |
Protected Types | |
| enum | FrameMode { FmRunToComplete, FmFixed, FmHybrid } |
Protected Member Functions | |
| virtual void | processSetTimeMultiplier (const DtIfSetTimeMultiplier &timeMultiplerData) |
| Sets time multiplier with value given in message. | |
Protected Attributes | |
| enum DtExerciseClock::FrameMode | myFrameMode |
| bool | myFirstFrame |
| bool | myPaused |
| DtTime | myLastRealTime |
| DtTime | my_dT |
| DtFloat64 | myTimeMultiplier |
| DtSimManager * | mySimManager |
| DtTime | myFixedFrameRate |
| DtTime | myExerciseStartTime |
| double | mySimTimeScale |
| DtTime | myLastSetSimTime |
Description: The Exercise Clock keeps track of current simulated time.
When 'ticked', it advances simulation time based on elapsed real time since the last time it was ticked and a time-multiplier that allows the exercise clock to run faster or slower than real-time. The exercise clock also supports a pause/resume capability.
|
protected |
| DtExerciseClock::DtExerciseClock | ( | ) |
default constructor
| DtExerciseClock::DtExerciseClock | ( | DtSimManager * | simManager | ) |
useful constructor
| DtExerciseClock::DtExerciseClock | ( | const DtExerciseClock & | orig | ) |
copy constructor
|
virtual |
destructor
| DtExerciseClock& DtExerciseClock::operator= | ( | const DtExerciseClock & | orig | ) |
assignment operator
|
virtual |
Initializes the clock - must be called before any other member functions are called.
Reimplemented in DtHlaExerciseClock.
|
virtual |
Initialize the clock to 00:00:00 elapsed time.
|
virtual |
Advance simulation time, if not paused.
Reimplemented in DtHlaExerciseClock.
|
virtual |
Tell tick() not to advance simulation time.
|
virtual |
Tells tick() to resume advancing simluation time.
|
inlinevirtual |
Returns true if system is paused, false otherwise.
References myPaused.
|
virtual |
Tells the exercise clock to use a best effort fixed frame (constant dT).
|
virtual |
|
virtual |
Go into variable frame (run to complete) mode.
|
virtual |
|
virtual |
Go into a hybrid mode of fixed dT run-to complete.
|
virtual |
|
virtual |
Change the value to be used in fixed frame or hybrid frame mode.
This will have no effect in run to complete frame mode.
|
virtual |
Get the curent rate if in fixed frame or hybrid frame mode; otherwise, returns 0.0.
|
virtual |
Set faster or slower than real-time operation (the range of values for which the system will perform in a rational manner have yet to be determined.)
|
virtual |
Returns time multiplier, a real scalar.
Returns elapsed time as a string in the form ddd:hh:mm:ss.
|
virtual |
Set exercise start time in seconds.
|
virtual |
Use this to get the time the exercise started, expressed in seconds.
|
virtual |
Returns current exercise time (exercise start time + elapsed time).
|
virtual |
Force a dT value (if called after tick!); note - this does not update elapsed time.
|
virtual |
Returns dT, in seconds.
|
virtual |
|
virtual |
Register callbacks on the sim manager's interface message executive.
If you override this, make sure you call the base function, or the entity manager will stop responding to those messages.
|
static |
Callback registered on the simManager's Message executive.
Calls processSetTimeMultipler().
|
static |
Callback registered on the simManager's Message executive.
|
protectedvirtual |
Sets time multiplier with value given in message.
Reimplemented in DtHlaExerciseClock.
|
protected |
|
protected |
|
protected |
Referenced by isPaused().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |