1 // adf.hxx - automatic direction finder.
2 // Written by David Megginson, started 2003.
4 // This file is in the Public Domain and comes with no warranty.
7 #ifndef __INSTRUMENTS_ADF_HXX
8 #define __INSTRUMENTS_ADF_HXX 1
11 # error This library requires C++
16 #include <simgear/props/props.hxx>
18 #include <simgear/structure/subsystem_mgr.hxx>
19 #include <simgear/math/SGMath.hxx>
28 * /position/longitude-deg
29 * /position/latitude-deg
30 * /position/altitude-ft
31 * /orientation/heading-deg
32 * /systems/electrical/outputs/adf
33 * /instrumentation/adf/serviceable
34 * /instrumentation/adf/error-deg
35 * /instrumentation/adf/frequencies/selected-khz
36 * /instrumentation/adf/mode
37 * /instrumentation/adf/ident-audible
38 * /instrumentation/adf/volume-norm
42 * /instrumentation/adf/in-range
43 * /instrumentation/adf/indicated-bearing-deg
44 * /instrumentation/adf/ident
46 class ADF : public SGSubsystem
51 ADF ( SGPropertyNode *node );
55 virtual void update (double delta_time_sec);
59 void set_bearing (double delta_time_sec, double bearing);
61 void search (double frequency, const SGGeod& pos);
66 SGPropertyNode_ptr _heading_node;
67 SGPropertyNode_ptr _serviceable_node;
68 SGPropertyNode_ptr _error_node;
69 SGPropertyNode_ptr _electrical_node;
70 SGPropertyNode_ptr _frequency_node;
71 SGPropertyNode_ptr _mode_node;
73 SGPropertyNode_ptr _in_range_node;
74 SGPropertyNode_ptr _bearing_node;
75 SGPropertyNode_ptr _ident_node;
76 SGPropertyNode_ptr _ident_audible_node;
77 SGPropertyNode_ptr _volume_node;
78 SGPropertyNode_ptr _power_btn_node;
79 SGPropertyNode_ptr _operable_node;
81 double _time_before_search_sec;
83 int _last_frequency_khz;
84 bool _transmitter_valid;
85 std::string _last_ident;
86 SGGeod _transmitter_pos;
87 SGVec3d _transmitter_cart;
88 double _transmitter_range_nm;
91 time_t _last_ident_time;
93 std::string _adf_ident;
95 SGSharedPtr<SGSampleGroup> _sgr;
99 #endif // __INSTRUMENTS_ADF_HXX