]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/heading_indicator_fg.hxx
GPS: fix bad init when far from any airport
[flightgear.git] / src / Instrumentation / heading_indicator_fg.hxx
1 // heading_indicator.hxx - a vacuum-powered heading 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_HEADING_INDICATOR_FG_HXX
8 #define __INSTRUMENTS_HEADING_INDICATOR_FG_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 #include "gyro.hxx"
18
19
20 /**
21  * Model an electically-powered fluxgate compass
22  *
23  * Input properties:
24  *
25  * /instrumentation/"name"/serviceable
26  * /instrumentation/"name"/spin
27  * /instrumentation/"name"/offset-deg
28  * /orientation/heading-deg
29  * /systems/electrical/outputs/DG
30  *
31  * Output properties:
32  *
33  * /instrumentation/"name"/indicated-heading-deg
34  */
35 class HeadingIndicatorFG : public SGSubsystem
36 {
37
38 public:
39
40     HeadingIndicatorFG ( SGPropertyNode *node );
41     HeadingIndicatorFG ();
42     virtual ~HeadingIndicatorFG ();
43
44     virtual void init ();
45     virtual void reinit ();
46     virtual void bind ();
47     virtual void unbind ();
48     virtual void update (double dt);
49
50 private:
51
52     Gyro _gyro;
53     double _last_heading_deg;
54
55     std::string name;
56     int num;
57     
58     SGPropertyNode_ptr _offset_node;
59     SGPropertyNode_ptr _heading_in_node;
60     SGPropertyNode_ptr _serviceable_node;
61     SGPropertyNode_ptr _heading_out_node;
62         SGPropertyNode_ptr _electrical_node;
63         SGPropertyNode_ptr _error_node;
64         SGPropertyNode_ptr _nav1_error_node;
65     SGPropertyNode_ptr _off_node;
66
67
68     
69 };
70
71 #endif // __INSTRUMENTS_HEADING_INDICATOR_HXX