|
VR-Engage
2.2
|
| UpdaterBase | Base updater class to extend |
This template extends GLStudio attribute updaters to be aware of simulation state, allowing instruments to be disabled based on aircraft system states. It caches the last valid value to avoid excessive updates and handles simulation state changes.
#include <vreGlstudioUpdater.h>
Public Member Functions | |
| DtVreGlstudioUpdater () | |
| virtual | ~DtVreGlstudioUpdater () |
| virtual void | init (DtSmoother *smoother, makVrv::DtDe *de) |
| virtual std::string | value (double time) |
Public Attributes | |
| std::string | myStateAttribute |
| std::string | myLastValue |
| bool | myActive |
Protected Member Functions | |
| virtual DtVreMessageResult | handleSimulationStateMessage (makVre::DtVreMessage *msg) |
Private Member Functions | |
| DtVreGlstudioUpdater (const DtVreGlstudioUpdater &other) | |
| DtVreGlstudioUpdater & | operator= (const DtVreGlstudioUpdater &other) |
|
inline |
Default constructor.
References myActive, and myLastValue.
Referenced by DtVreGlstudioUpdater(), and operator=().
|
inlinevirtual |
Virtual destructor.
Removes message handlers when the updater is destroyed
References handleSimulationStateMessage(), makVre::DtVreMessageManager::instance(), makVre::DtVreMessageManager::removeHandler(), and makVre::SimulationStateMessage::theType().
|
private |
Copy constructor (not implemented)
| other | Source object to copy from |
References DtVreGlstudioUpdater().
|
inlinevirtual |
Initializes the updater.
| smoother | Pointer to the smoother to use for value smoothing |
| de | Pointer to the display element |
Registers message handlers and initializes the base updater
References makVre::DtVreMessageManager::addHandler(), de(), handleSimulationStateMessage(), makVre::DtVreMessageManager::instance(), and makVre::SimulationStateMessage::theType().
|
inlinevirtual |
Gets the current value as a string.
| time | Current simulation time in seconds |
If the instrument is active, updates the cached value. Otherwise, returns the last cached value.
References myActive, and myLastValue.
|
inlineprotectedvirtual |
Handles simulation state change messages.
| msg | Pointer to the message being processed |
Updates the active state of the instrument based on the list of disabled instruments in the simulation state message.
References makVre::SimulationStateMessage::getDisabledInstruments(), makVre::HANDLED, myActive, and myStateAttribute.
Referenced by init(), and ~DtVreGlstudioUpdater().
|
private |
Assignment operator (not implemented)
| other | Source object to assign from |
References DtVreGlstudioUpdater().
| std::string makVre::DtVreGlstudioUpdater< UpdaterBase >::myStateAttribute |
Name of the state attribute this updater is associated with.
Referenced by handleSimulationStateMessage().
| std::string makVre::DtVreGlstudioUpdater< UpdaterBase >::myLastValue |
Last calculated value, cached to avoid unnecessary updates.
Referenced by DtVreGlstudioUpdater(), and value().
| bool makVre::DtVreGlstudioUpdater< UpdaterBase >::myActive |
Flag indicating if this instrument is currently active.
Referenced by DtVreGlstudioUpdater(), handleSimulationStateMessage(), and value().