]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/altimeter.hxx
Canvas: Performance improvements.
[flightgear.git] / src / Instrumentation / altimeter.hxx
1 // altimeter.hxx - an altimeter tied to the static port.
2 // Written by David Megginson, started 2002.
3 // Updated by John Denker to match changes in altimeter.cxx in 2007
4 //
5 // This file is in the Public Domain and comes with no warranty.
6
7
8 #ifndef __INSTRUMENTS_ALTIMETER_HXX
9 #define __INSTRUMENTS_ALTIMETER_HXX 1
10
11 #include <simgear/props/props.hxx>
12 #include <simgear/props/tiedpropertylist.hxx>
13 #include <simgear/structure/subsystem_mgr.hxx>
14 #include <Environment/atmosphere.hxx>
15
16
17 /**
18  * Model a barometric altimeter tied to the static port.
19  *
20  * Input properties:
21  *
22  * /instrumentation/<name>/serviceable
23  * /instrumentation/<name>/setting-inhg
24  * <static_pressure>
25  *
26  * Output properties:
27  *
28  * /instrumentation/<name>/indicated-altitude-ft
29  */
30 class Altimeter : public SGSubsystem
31 {
32
33 public:
34
35     Altimeter (SGPropertyNode *node, double quantum = 0);
36     virtual ~Altimeter ();
37
38     virtual void init ();
39     virtual void reinit ();
40     virtual void update (double dt);
41     virtual void bind();
42     virtual void unbind();
43
44     double getSettingInHg() const;
45     void setSettingInHg( double value );
46     double getSettingHPa() const;
47     void setSettingHPa( double value );
48
49 private:
50     SGPropertyNode_ptr _rootNode;
51     string _static_pressure;
52     double _tau;
53     double _quantum;
54     double _kollsman;
55     double _raw_PA;
56     double _settingInHg;
57
58     SGPropertyNode_ptr _serviceable_node;
59     SGPropertyNode_ptr _pressure_node;
60     SGPropertyNode_ptr _press_alt_node;
61     SGPropertyNode_ptr _mode_c_node;
62     SGPropertyNode_ptr _altitude_node;
63
64     FGAltimeter _altimeter;
65
66     simgear::TiedPropertyList _tiedProperties;
67 };
68
69 #endif // __INSTRUMENTS_ALTIMETER_HXX