]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/dme.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / Instrumentation / dme.hxx
1 // dme.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_DME_HXX
8 #define __INSTRUMENTS_DME_HXX 1
9
10 #ifndef __cplusplus
11 # error This library requires C++
12 #endif
13
14 #include <simgear/math/point3d.hxx>
15 #include <simgear/props/props.hxx>
16
17 #include <Main/fgfs.hxx>
18
19
20 /**
21  * Model a DME radio.
22  *
23  * Input properties:
24  *
25  * /position/longitude-deg
26  * /position/latitude-deg
27  * /position/altitude-ft
28  * /systems/electrical/outputs/dme
29  * /instrumentation/dme/serviceable
30  * /instrumentation/dme/frequencies/source
31  * /instrumentation/dme/frequencies/selected-mhz
32  *
33  * Output properties:
34  *
35  * /instrumentation/dme/in-range
36  * /instrumentation/dme/indicated-distance-nm
37  * /instrumentation/dme/indicated-ground-speed-kt
38  * /instrumentation/dme/indicated-time-kt
39  */
40 class DME : public FGSubsystem
41 {
42
43 public:
44
45     DME ();
46     virtual ~DME ();
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 _serviceable_node;
60     SGPropertyNode_ptr _electrical_node;
61     SGPropertyNode_ptr _source_node;
62     SGPropertyNode_ptr _frequency_node;
63
64     SGPropertyNode_ptr _in_range_node;
65     SGPropertyNode_ptr _distance_node;
66     SGPropertyNode_ptr _speed_node;
67     SGPropertyNode_ptr _time_node;
68
69     double _last_distance_nm;
70     double _last_frequency_mhz;
71     double _time_before_search_sec;
72
73     bool _transmitter_valid;
74     Point3D _transmitter;
75     double _transmitter_elevation_ft;
76     double _transmitter_range_nm;
77
78 };
79
80
81 #endif // __INSTRUMENTS_DME_HXX