VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtSynchronizedTimeManager Class Reference

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
virtual void setTimeOffset (double offset)
 Set / get an offset that is added to the final calculated time (after scaling).
virtual double timeOffset () const

Protected Member Functions

 DtSynchronizedTimeManager (DtDe &de)
 Protected CTOR. This class may only be constructed using DtSynchronizedTimeManagerCreator.
virtual void calcTimeEpoch ()
 Calculate the starting time from which the synchronized time is measured.

Protected Attributes

bool myTimeEpochCalculated
DtDemyDe
double myTimeEpoch
double myTimeOffset
double myTimeScaleFactor

Private Member Functions

 DtSynchronizedTimeManager ()
 Unimplemented default CTOR.
 DtSynchronizedTimeManager (const DtSynchronizedTimeManager &orig)
 Unimplemented copy constructor.
DtSynchronizedTimeManageroperator= (const DtSynchronizedTimeManager &rhs)
 Unimplemented assignment operator.

Friends

class DtSynchronizedTimeManagerCreator
 DtSynchronizedTimeManager is only constructable through this Creator class.

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

DTOR.

makVrv::DtSynchronizedTimeManager::DtSynchronizedTimeManager ( DtDe de)
protected

Protected CTOR. This class may only be constructed using DtSynchronizedTimeManagerCreator.

makVrv::DtSynchronizedTimeManager::DtSynchronizedTimeManager ( )
private

Unimplemented default CTOR.

makVrv::DtSynchronizedTimeManager::DtSynchronizedTimeManager ( const DtSynchronizedTimeManager orig)
private

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.

  1. 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
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
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.

DtSynchronizedTimeManager& makVrv::DtSynchronizedTimeManager::operator= ( const DtSynchronizedTimeManager rhs)
private

Unimplemented assignment operator.

Friends And Related Function Documentation

friend class DtSynchronizedTimeManagerCreator
friend

DtSynchronizedTimeManager is only constructable through this Creator class.

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:

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)