|
FhSim
3.1.0
Marine systems simulation
|
#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. | |
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.
| util::RefreshSchedule::RefreshSchedule | ( | Refresh | mode, |
| double | period | ||
| ) |
Construct a schedule.
| [in] | mode | The resolved mode; not Auto. |
| [in] | period | The RefreshPeriod [s]: the period of Period (> 0) and the cap of a changing OnChange field (0: every frame). |
| std::invalid_argument | for Auto, a negative period, or Period without a positive period. |
| bool util::RefreshSchedule::Due | ( | double | T, |
| std::uint64_t | revision, | ||
| bool | unchanged, | ||
| bool | moved | ||
| ) | const |
Whether to sample at T.
| [in] | T | Simulation time of the frame [s]. |
| [in] | revision | The change signal now (OnChange); 0 for a field without one. |
| [in] | unchanged | The field is the same as at LastSampleTime() apart from a new revision (OnChange). |
| [in] | moved | The sampled region moved since the last sample. |
| void util::RefreshSchedule::Sampled | ( | double | T, |
| std::uint64_t | revision | ||
| ) |
Records a sample.
| [in] | T | Simulation time sampled at [s]. |
| [in] | revision | The change signal at the sample. |