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 <Sound/morse.hxx>
31 * /position/longitude-deg
32 * /position/latitude-deg
33 * /position/altitude-ft
34 * /orientation/heading-deg
35 * /systems/electrical/outputs/adf
36 * /instrumentation/adf/serviceable
37 * /instrumentation/adf/error-deg
38 * /instrumentation/adf/frequencies/selected-khz
39 * /instrumentation/adf/mode
40 * /instrumentation/adf/ident-audible
41 * /instrumentation/adf/volume-norm
45 * /instrumentation/adf/in-range
46 * /instrumentation/adf/indicated-bearing-deg
47 * /instrumentation/adf/ident
49 class ADF : public SGSubsystem
54 ADF ( SGPropertyNode *node );
58 virtual void update (double delta_time_sec);
62 void set_bearing (double delta_time_sec, double bearing);
64 void search (double frequency, double longitude_rad,
65 double latitude_rad, double altitude_m);
70 SGPropertyNode_ptr _longitude_node;
71 SGPropertyNode_ptr _latitude_node;
72 SGPropertyNode_ptr _altitude_node;
73 SGPropertyNode_ptr _heading_node;
74 SGPropertyNode_ptr _serviceable_node;
75 SGPropertyNode_ptr _error_node;
76 SGPropertyNode_ptr _electrical_node;
77 SGPropertyNode_ptr _frequency_node;
78 SGPropertyNode_ptr _mode_node;
80 SGPropertyNode_ptr _in_range_node;
81 SGPropertyNode_ptr _bearing_node;
82 SGPropertyNode_ptr _ident_node;
83 SGPropertyNode_ptr _ident_audible_node;
84 SGPropertyNode_ptr _volume_node;
86 double _time_before_search_sec;
88 int _last_frequency_khz;
89 bool _transmitter_valid;
91 SGGeod _transmitter_pos;
92 SGVec3d _transmitter_cart;
93 double _transmitter_range_nm;
97 time_t _last_ident_time;
101 SGSharedPtr<SGSampleGroup> _sgr;
105 #endif // __INSTRUMENTS_ADF_HXX