1 // vertical_speed_indicator.cxx - a regular VSI.
2 // Written by David Megginson, started 2002.
4 // This file is in the Public Domain and comes with no warranty.
6 #include <simgear/math/interpolater.hxx>
8 #include "vertical_speed_indicator.hxx"
9 #include <Main/fg_props.hxx>
10 #include <Main/util.hxx>
13 VerticalSpeedIndicator::VerticalSpeedIndicator ()
14 : _internal_pressure_inhg(29.92)
18 VerticalSpeedIndicator::~VerticalSpeedIndicator ()
23 VerticalSpeedIndicator::init ()
26 fgGetNode("/instrumentation/vertical-speed-indicator/serviceable",
29 fgGetNode("/systems/static/pressure-inhg", true);
31 fgGetNode("/instrumentation/vertical-speed-indicator/indicated-speed-fpm",
34 // Initialize at ambient pressure
35 _internal_pressure_inhg = _pressure_node->getDoubleValue();
39 VerticalSpeedIndicator::update (double dt)
41 // model taken from steam.cxx, with change
42 // from 10000 to 10500 for manual factor
43 if (_serviceable_node->getBoolValue()) {
44 double pressure = _pressure_node->getDoubleValue();
46 ->setDoubleValue((_internal_pressure_inhg - pressure) * 10500);
47 _internal_pressure_inhg =
48 fgGetLowPass(_internal_pressure_inhg,
49 _pressure_node->getDoubleValue(),
54 // end of vertical_speed_indicator.cxx