]> git.mxchange.org Git - flightgear.git/commitdiff
Syd Adams: only define overspeed-indicator properties when enabled.
authorjmt <jmt>
Sat, 13 Mar 2010 12:21:51 +0000 (12:21 +0000)
committerTim Moore <timoore33@gmail.com>
Tue, 16 Mar 2010 14:12:38 +0000 (15:12 +0100)
src/Instrumentation/airspeed_indicator.cxx

index 3fb9aa655ab570b8d7c6cd5348ab810c20aa962e..0d59ffcf331cd010a9b5172c6b26b3e647519147 100644 (file)
@@ -41,29 +41,31 @@ AirspeedIndicator::init ()
     _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);
-    
+
   // overspeed-indicator properties
-    _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(250.0);
-    }
-    
-    if (!_mach_limit_node->hasValue()) {
-      _mach_limit_node->setDoubleValue(0.48);
-    }
-    
-    if (!_alt_threshold_node->hasValue()) {
-      _alt_threshold_node->setDoubleValue(13200);
+    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);
+        _airspeed_limit = node->getChild("airspeed-limit-kt", 0, true);
+
+        if (!_ias_limit_node->hasValue()) {
+          _ias_limit_node->setDoubleValue(248.0);
+        }
+
+        if (!_mach_limit_node->hasValue()) {
+          _mach_limit_node->setDoubleValue(0.48);
+        }
+
+        if (!_alt_threshold_node->hasValue()) {
+          _alt_threshold_node->setDoubleValue(13200);
+        }
+
+        string paSource = node->getStringValue("pressure-alt-source",
+          "/instrumentation/altimeter/pressure-alt-ft");
+        _pressure_alt = fgGetNode(paSource.c_str(), true);
+        _mach = fgGetNode("/velocities/mach", true);
     }
-    
-    string paSource = node->getStringValue("pressure-alt-source",
-      "/instrumentation/altimeter/pressure-alt-ft");
-    _pressure_alt = fgGetNode(paSource.c_str(), true);
-    _mach = fgGetNode("/velocities/mach", true);
 }
 
 #ifndef FPSTOKTS