2002-09-27 18:27:58 +00:00
|
|
|
// static.cxx - the static air system.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
#include "static.hxx"
|
|
|
|
#include <Main/fg_props.hxx>
|
2002-09-27 22:04:21 +00:00
|
|
|
#include <Main/util.hxx>
|
2002-09-27 18:27:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
StaticSystem::StaticSystem ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
StaticSystem::~StaticSystem ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StaticSystem::init ()
|
|
|
|
{
|
|
|
|
_serviceable_node = fgGetNode("/systems/static[0]/serviceable", true);
|
|
|
|
_pressure_in_node = fgGetNode("/environment/pressure-inhg", true);
|
|
|
|
_pressure_out_node = fgGetNode("/systems/static[0]/pressure-inhg", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StaticSystem::bind ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StaticSystem::unbind ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StaticSystem::update (double dt)
|
|
|
|
{
|
|
|
|
if (_serviceable_node->getBoolValue()) {
|
2002-09-27 22:04:21 +00:00
|
|
|
|
2002-09-27 18:27:58 +00:00
|
|
|
double target = _pressure_in_node->getDoubleValue();
|
|
|
|
double current = _pressure_out_node->getDoubleValue();
|
|
|
|
double delta = target - current;
|
2002-09-27 22:04:21 +00:00
|
|
|
_pressure_out_node->setDoubleValue(fgGetLowPass(current, target, dt));
|
2002-09-27 18:27:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// end of static.cxx
|