- _serviceable_node =
- fgGetNode("/instrumentation/airspeed-indicator/serviceable",
- true);
- _total_pressure_node =
- fgGetNode("/systems/pitot/total-pressure-inhg", true);
- _static_pressure_node =
- fgGetNode("/systems/static/pressure-inhg", true);
- _speed_node =
- fgGetNode("/instrumentation/airspeed-indicator/indicated-speed-kt",
- true);
+ std::string branch;
+ branch = "/instrumentation/" + _name;
+
+ SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
+ _serviceable_node = node->getChild("serviceable", 0, true);
+ _total_pressure_node = fgGetNode(_total_pressure.c_str(), true);
+ _static_pressure_node = fgGetNode(_static_pressure.c_str(), true);
+ _density_node = fgGetNode("/environment/density-slugft3", true);
+ _speed_node = node->getChild("indicated-speed-kt", 0, true);
+ _tas_node = node->getChild("true-speed-kt", 0, true);
+ _mach_node = node->getChild("indicated-mach", 0, true);
+
+ // overspeed-indicator properties
+ if (_has_overspeed) {
+ _ias_limit_node = node->getNode("ias-limit",0, true);
+ _mach_limit_node = node->getNode("mach-limit",0, true);
+ _alt_threshold_node = node->getNode("alt-threshold",0, true);
+
+ if (!_ias_limit_node->hasValue()) {
+ _ias_limit_node->setDoubleValue(_ias_limit);
+ }
+
+ if (!_mach_limit_node->hasValue()) {
+ _mach_limit_node->setDoubleValue(_mach_limit);
+ }
+
+ if (!_alt_threshold_node->hasValue()) {
+ _alt_threshold_node->setDoubleValue(_alt_threshold);
+ }
+
+ _airspeed_limit = node->getChild("airspeed-limit-kt", 0, true);
+ _pressure_alt = fgGetNode(_pressure_alt_source.c_str(), true);
+ }
+
+ _environmentManager = (FGEnvironmentMgr*) globals->get_subsystem("environment");