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",
36 VerticalSpeedIndicator::bind ()
41 VerticalSpeedIndicator::unbind ()
46 VerticalSpeedIndicator::update (double dt)
48 // model take from steam.cxx, with change
49 // from 10000 to 10500 for manual factor
50 if (_serviceable_node->getBoolValue()) {
51 double pressure = _pressure_node->getDoubleValue();
53 ->setDoubleValue((_internal_pressure_inhg - pressure) * 10500);
54 _internal_pressure_inhg =
55 fgGetLowPass(_internal_pressure_inhg,
56 _pressure_node->getDoubleValue(),
61 // end of vertical_speed_indicator.cxx