]> git.mxchange.org Git - flightgear.git/commitdiff
Airspeed indicator: add default values for overspeed, and rename the
authorjmt <jmt>
Thu, 11 Mar 2010 09:45:48 +0000 (09:45 +0000)
committerTim Moore <timoore33@gmail.com>
Tue, 16 Mar 2010 14:12:26 +0000 (15:12 +0100)
enable property to 'has-overspeed-indicator'.

src/Instrumentation/airspeed_indicator.cxx
src/Instrumentation/airspeed_indicator.hxx

index 329d91a2e9f9384079539ea250655bd53e83d925..3fb9aa655ab570b8d7c6cd5348ab810c20aa962e 100644 (file)
@@ -21,7 +21,7 @@ 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_barber_pole(node->getBoolValue("has-barber-pole",false))
+    _has_overspeed(node->getBoolValue("has-overspeed-indicator",false))
 {
 }
 
@@ -42,12 +42,24 @@ AirspeedIndicator::init ()
     _density_node = fgGetNode("/environment/density-slugft3", true);
     _speed_node = node->getChild("indicated-speed-kt", 0, true);
     
-  // barber-pole properties
+  // 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);
+    }
+    
     string paSource = node->getStringValue("pressure-alt-source",
       "/instrumentation/altimeter/pressure-alt-ft");
     _pressure_alt = fgGetNode(paSource.c_str(), true);
@@ -87,7 +99,7 @@ AirspeedIndicator::update (double dt)
                                              dt * RESPONSIVENESS);
     _speed_node->setDoubleValue(filtered_speed);
 
-    if (!_has_barber_pole) {
+    if (!_has_overspeed) {
         return;
     }
     
index 7948ed2f22a9b73956a31222363702ea0270b208..47eb9f43c402e838eaa689a98c961a2c8b39d958 100644 (file)
@@ -46,7 +46,7 @@ private:
     unsigned int _num;
     string _total_pressure;
     string _static_pressure;
-    bool _has_barber_pole;
+    bool _has_overspeed;
     SGPropertyNode_ptr _ias_limit_node;
     SGPropertyNode_ptr _mach_limit_node;
     SGPropertyNode_ptr _alt_threshold_node;