From 03edf5a295869797ab6c75fbfe7f63b4cd1cd6e9 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Wed, 18 May 2016 08:28:27 +0200 Subject: [PATCH] Expose the type (loc/vor) for the navradio --- src/Instrumentation/newnavradio.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/newnavradio.cxx b/src/Instrumentation/newnavradio.cxx index 8c2dabbb6..f29fd0e9e 100644 --- a/src/Instrumentation/newnavradio.cxx +++ b/src/Instrumentation/newnavradio.cxx @@ -842,6 +842,7 @@ private: double _stationTTL; double _frequency; PropertyObject _cdiDisconnected; + PropertyObject _navType; }; NavRadioImpl::NavRadioImpl( SGPropertyNode_ptr node ) : @@ -854,7 +855,8 @@ NavRadioImpl::NavRadioImpl( SGPropertyNode_ptr node ) : _navIndicator(_rootNode), _stationTTL(0.0), _frequency(-1.0), - _cdiDisconnected(_rootNode->getNode("cdi-disconnected",true)) + _cdiDisconnected(_rootNode->getNode("cdi-disconnected",true)), + _navType(_rootNode->getNode("nav-type",true)) { } @@ -912,6 +914,14 @@ void NavRadioImpl::update( double dt ) if( _stationTTL <= 0.0 ) _stationTTL = 30.0; + if( _components[VOR_COMPONENT]->valid() ) { + _navType = "vor"; + } else if( _components[LOC_COMPONENT]->valid() ) { + _navType = "loc"; + } else { + _navType = ""; + } + _legacy.update( dt ); } -- 2.39.5