]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/mrg.hxx
#346 related: missing status message for property server
[flightgear.git] / src / Instrumentation / mrg.hxx
1 // attitude_indicator.hxx - a vacuum-powered attitude indicator.
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_MRG_HXX
8 #define __INSTRUMENTS_MRG_HXX 1
9
10
11 #include <simgear/props/props.hxx>
12 #include <simgear/structure/subsystem_mgr.hxx>
13
14 #include "gyro.hxx"
15
16
17 /**
18  * Model an electrically-powered master reference gyro.
19  *
20  * Input properties:
21  *
22  * /instrumentation/"name"/config/tumble-flag
23  * /instrumentation/"name"/serviceable
24  * /instrumentation/"name"/caged-flag
25  * /instrumentation/"name"/tumble-norm
26  * /orientation/pitch-deg
27  * /orientation/roll-deg
28  *
29  * Output properties:
30  *
31  * /instrumentation/"name"/indicated-pitch-deg
32  * /instrumentation/"name"/indicated-roll-deg
33  * /instrumentation/"name"/tumble-norm
34  */
35
36 class MasterReferenceGyro : public SGSubsystem
37 {
38
39 public:
40
41     MasterReferenceGyro ( SGPropertyNode *node );
42     MasterReferenceGyro ();
43     virtual ~MasterReferenceGyro ();
44
45     virtual void init ();
46     virtual void bind ();
47     virtual void unbind ();
48     virtual void update (double dt);
49
50 private:
51
52     static const double gravity; //conversion factor
53
54     string _name;
55     int _num;
56
57     double _last_roll;
58     double _last_pitch;
59     double _last_hdg;
60     double _indicated_roll;
61     double _indicated_pitch;
62     double _indicated_hdg;
63     double _indicated_pitch_rate;
64     double _indicated_roll_rate;
65     double _indicated_hdg_rate;
66     double _last_roll_rate;
67     double _last_pitch_rate;
68     double _last_yaw_rate;
69     double _last_g;
70     double _erect_time;
71     double _g_error;
72
73     Gyro _gyro;
74
75     SGPropertyNode_ptr _tumble_flag_node;
76     SGPropertyNode_ptr _caged_node;
77     SGPropertyNode_ptr _off_node;
78     SGPropertyNode_ptr _tumble_node;
79     SGPropertyNode_ptr _pitch_in_node;
80     SGPropertyNode_ptr _roll_in_node;
81     SGPropertyNode_ptr _hdg_in_node;
82     SGPropertyNode_ptr _hdg_mag_in_node;
83     SGPropertyNode_ptr _g_in_node;
84     SGPropertyNode_ptr _electrical_node;
85     SGPropertyNode_ptr _pitch_int_node;
86     SGPropertyNode_ptr _roll_int_node;
87     SGPropertyNode_ptr _hdg_int_node;
88     SGPropertyNode_ptr _pitch_out_node;
89     SGPropertyNode_ptr _roll_out_node;
90     SGPropertyNode_ptr _hdg_out_node;
91     SGPropertyNode_ptr _hdg_mag_out_node;
92     SGPropertyNode_ptr _pitch_rate_out_node;
93     SGPropertyNode_ptr _roll_rate_out_node;
94     SGPropertyNode_ptr _hdg_rate_out_node;
95     SGPropertyNode_ptr _error_out_node;
96     SGPropertyNode_ptr _yaw_rate_node;
97     SGPropertyNode_ptr _roll_rate_node;
98     SGPropertyNode_ptr _pitch_rate_node;
99     SGPropertyNode_ptr _responsiveness_node;
100     SGPropertyNode_ptr _hdg_input_source_node;
101     SGPropertyNode_ptr _fast_erect_node;
102 };
103
104 #endif // __INSTRUMENTS_MRG_HXX