WSF
WsfXIO_TimeSynchronization Class Reference

#include <WsfXIO_SimTimeRequest.hpp>

Inheritance diagram for WsfXIO_TimeSynchronization:
Collaboration diagram for WsfXIO_TimeSynchronization:

Public Member Functions

 WsfXIO_TimeSynchronization (WsfXIO_Connection *aConnectionPtr, WsfSimulation *aSimulationPtr)
 ~WsfXIO_TimeSynchronization () override
void JumpToRemoteTime (bool aDoJump)
void SetTiming (double aTargetTimeOffset, double aMinimumTimeError, double aMaximumTimeError, double aTimerUpdateInterval)
void HandleResponse (WsfXIO_ResponsePkt &aPkt) override
void SetSmoothRate (bool aSmoothRate)
void SetSyncPackets (bool aDoSync)
WsfClockSourceGetClockSource () const
void SetClockSource (WsfClockSource *aClockSourcePtr)
Public Member Functions inherited from WsfXIO_SimTimeRequest
 WsfXIO_SimTimeRequest (WsfXIO_Connection *aConnectionPtr, WsfXIO_RequestSimTimePkt::TimerType aTimerType=WsfXIO_RequestSimTimePkt::cSIM_TIME_INTERVAL, double aInterval=1.0, bool aIsReliable=true)
void SetUpdateInterval (double aSimTimeInterval)
double GetUpdateInterval () const
void SetTimerType (WsfXIO_RequestSimTimePkt::TimerType aTimerType)
Public Member Functions inherited from WsfXIO_Request
 WsfXIO_Request (WsfXIO_Connection *aConnectionPtr, bool aIsReliable=true)
void SendRequest (WsfXIO_RequestDataPkt &aPkt)
 Sends the request to the remote application.
WsfXIO_ConnectionGetConnection () const
 Returns the connection to the application from which data is requested.
bool IsReliable () const
 Returns 'true' if data for this request is to be sent reliably.
int GetRequestId () const
 Returns the request's locally unique ID.
void SetRequestManager (WsfXIO_RequestManager *aRequestManagerPtr)
 Sets the owner of this request.
void SendResponse (WsfXIO_ResponsePkt &aPkt)

Public Attributes

WsfXIO_SimTimePkt mLastState

Additional Inherited Members

Protected Member Functions inherited from WsfXIO_Request
virtual ~WsfXIO_Request ()
void SetRequestId (unsigned int aRequestId)
void SetRemotelyDestroyed ()
bool IsRemotelyDestroyed () const
void SetIsReliable (bool aIsReliable)

Detailed Description

WsfXIO_TimeSynchronization attempts to synchronize the local simulation clock with a remote simulation

  • Controls the local clock when remote simulation pauses, resumes or changes clock rate.
  • Upon timing errors, local clock is adjusted to reflect remote clock.
  • Configures the connection to translate the WsfXIO_Packet::GetTimeStamp() value into local time.
  • Timing parameters allow for a delayed synchronization where the local clock is behind the remote clock. In this situation, received packets marked with the cSYNCHRONIZED flag will be buffered processed at the correct simulation time for the packet time stamp.
    Note
    WsfXIO_TimeSynchronization is currently limited to realtime simulations

Constructor & Destructor Documentation

◆ WsfXIO_TimeSynchronization()

◆ ~WsfXIO_TimeSynchronization()

WsfXIO_TimeSynchronization::~WsfXIO_TimeSynchronization ( )
override

Member Function Documentation

◆ GetClockSource()

WsfClockSource * WsfXIO_TimeSynchronization::GetClockSource ( ) const
inline

◆ HandleResponse()

void WsfXIO_TimeSynchronization::HandleResponse ( WsfXIO_ResponsePkt & aPkt)
overridevirtual

◆ JumpToRemoteTime()

void WsfXIO_TimeSynchronization::JumpToRemoteTime ( bool aDoJump)
inline

◆ SetClockSource()

void WsfXIO_TimeSynchronization::SetClockSource ( WsfClockSource * aClockSourcePtr)

◆ SetSmoothRate()

void WsfXIO_TimeSynchronization::SetSmoothRate ( bool aSmoothRate)
inline

◆ SetSyncPackets()

void WsfXIO_TimeSynchronization::SetSyncPackets ( bool aDoSync)
inline

◆ SetTiming()

void WsfXIO_TimeSynchronization::SetTiming ( double aTargetTimeOffset,
double aMinimumTimeError,
double aMaximumTimeError,
double aTimerUpdateInterval )

Sets the parameters for the synchronization.

Parameters
aTargetTimeOffsetDesired amount of time offset between this application and the remote application.
aMinimumTimeErrorMinimum value of TError before the simulation clock is advanced
aMaximumTimeErrorMaximum value of TError before the simulation clock is paused
aTimerUpdateIntervalTime interval between clock updates.
Note
TError = LocalTime - AdjustedRemoteTime + TargetTimeOffset AdjustedRemoteTime = (RemoteTime + InitialTimeOffset) InitialTimeOffset = (LocalTime - RemoteTime) at startup

References WsfXIO_SimTimeRequest::SetUpdateInterval().

Member Data Documentation

◆ mLastState

WsfXIO_SimTimePkt WsfXIO_TimeSynchronization::mLastState

Referenced by HandleResponse().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved