- _longitude_node = fgGetNode("/position/longitude-deg", true);
- _latitude_node = fgGetNode("/position/latitude-deg", true);
- _altitude_node = fgGetNode("/position/altitude-ft", true);
- _heading_node = fgGetNode("/orientation/heading-deg", true);
- _serviceable_node = fgGetNode("/instrumentation/adf/serviceable", true);
- _error_node = fgGetNode("/instrumentation/adf/error-deg", true);
- _electrical_node = fgGetNode("/systems/electrical/outputs/adf", true);
- _frequency_node =
- fgGetNode("/instrumentation/adf/frequencies/selected-khz", true);
- _mode_node = fgGetNode("/instrumentation/adf/mode", true);
-
- _in_range_node = fgGetNode("/instrumentation/adf/in-range", true);
- _bearing_node =
- fgGetNode("/instrumentation/adf/indicated-bearing-deg", true);
- _ident_node = fgGetNode("/instrumentation/adf/ident", true);
+ string branch;
+ branch = "/instrumentation/" + _name;
+ SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
+
+ // instrument properties
+ _error_node = node->getChild("error-deg", 0, true);
+ _mode_node = node->getChild("mode", 0, true);
+ _volume_node = node->getChild("volume-norm", 0, true);
+ _in_range_node = node->getChild("in-range", 0, true);
+ _bearing_node = node->getChild("indicated-bearing-deg", 0, true);
+ _ident_node = node->getChild("ident", 0, true);
+ _ident_audible_node = node->getChild("ident-audible", 0, true);
+ _serviceable_node = node->getChild("serviceable", 0, true);
+ _power_btn_node = node->getChild("power-btn", 0, true);
+ _operable_node = node->getChild("operable", 0, true);
+
+ // frequency properties
+ SGPropertyNode *fnode = node->getChild("frequencies", 0, true);
+ _frequency_node = fnode->getChild("selected-khz", 0, true);
+
+ // foreign simulator properties
+ _electrical_node = fgGetNode("/systems/electrical/outputs/adf", true);
+ _heading_node = fgGetNode("/orientation/heading-deg", true);
+
+ // backward compatibility check
+ if (_power_btn_node->getType() == simgear::props::NONE)
+ _power_btn_node->setBoolValue(true); // front end didn't implement a power button
+
+ // sound support (audible ident code)
+ SGSoundMgr *smgr = globals->get_soundmgr();
+ _sgr = smgr->find("avionics", true);
+ _sgr->tie_to_listener();
+
+ std::ostringstream temp;
+ temp << _name << _num;
+ _adf_ident = temp.str();