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