]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/dme.hxx
Prepare and implement reinit methods for instruments
[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 #include <simgear/props/props.hxx>
11 #include <simgear/structure/subsystem_mgr.hxx>
12
13 /**
14  * Model a DME radio.
15  *
16  * Input properties:
17  *
18  * /position/longitude-deg
19  * /position/latitude-deg
20  * /position/altitude-ft
21  * /systems/electrical/outputs/dme
22  * /instrumentation/"name"/serviceable
23  * /instrumentation/"name"/frequencies/source
24  * /instrumentation/"name"/frequencies/selected-mhz
25  *
26  * Output properties:
27  *
28  * /instrumentation/"name"/in-range
29  * /instrumentation/"name"/indicated-distance-nm
30  * /instrumentation/"name"/indicated-ground-speed-kt
31  * /instrumentation/"name"/indicated-time-kt
32  */
33 class DME : public SGSubsystem
34 {
35
36 public:
37
38     DME ( SGPropertyNode *node );
39     virtual ~DME ();
40
41     virtual void init ();
42     virtual void reinit ();
43     virtual void update (double delta_time_sec);
44
45 private:
46
47     SGPropertyNode_ptr _serviceable_node;
48     SGPropertyNode_ptr _electrical_node;
49     SGPropertyNode_ptr _source_node;
50     SGPropertyNode_ptr _frequency_node;
51
52     SGPropertyNode_ptr _in_range_node;
53     SGPropertyNode_ptr _distance_node;
54     SGPropertyNode_ptr _speed_node;
55     SGPropertyNode_ptr _time_node;
56     SGPropertyNode_ptr _ident_btn_node;
57     SGPropertyNode_ptr _volume_node;
58
59     double _last_distance_nm;
60     double _last_frequency_mhz;
61     double _time_before_search_sec;
62
63     FGNavRecord * _navrecord;
64
65     std::string _name;
66     int _num;
67
68     class AudioIdent * _audioIdent;
69 };
70
71
72 #endif // __INSTRUMENTS_DME_HXX