]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/mrg.hxx
b10f653ce61ff13c63157240e9bfa3d4622d9cfb
[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 a vacuum-powered attitude indicator.
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  * "vacuum-system"/suction-inhg
29  *
30  * Output properties:
31  *
32  * /instrumentation/"name"/indicated-pitch-deg
33  * /instrumentation/"name"/indicated-roll-deg
34  * /instrumentation/"name"/tumble-norm
35  */
36
37 class MasterReferenceGyro : public SGSubsystem
38 {
39
40 public:
41
42     MasterReferenceGyro ( SGPropertyNode *node );
43     MasterReferenceGyro ();
44     virtual ~MasterReferenceGyro ();
45
46     virtual void init ();
47     virtual void bind ();
48     virtual void unbind ();
49     virtual void update (double dt);
50
51 private:
52
53     string name;
54     int num;
55
56     double _last_roll;
57     double _last_pitch;
58     double _last_hdg;
59     double _indicated_roll;
60     double _indicated_pitch;
61     double _indicated_hdg;
62     double _indicated_pitch_rate;
63     double _indicated_roll_rate;
64     double _indicated_hdg_rate;
65     double _last_roll_rate;
66     double _last_pitch_rate;
67     double _last_yaw_rate;
68
69     Gyro _gyro;
70
71     SGPropertyNode_ptr _tumble_flag_node;
72     SGPropertyNode_ptr _caged_node;
73     SGPropertyNode_ptr _off_node;
74     SGPropertyNode_ptr _tumble_node;
75     SGPropertyNode_ptr _pitch_in_node;
76     SGPropertyNode_ptr _roll_in_node;
77     SGPropertyNode_ptr _hdg_in_node;
78     SGPropertyNode_ptr _g_in_node;
79     SGPropertyNode_ptr _electrical_node;
80     SGPropertyNode_ptr _pitch_int_node;
81     SGPropertyNode_ptr _roll_int_node;
82     SGPropertyNode_ptr _hdg_int_node;
83     SGPropertyNode_ptr _pitch_out_node;
84     SGPropertyNode_ptr _roll_out_node;
85     SGPropertyNode_ptr _hdg_out_node;
86     SGPropertyNode_ptr _pitch_rate_out_node;
87     SGPropertyNode_ptr _roll_rate_out_node;
88     SGPropertyNode_ptr _hdg_rate_out_node;
89     SGPropertyNode_ptr _error_out_node;
90     SGPropertyNode_ptr _yaw_rate_node;
91     SGPropertyNode_ptr _roll_rate_node;
92     SGPropertyNode_ptr _pitch_rate_node;
93     SGPropertyNode_ptr _responsiveness_node;
94 };
95
96 #endif // __INSTRUMENTS_MRG_HXX