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>
8 #include <Main/util.hxx>
11 StaticSystem::StaticSystem ( SGPropertyNode *node )
13 _name(node->getStringValue("name", "static")),
14 _num(node->getIntValue("number", 0))
18 StaticSystem::~StaticSystem ()
26 branch = "/systems/" + _name;
28 SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
29 _serviceable_node = node->getChild("serviceable", 0, true);
30 _pressure_in_node = fgGetNode("/environment/pressure-inhg", true);
31 _pressure_out_node = node->getChild("pressure-inhg", 0, true);
40 StaticSystem::unbind ()
45 StaticSystem::update (double dt)
47 if (_serviceable_node->getBoolValue()) {
49 double target = _pressure_in_node->getDoubleValue();
50 double current = _pressure_out_node->getDoubleValue();
51 // double delta = target - current;
52 _pressure_out_node->setDoubleValue(fgGetLowPass(current, target, dt));