]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/altimeter.cxx
#346 related: missing status message for property server
[flightgear.git] / src / Instrumentation / altimeter.cxx
index f5d6229d5e7a942c6b8a41d4e6d24fa4afc34da6..0f8d5fc2c7a1ab184c0f790eccf3205c78b0e754 100644 (file)
 //      </altimeter>
 // Note non-default name, quantum, and tau values.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/math/interpolater.hxx>
 #include <simgear/math/SGMath.hxx>
 
@@ -43,6 +47,7 @@ Altimeter::init ()
 
     SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
     raw_PA = 0.0;
+    _kollsman = 0.0;
     _pressure_node     = fgGetNode(_static_pressure.c_str(), true);
     _serviceable_node  = node->getChild("serviceable", 0, true);
     _setting_node      = node->getChild("setting-inhg", 0, true);
@@ -67,7 +72,7 @@ Altimeter::update (double dt)
         _mode_c_node->setDoubleValue(100 * SGMiscd::round(raw_PA/100));
         _kollsman = fgGetLowPass(_kollsman, _altimeter.kollsman_ft(setting), trat);
         if (_quantum)
-            press_alt = _quantum*round(raw_PA/_quantum);
+            press_alt = _quantum * SGMiscd::round(raw_PA/_quantum);
         else
             press_alt = raw_PA;
         _press_alt_node->setDoubleValue(press_alt);