]> git.mxchange.org Git - flightgear.git/commitdiff
Read airspeed-indicator overspeed limit values from instrument configuration, as...
authorjmt <jmt>
Thu, 18 Mar 2010 00:05:26 +0000 (00:05 +0000)
committerTim Moore <timoore33@gmail.com>
Sat, 20 Mar 2010 17:45:43 +0000 (18:45 +0100)
src/Instrumentation/airspeed_indicator.cxx
src/Instrumentation/airspeed_indicator.hxx

index 0d59ffcf331cd010a9b5172c6b26b3e647519147..341c45edbea6ccbea6d59bc18eb7e92a79345991 100644 (file)
@@ -21,7 +21,11 @@ AirspeedIndicator::AirspeedIndicator ( SGPropertyNode *node )
     _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")),
-    _has_overspeed(node->getBoolValue("has-overspeed-indicator",false))
+    _has_overspeed(node->getBoolValue("has-overspeed-indicator",false)),
+    _pressure_alt_source(node->getStringValue("pressure-alt-source", "/instrumentation/altimeter/pressure-alt-ft")),
+    _ias_limit(node->getDoubleValue("ias-limit", 248.0)),
+    _mach_limit(node->getDoubleValue("mach-limit", 0.48)),
+    _alt_threshold(node->getDoubleValue("alt-threshold", 13200))
 {
 }
 
@@ -47,23 +51,21 @@ AirspeedIndicator::init ()
         _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);
-        _airspeed_limit = node->getChild("airspeed-limit-kt", 0, true);
-
+        
         if (!_ias_limit_node->hasValue()) {
-          _ias_limit_node->setDoubleValue(248.0);
+          _ias_limit_node->setDoubleValue(_ias_limit);
         }
 
         if (!_mach_limit_node->hasValue()) {
-          _mach_limit_node->setDoubleValue(0.48);
+          _mach_limit_node->setDoubleValue(_mach_limit);
         }
 
         if (!_alt_threshold_node->hasValue()) {
-          _alt_threshold_node->setDoubleValue(13200);
+          _alt_threshold_node->setDoubleValue(_alt_threshold);
         }
 
-        string paSource = node->getStringValue("pressure-alt-source",
-          "/instrumentation/altimeter/pressure-alt-ft");
-        _pressure_alt = fgGetNode(paSource.c_str(), true);
+        _airspeed_limit = node->getChild("airspeed-limit-kt", 0, true);
+        _pressure_alt = fgGetNode(_pressure_alt_source.c_str(), true);
         _mach = fgGetNode("/velocities/mach", true);
     }
 }
index 47eb9f43c402e838eaa689a98c961a2c8b39d958..2248a61b62301e0940237d9620df2c734355ad5b 100644 (file)
@@ -47,6 +47,11 @@ private:
     string _total_pressure;
     string _static_pressure;
     bool _has_overspeed;
+    string _pressure_alt_source;
+    double _ias_limit;
+    double _mach_limit;
+    double _alt_threshold;
+    
     SGPropertyNode_ptr _ias_limit_node;
     SGPropertyNode_ptr _mach_limit_node;
     SGPropertyNode_ptr _alt_threshold_node;