]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/altimeter.hxx
Altimeter: fix output format for hPa/InHg settings
[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, const std::string& aDefaultName, 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     int getSettingHPa() const;
47     void setSettingHPa( int value );
48
49 private:
50     std::string _name;
51     int _num;
52     SGPropertyNode_ptr _rootNode;
53     std::string _static_pressure;
54     double _tau;
55     double _quantum;
56     double _kollsman;
57     double _raw_PA;
58     double _settingInHg;
59     bool _encodeModeC;
60     bool _encodeModeS;
61     
62     SGPropertyNode_ptr _serviceable_node;
63     SGPropertyNode_ptr _pressure_node;
64     SGPropertyNode_ptr _press_alt_node;
65     SGPropertyNode_ptr _mode_c_node;
66     SGPropertyNode_ptr _mode_s_node;
67     SGPropertyNode_ptr _transponder_node;
68     SGPropertyNode_ptr _altitude_node;
69
70     FGAltimeter _altimeter;
71
72     simgear::TiedPropertyList _tiedProperties;
73 };
74
75 #endif // __INSTRUMENTS_ALTIMETER_HXX