]> git.mxchange.org Git - flightgear.git/commitdiff
Expose the type (loc/vor) for the navradio
authorTorsten Dreyer <torsten@t3r.de>
Wed, 18 May 2016 06:28:27 +0000 (08:28 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:35 +0000 (23:27 +0200)
src/Instrumentation/newnavradio.cxx

index 8c2dabbb6682323cf9ef324d05caf20d14d3e961..f29fd0e9e1f3b1fb8be068232a9c7c9facab09b9 100644 (file)
@@ -842,6 +842,7 @@ private:
   double _stationTTL;
   double _frequency;
   PropertyObject<bool> _cdiDisconnected;
+  PropertyObject<std::string> _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 );
 }