X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fairspeed_indicator.cxx;h=0196ddbaef9bd20b3d420f1c0f78ae0f868b9af0;hb=73fbc05a6b6af52825c792902d7738f9cad7ec2f;hp=2b80fbd96c3b9e1c3eef2112e277557beb371f54;hpb=4d146352d702ebfdb53a390eb4b406a30fc17cc8;p=flightgear.git diff --git a/src/Instrumentation/airspeed_indicator.cxx b/src/Instrumentation/airspeed_indicator.cxx index 2b80fbd96..0196ddbae 100644 --- a/src/Instrumentation/airspeed_indicator.cxx +++ b/src/Instrumentation/airspeed_indicator.cxx @@ -15,8 +15,12 @@ // A higher number means more responsive. #define RESPONSIVENESS 50.0 - -AirspeedIndicator::AirspeedIndicator () +AirspeedIndicator::AirspeedIndicator ( SGPropertyNode *node ) + : + _name(node->getStringValue("name", "airspeed-indicator")), + _num(node->getIntValue("number", 0)), + _total_pressure(node->getStringValue("total-pressure", "/systems/pitot/total-pressure-inhg")), + _static_pressure(node->getStringValue("static-pressure", "/systems/static/pressure-inhg")) { } @@ -27,17 +31,15 @@ AirspeedIndicator::~AirspeedIndicator () void AirspeedIndicator::init () { - _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); + 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 = - fgGetNode("/instrumentation/airspeed-indicator/indicated-speed-kt", - true); + _speed_node = node->getChild("indicated-speed-kt", 0, true); } #ifndef FPSTOKTS