]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/vertical_speed_indicator.cxx
Make various PUI widgets private.
[flightgear.git] / src / Instrumentation / vertical_speed_indicator.cxx
index e5c9f743274e9671c0674ab52ce3a3d3de218930..55d3a77ed5a686fea385fbd28b59d4bbaa2ba871 100644 (file)
@@ -3,12 +3,17 @@
 //
 // This file is in the Public Domain and comes with no warranty.
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <simgear/math/interpolater.hxx>
 
 #include "vertical_speed_indicator.hxx"
 #include <Main/fg_props.hxx>
 #include <Main/util.hxx>
 
+using std::string;
 
 VerticalSpeedIndicator::VerticalSpeedIndicator ( SGPropertyNode *node )
     : _internal_pressure_inhg(29.92),
@@ -32,8 +37,15 @@ VerticalSpeedIndicator::init ()
     _serviceable_node = node->getChild("serviceable", 0, true);
     _pressure_node = fgGetNode(_static_pressure.c_str(), true);
     _speed_node = node->getChild("indicated-speed-fpm", 0, true);
+    _speed_up_node = fgGetNode("/sim/speed-up", true);
+
+    reinit();
+}
 
-                                // Initialize at ambient pressure
+void
+VerticalSpeedIndicator::reinit ()
+{
+    // Initialize at ambient pressure
     _internal_pressure_inhg = _pressure_node->getDoubleValue();
 }
 
@@ -44,6 +56,9 @@ VerticalSpeedIndicator::update (double dt)
                                 // from 10000 to 10500 for manual factor
     if (_serviceable_node->getBoolValue()) {
         double pressure = _pressure_node->getDoubleValue();
+        double speed_up = _speed_up_node->getDoubleValue();
+        if( speed_up > 1 )
+            dt *= speed_up;
         _speed_node
             ->setDoubleValue((_internal_pressure_inhg - pressure) * 10500);
         _internal_pressure_inhg =