VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreGlstudioUpdater< UpdaterBase > Class Template Reference

Detailed Description

template<typename UpdaterBase>
class makVre::DtVreGlstudioUpdater< UpdaterBase >
Template Parameters
UpdaterBaseBase 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>

Inheritance diagram for makVre::DtVreGlstudioUpdater< UpdaterBase >:
[legend]

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)
 
DtVreGlstudioUpdateroperator= (const DtVreGlstudioUpdater &other)
 

Constructor & Destructor Documentation

◆ DtVreGlstudioUpdater() [1/2]

template<typename UpdaterBase>
makVre::DtVreGlstudioUpdater< UpdaterBase >::DtVreGlstudioUpdater ( )
inline

Default constructor.

References myActive, and myLastValue.

Referenced by DtVreGlstudioUpdater(), and operator=().

◆ ~DtVreGlstudioUpdater()

template<typename UpdaterBase>
virtual makVre::DtVreGlstudioUpdater< UpdaterBase >::~DtVreGlstudioUpdater ( )
inlinevirtual

◆ DtVreGlstudioUpdater() [2/2]

template<typename UpdaterBase>
makVre::DtVreGlstudioUpdater< UpdaterBase >::DtVreGlstudioUpdater ( const DtVreGlstudioUpdater< UpdaterBase > & other)
private

Copy constructor (not implemented)

Parameters
otherSource object to copy from

References DtVreGlstudioUpdater().

Member Function Documentation

◆ init()

template<typename UpdaterBase>
virtual void makVre::DtVreGlstudioUpdater< UpdaterBase >::init ( DtSmoother * smoother,
makVrv::DtDe * de )
inlinevirtual

Initializes the updater.

Parameters
smootherPointer to the smoother to use for value smoothing
dePointer 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().

◆ value()

template<typename UpdaterBase>
virtual std::string makVre::DtVreGlstudioUpdater< UpdaterBase >::value ( double time)
inlinevirtual

Gets the current value as a string.

Parameters
timeCurrent simulation time in seconds
Returns
Current value formatted as a string

If the instrument is active, updates the cached value. Otherwise, returns the last cached value.

References myActive, and myLastValue.

◆ handleSimulationStateMessage()

template<typename UpdaterBase>
virtual DtVreMessageResult makVre::DtVreGlstudioUpdater< UpdaterBase >::handleSimulationStateMessage ( makVre::DtVreMessage * msg)
inlineprotectedvirtual

Handles simulation state change messages.

Parameters
msgPointer to the message being processed
Returns
Message processing result

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().

◆ operator=()

template<typename UpdaterBase>
DtVreGlstudioUpdater & makVre::DtVreGlstudioUpdater< UpdaterBase >::operator= ( const DtVreGlstudioUpdater< UpdaterBase > & other)
private

Assignment operator (not implemented)

Parameters
otherSource object to assign from
Returns
Reference to this object

References DtVreGlstudioUpdater().

Member Data Documentation

◆ myStateAttribute

template<typename UpdaterBase>
std::string makVre::DtVreGlstudioUpdater< UpdaterBase >::myStateAttribute

Name of the state attribute this updater is associated with.

Referenced by handleSimulationStateMessage().

◆ myLastValue

template<typename UpdaterBase>
std::string makVre::DtVreGlstudioUpdater< UpdaterBase >::myLastValue

Last calculated value, cached to avoid unnecessary updates.

Referenced by DtVreGlstudioUpdater(), and value().

◆ myActive

template<typename UpdaterBase>
bool makVre::DtVreGlstudioUpdater< UpdaterBase >::myActive

Flag indicating if this instrument is currently active.

Referenced by DtVreGlstudioUpdater(), handleSimulationStateMessage(), and value().


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