]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/tacan.hxx
commradio: typo: cuttoff --> cutoff
[flightgear.git] / src / Instrumentation / tacan.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_TACAN_HXX
8 #define __INSTRUMENTS_TACAN_HXX 1
9
10 #include <simgear/props/props.hxx>
11 #include <simgear/structure/subsystem_mgr.hxx>
12
13
14 /**
15  * Model a TACAN radio.
16  *
17  * Input properties:
18  *
19  * /position/longitude-deg
20  * /position/latitude-deg
21  * /position/altitude-ft
22  * /heading
23  * /systems/electrical/outputs/TACAN
24  * /instrumentation/"name"/serviceable
25  * /instrumentation/"name"/frequencies/selected-mhz
26  *
27  * Output properties:
28  *
29  * /instrumentation/"name"/in-range
30  * /instrumentation/"name"/indicated-distance-nm
31  * /instrumentation/"name"/indicated-ground-speed-kt
32  * /instrumentation/"name"/indicated-time-kt
33  */
34 class TACAN : public SGSubsystem, public SGPropertyChangeListener
35 {
36
37   public:
38
39     TACAN(SGPropertyNode *node);
40     virtual ~TACAN();
41
42     virtual void init ();
43     virtual void reinit ();
44     virtual void update (double delta_time_sec);
45
46   private:
47
48     void disabled(bool force = false);
49
50     void search (double frequency, const SGGeod& pos);
51     double searchChannel (const std::string& channel);
52     void valueChanged (SGPropertyNode *);
53
54     std::string _name;
55     unsigned int _num;
56
57     SGPropertyNode_ptr _heading_node;
58     SGPropertyNode_ptr _serviceable_node;
59     SGPropertyNode_ptr _electrical_node;
60     SGPropertyNode_ptr _frequency_node;
61     SGPropertyNode_ptr _display_node;
62     SGPropertyNode_ptr _x_shift_node;
63     SGPropertyNode_ptr _y_shift_node;
64
65     SGPropertyNode_ptr _in_range_node;
66     SGPropertyNode_ptr _distance_node;
67     SGPropertyNode_ptr _speed_node;
68     SGPropertyNode_ptr _time_node;
69     SGPropertyNode_ptr _bearing_node;
70     SGPropertyNode_ptr _ident_node;
71     SGPropertyNode_ptr _name_node;
72
73     SGPropertyNode_ptr _channel_node;
74     SGPropertyNode_ptr _channel_in0_node;
75     SGPropertyNode_ptr _channel_in1_node;
76     SGPropertyNode_ptr _channel_in2_node;
77     SGPropertyNode_ptr _channel_in3_node;
78     SGPropertyNode_ptr _channel_in4_node;
79
80     bool _was_disabled;
81     bool _new_frequency;
82     std::string _channel;
83     double _last_distance_nm;
84     double _frequency_mhz;
85     double _time_before_search_sec;
86
87     FGNavRecordRef _active_station;
88
89     int _listener_active;
90 };
91
92
93 #endif // __INSTRUMENTS_TACAN_HXX