]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/gps.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / Instrumentation / gps.hxx
1 // gps.hxx - distance-measuring equipment.
2 // Written by David Megginson, started 2003.
3 //
4 // This file is in the Public Domain and comes with no warranty.
5
6
7 #ifndef __INSTRUMENTS_GPS_HXX
8 #define __INSTRUMENTS_GPS_HXX 1
9
10 #ifndef __cplusplus
11 # error This library requires C++
12 #endif
13
14 #include <simgear/props/props.hxx>
15
16 #include <Main/fgfs.hxx>
17
18
19 /**
20  * Model a GPS radio.
21  *
22  * Input properties:
23  *
24  * /position/longitude-deg
25  * /position/latitude-deg
26  * /position/altitude-ft
27  * /environment/magnetic-variation-deg
28  * /systems/electrical/outputs/gps
29  * /instrumentation/gps/serviceable
30  *
31  * Output properties:
32  *
33  * /instrumentation/gps/indicated-longitude-deg
34  * /instrumentation/gps/indicated-latitude-deg
35  * /instrumentation/gps/indicated-altitude-ft
36  * /instrumentation/gps/indicated-track-true-deg
37  * /instrumentation/gps/indicated-track-magnetic-deg
38  * /instrumentation/gps/indicated-ground-speed-kt
39  */
40 class GPS : public FGSubsystem
41 {
42
43 public:
44
45     GPS ();
46     virtual ~GPS ();
47
48     virtual void init ();
49     virtual void update (double delta_time_sec);
50
51 private:
52
53     void search (double frequency, double longitude_rad,
54                  double latitude_rad, double altitude_m);
55
56     SGPropertyNode_ptr _longitude_node;
57     SGPropertyNode_ptr _latitude_node;
58     SGPropertyNode_ptr _altitude_node;
59     SGPropertyNode_ptr _magvar_node;
60     SGPropertyNode_ptr _serviceable_node;
61     SGPropertyNode_ptr _electrical_node;
62
63     SGPropertyNode_ptr _raim_node;
64     SGPropertyNode_ptr _indicated_longitude_node;
65     SGPropertyNode_ptr _indicated_latitude_node;
66     SGPropertyNode_ptr _indicated_altitude_node;
67     SGPropertyNode_ptr _true_track_node;
68     SGPropertyNode_ptr _magnetic_track_node;
69     SGPropertyNode_ptr _speed_node;
70
71     bool _last_valid;
72     double _last_longitude_deg;
73     double _last_latitude_deg;
74     double _last_altitude_m;
75
76 };
77
78
79 #endif // __INSTRUMENTS_GPS_HXX