FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
util::RefreshSchedule Class Reference

#include <RefreshSchedule.h>

Public Member Functions

 RefreshSchedule (Refresh mode, double period)
 
bool Due (double T, std::uint64_t revision, bool unchanged, bool moved) const
 
void Sampled (double T, std::uint64_t revision)
 
Refresh Mode () const
 The mode.
 
double LastSampleTime () const
 Simulation time of the last sample [s]; 0 before the first.
 

Detailed Description

Decides, frame by frame, whether a visualiser samples its field again.

Every schedule samples at the first frame and whenever the sampled region has moved. Then Once never samples again, EveryFrame always does, Period does after the period, and OnChange does when the change signal's revision has changed or, while the field changes without a new revision (a blend, a moving wake), after the period, or every frame with a period of 0. Simulation time may run back (scrubbing): a period counts in either direction.

Constructor & Destructor Documentation

◆ RefreshSchedule()

util::RefreshSchedule::RefreshSchedule ( Refresh  mode,
double  period 
)

Construct a schedule.

Parameters
[in]modeThe resolved mode; not Auto.
[in]periodThe RefreshPeriod [s]: the period of Period (> 0) and the cap of a changing OnChange field (0: every frame).
Exceptions
std::invalid_argumentfor Auto, a negative period, or Period without a positive period.

Member Function Documentation

◆ Due()

bool util::RefreshSchedule::Due ( double  T,
std::uint64_t  revision,
bool  unchanged,
bool  moved 
) const

Whether to sample at T.

Parameters
[in]TSimulation time of the frame [s].
[in]revisionThe change signal now (OnChange); 0 for a field without one.
[in]unchangedThe field is the same as at LastSampleTime() apart from a new revision (OnChange).
[in]movedThe sampled region moved since the last sample.
Returns
True when the field is to be sampled.

◆ Sampled()

void util::RefreshSchedule::Sampled ( double  T,
std::uint64_t  revision 
)

Records a sample.

Parameters
[in]TSimulation time sampled at [s].
[in]revisionThe change signal at the sample.

The documentation for this class was generated from the following file: