1 // static.cxx - the static air system.
2 // Written by David Megginson, started 2002.
4 // This file is in the Public Domain and comes with no warranty.
7 #include <Main/fg_props.hxx>
10 StaticSystem::StaticSystem ()
14 StaticSystem::~StaticSystem ()
21 _serviceable_node = fgGetNode("/systems/static[0]/serviceable", true);
22 _pressure_in_node = fgGetNode("/environment/pressure-inhg", true);
23 _pressure_out_node = fgGetNode("/systems/static[0]/pressure-inhg", true);
32 StaticSystem::unbind ()
37 StaticSystem::update (double dt)
39 if (_serviceable_node->getBoolValue()) {
40 double target = _pressure_in_node->getDoubleValue();
41 double current = _pressure_out_node->getDoubleValue();
42 double delta = target - current;
43 current += delta * dt;
44 _pressure_out_node->setDoubleValue(current);