From: Torsten Dreyer Date: Fri, 28 Feb 2014 21:36:29 +0000 (+0100) Subject: Fix wrong metar assignment in commradio X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;ds=sidebyside;h=5e080c1e37eb49f75fcb47c164c275cd70480e54;p=flightgear.git Fix wrong metar assignment in commradio --- diff --git a/src/Instrumentation/commradio.cxx b/src/Instrumentation/commradio.cxx index a16fe60b2..ae631cd8b 100644 --- a/src/Instrumentation/commradio.cxx +++ b/src/Instrumentation/commradio.cxx @@ -243,6 +243,7 @@ public: void unbind(); private: + int _num; MetarBridgeRef _metarBridge; FrequencyFormatter _useFrequencyFormatter; FrequencyFormatter _stbyFrequencyFormatter; @@ -263,8 +264,9 @@ private: CommRadioImpl::CommRadioImpl( SGPropertyNode_ptr node ) : OutputProperties( fgGetNode("/instrumentation",true)->getNode( - node->getStringValue("name", "nav"), + node->getStringValue("name", "comm"), node->getIntValue("number", 0), true)), + _num( node->getIntValue("number",0)), _metarBridge( new MetarBridge() ), _useFrequencyFormatter( _rootNode->getNode("frequencies/selected-mhz",true), _rootNode->getNode("frequencies/selected-mhz-fmt",true), 0.025 ), @@ -291,7 +293,9 @@ CommRadioImpl::~CommRadioImpl() void CommRadioImpl::bind() { _metarBridge->setAtisNode( _atis.node() ); - _metarBridge->setMetarPropertiesRoot( fgGetNode( "/environment/metar[3]", true ) ); + // link the metar node. /environment/metar[3] is comm1 and /environment[4] is comm2. + // see FGDATA/Environment/environment.xml + _metarBridge->setMetarPropertiesRoot( fgGetNode( "/environment",true)->getNode("metar", _num+3, true ) ); _metarBridge->bind(); }