]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/airspeed_indicator.hxx
Support for multiple data dirs.
[flightgear.git] / src / Instrumentation / airspeed_indicator.hxx
1 // airspeed_indicator.hxx - a regular VSI tied to the static port.
2 // Written by David Megginson, started 2002.
3 //
4 // Last modified by Eric van den Berg, 24 Nov 2012
5 // This file is in the Public Domain and comes with no warranty.
6
7
8 #ifndef __INSTRUMENTS_AIRSPEED_INDICATOR_HXX
9 #define __INSTRUMENTS_AIRSPEED_INDICATOR_HXX 1
10
11 #ifndef __cplusplus
12 # error This library requires C++
13 #endif
14
15 #include <simgear/props/props.hxx>
16 #include <simgear/structure/subsystem_mgr.hxx>
17
18 // forward decls
19 class FGEnvironmentMgr;
20
21 /**
22  * Model an airspeed indicator tied to the pitot and static ports.
23  *
24  * Input properties:
25  *
26  * /instrumentation/"name"/serviceable
27  * "pitot_port"/total-pressure-inhg
28  * "static_port"/pressure-inhg
29  * /environment/density-slugft3
30  *
31  * Output properties:
32  *
33  * /instrumentation/"name"/indicated-speed-kt
34  * /instrumentation/"name"/true-speed-kt
35  * /instrumentation/"name"/indicated-mach
36  */
37 class AirspeedIndicator : public SGSubsystem
38 {
39
40 public:
41
42     AirspeedIndicator ( SGPropertyNode *node );
43     virtual ~AirspeedIndicator ();
44
45     virtual void init ();
46     virtual void reinit ();
47     virtual void update (double dt);
48
49 private:
50     void computeMach();
51
52     std::string _name;
53     unsigned int _num;
54     std::string _total_pressure;
55     std::string _static_pressure;
56     bool _has_overspeed;
57     std::string _pressure_alt_source;
58     double _ias_limit;
59     double _mach_limit;
60     double _alt_threshold;
61     
62     SGPropertyNode_ptr _ias_limit_node;
63     SGPropertyNode_ptr _mach_limit_node;
64     SGPropertyNode_ptr _alt_threshold_node;
65     SGPropertyNode_ptr _serviceable_node;
66     SGPropertyNode_ptr _total_pressure_node;
67     SGPropertyNode_ptr _static_pressure_node;
68     SGPropertyNode_ptr _density_node;
69     SGPropertyNode_ptr _speed_node;
70     SGPropertyNode_ptr _airspeed_limit;
71     SGPropertyNode_ptr _pressure_alt;
72     SGPropertyNode_ptr _mach_node;
73     SGPropertyNode_ptr _tas_node;
74     
75     FGEnvironmentMgr* _environmentManager;
76 };
77
78 #endif // __INSTRUMENTS_AIRSPEED_INDICATOR_HXX