]> git.mxchange.org Git - flightgear.git/blob - src/Systems/static.cxx
Multiplayer client/server system -- Message base class, "hello" message, and message...
[flightgear.git] / src / Systems / static.cxx
1 // static.cxx - the static air system.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain and comes with no warranty.
5
6 #include "static.hxx"
7 #include <Main/fg_props.hxx>
8 #include <Main/util.hxx>
9
10
11 StaticSystem::StaticSystem ()
12 {
13 }
14
15 StaticSystem::~StaticSystem ()
16 {
17 }
18
19 void
20 StaticSystem::init ()
21 {
22     _serviceable_node = fgGetNode("/systems/static[0]/serviceable", true);
23     _pressure_in_node = fgGetNode("/environment/pressure-inhg", true);
24     _pressure_out_node = fgGetNode("/systems/static[0]/pressure-inhg", true);
25 }
26
27 void
28 StaticSystem::bind ()
29 {
30 }
31
32 void
33 StaticSystem::unbind ()
34 {
35 }
36
37 void
38 StaticSystem::update (double dt)
39 {
40     if (_serviceable_node->getBoolValue()) {
41         
42         double target = _pressure_in_node->getDoubleValue();
43         double current = _pressure_out_node->getDoubleValue();
44         double delta = target - current;
45         _pressure_out_node->setDoubleValue(fgGetLowPass(current, target, dt));
46     }
47 }
48
49 // end of static.cxx