FlightGear next
adf.hxx
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: CC0-1.0
3 *
4 * adf.hxx - automatic direction finder.
5 * Written by David Megginson, started 2003.
6 * Last modified by Eric van den Berg, 24 Nov 2012
7 *
8 * This file is in the Public Domain and comes with no warranty.
9*/
10
11#pragma once
12
13#include <string>
14
16#include <simgear/math/SGMath.hxx>
17
18class SGSampleGroup;
19
43class ADF : public AbstractInstrument
44{
45public:
46 ADF ( SGPropertyNode *node );
47 virtual ~ADF ();
48
49 // Subsystem API.
50 void init() override;
51 void update(double delta_time_sec) override;
52
53 // Subsystem identification.
54 static const char* staticSubsystemClassId() { return "adf"; }
55
56private:
57 void set_bearing (double delta_time_sec, double bearing);
58
59 void search (double frequency, const SGGeod& pos);
60
61 SGPropertyNode_ptr _heading_node;
62 SGPropertyNode_ptr _error_node;
63 SGPropertyNode_ptr _frequency_node;
64 SGPropertyNode_ptr _mode_node;
65
66 SGPropertyNode_ptr _in_range_node;
67 SGPropertyNode_ptr _bearing_node;
68 SGPropertyNode_ptr _ident_node;
69 SGPropertyNode_ptr _ident_audible_node;
70 SGPropertyNode_ptr _volume_node;
71
72 double _time_before_search_sec;
73
74 int _last_frequency_khz;
75 bool _transmitter_valid;
76 std::string _last_ident;
77 SGGeod _transmitter_pos;
78 SGVec3d _transmitter_cart;
79 double _transmitter_range_nm;
80
81 int _ident_count;
82 time_t _last_ident_time;
83 float _last_volume;
84 std::string _adf_ident;
85
86 SGSharedPtr<SGSampleGroup> _sgr;
87};
ADF(SGPropertyNode *node)
Definition adf.cxx:63
void update(double delta_time_sec) override
Definition adf.cxx:118
void init() override
Definition adf.cxx:84
virtual ~ADF()
Definition adf.cxx:79
static const char * staticSubsystemClassId()
Definition adf.hxx:54