DtSynchronizedTimeManager manages NTP synchronized time DtSynchronizedTimeManager is used by the display engine to provide an NTP synchronized time value, allowing users of this time to be synchronized across applications.
More...
Public Member Functions |
| virtual | ~DtSynchronizedTimeManager () |
| | DTOR.
|
| virtual double | syncedTime () const |
| | Returns synchronized time if the synchronized time flag has been set; otherwise reverts to standard DtDe::simulationTime()
|
| virtual double | timeEpoch () const |
| | To get millisecond resolution when starting from a absolute clock its necessary to reckon time from a starting point much closer to current clock time than.
|
| virtual double | calcScaledTimeOffset (double scaleFactor) const |
| | Calculate a time offset which will correctly adjust synchronized time given the specified scale factor.
|
|
| virtual void | setTimeScaleFactor (double scale) |
| | Set / get a scale factor for time.
|
| virtual double | timeScaleFactor () const |
| | Set / get a scale factor for time.
|
|
| virtual void | setTimeOffset (double offset) |
| | Set / get an offset that is added to the final calculated time (after scaling).
|
| virtual double | timeOffset () const |
| | Set / get an offset that is added to the final calculated time (after scaling).
|
Detailed Description
DtSynchronizedTimeManager manages NTP synchronized time DtSynchronizedTimeManager is used by the display engine to provide an NTP synchronized time value, allowing users of this time to be synchronized across applications.
It supports time scaling as well as offset time, which may be useful if trying to reproduce a previous synced state/.
Constructor & Destructor Documentation
| virtual makVrv::DtSynchronizedTimeManager::~DtSynchronizedTimeManager |
( |
| ) |
|
|
inlinevirtual |
| makVrv::DtSynchronizedTimeManager::DtSynchronizedTimeManager |
( |
DtDe & |
de | ) |
|
|
protected |
| makVrv::DtSynchronizedTimeManager::DtSynchronizedTimeManager |
( |
| ) |
|
|
private |
Unimplemented default CTOR.
Unimplemented copy constructor.
Member Function Documentation
| virtual double makVrv::DtSynchronizedTimeManager::syncedTime |
( |
| ) |
const |
|
virtual |
Returns synchronized time if the synchronized time flag has been set; otherwise reverts to standard DtDe::simulationTime()
| virtual double makVrv::DtSynchronizedTimeManager::timeEpoch |
( |
| ) |
const |
|
virtual |
To get millisecond resolution when starting from a absolute clock its necessary to reckon time from a starting point much closer to current clock time than.
- This returns the epoch that is calculated by calcTimeEpoch(), which is Midnight of the day the application is run at.
| virtual void makVrv::DtSynchronizedTimeManager::setTimeScaleFactor |
( |
double |
scale | ) |
|
|
virtual |
Set / get a scale factor for time.
To keep things synchronized, the scale factor needs to be applied directly to the sychronized time (not a delta). As such, when the scale factor changes the state of the ocean and speed trees will also change (it'jumps' to a different state). This can be avoided by adding an offset the same time that the scale factor is changed (but the offset needs to come from one place, logically the system controlling the scale factor, to keep things in sync - or - each application could calculate the offset if provided with the system time of the time scale-controlling system at the point of change, which would allow all applications to calculate the same offset. In either case, to avoid the jump and keep scaled time synchronized the master application needs to provide the scale factor and an offset or the system time which enables all the other applications to calculate that offset. The default scale factor is 1.
| virtual double makVrv::DtSynchronizedTimeManager::timeScaleFactor |
( |
| ) |
const |
|
virtual |
Set / get a scale factor for time.
To keep things synchronized, the scale factor needs to be applied directly to the sychronized time (not a delta). As such, when the scale factor changes the state of the ocean and speed trees will also change (it'jumps' to a different state). This can be avoided by adding an offset the same time that the scale factor is changed (but the offset needs to come from one place, logically the system controlling the scale factor, to keep things in sync - or - each application could calculate the offset if provided with the system time of the time scale-controlling system at the point of change, which would allow all applications to calculate the same offset. In either case, to avoid the jump and keep scaled time synchronized the master application needs to provide the scale factor and an offset or the system time which enables all the other applications to calculate that offset. The default scale factor is 1.
| virtual void makVrv::DtSynchronizedTimeManager::setTimeOffset |
( |
double |
offset | ) |
|
|
virtual |
Set / get an offset that is added to the final calculated time (after scaling).
This may be used to reproduce a previous synchronized time state while still remaining synchronized (provided all appplications have the same offset, of course). Or to avoid jumps when time scaling
| virtual double makVrv::DtSynchronizedTimeManager::timeOffset |
( |
| ) |
const |
|
virtual |
Set / get an offset that is added to the final calculated time (after scaling).
This may be used to reproduce a previous synchronized time state while still remaining synchronized (provided all appplications have the same offset, of course). Or to avoid jumps when time scaling
| virtual double makVrv::DtSynchronizedTimeManager::calcScaledTimeOffset |
( |
double |
scaleFactor | ) |
const |
|
virtual |
Calculate a time offset which will correctly adjust synchronized time given the specified scale factor.
When changing the scale factor, you should call this to get the new offset, then set the new scale factor and offset.
| virtual void makVrv::DtSynchronizedTimeManager::calcTimeEpoch |
( |
| ) |
|
|
protectedvirtual |
Calculate the starting time from which the synchronized time is measured.
This uses midnight of the current day.
Unimplemented assignment operator.
Friends And Related Function Documentation
Member Data Documentation
| bool makVrv::DtSynchronizedTimeManager::myTimeEpochCalculated |
|
protected |
| DtDe& makVrv::DtSynchronizedTimeManager::myDe |
|
protected |
| double makVrv::DtSynchronizedTimeManager::myTimeEpoch |
|
protected |
| double makVrv::DtSynchronizedTimeManager::myTimeOffset |
|
protected |
| double makVrv::DtSynchronizedTimeManager::myTimeScaleFactor |
|
protected |
The documentation for this class was generated from the following file: