FlightGear next
tacan.hxx
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: CC0-1.0
3 *
4 * tacan.hxx - Models a TACAN (Tactical Air Navigation) Radio
5 * Written by David Megginson, started 2003.
6 *
7 * This file is in the Public Domain and comes with no warranty.
8 *
9*/
10
11
12
13#pragma once
14
15#include <simgear/props/props.hxx>
16#include <simgear/structure/subsystem_mgr.hxx>
17
18
39class TACAN : public SGSubsystem,
40 public SGPropertyChangeListener
41{
42public:
43 TACAN(SGPropertyNode *node);
44 virtual ~TACAN();
45
46 // Subsystem API.
47 void init() override;
48 void reinit() override;
49 void update(double delta_time_sec) override;
50
51 // Subsystem identification.
52 static const char* staticSubsystemClassId() { return "tacan"; }
53
54private:
55 void disabled(bool force = false);
56
57 void search (double frequency, const SGGeod& pos);
58 double searchChannel (const std::string& channel);
59 void valueChanged (SGPropertyNode *);
60
61 std::string _name;
62 unsigned int _num;
63
64 SGPropertyNode_ptr _heading_node;
65 SGPropertyNode_ptr _serviceable_node;
66 SGPropertyNode_ptr _electrical_node;
67 SGPropertyNode_ptr _frequency_node;
68 SGPropertyNode_ptr _display_node;
69 SGPropertyNode_ptr _x_shift_node;
70 SGPropertyNode_ptr _y_shift_node;
71
72 SGPropertyNode_ptr _in_range_node;
73 SGPropertyNode_ptr _distance_node;
74 SGPropertyNode_ptr _speed_node;
75 SGPropertyNode_ptr _time_node;
76 SGPropertyNode_ptr _bearing_node;
77 SGPropertyNode_ptr _ident_node;
78 SGPropertyNode_ptr _name_node;
79
80 SGPropertyNode_ptr _channel_node;
81 SGPropertyNode_ptr _channel_in0_node;
82 SGPropertyNode_ptr _channel_in1_node;
83 SGPropertyNode_ptr _channel_in2_node;
84 SGPropertyNode_ptr _channel_in3_node;
85 SGPropertyNode_ptr _channel_in4_node;
86
87 bool _was_disabled;
88 bool _new_frequency;
89 std::string _channel;
90 double _last_distance_nm;
91 double _frequency_mhz;
92 double _time_before_search_sec;
93
94 FGNavRecordRef _active_station;
95
96 int _listener_active;
97};
void update(double delta_time_sec) override
Definition tacan.cxx:122
static const char * staticSubsystemClassId()
Definition tacan.hxx:52
virtual ~TACAN()
Definition tacan.cxx:64
TACAN(SGPropertyNode *node)
Definition tacan.cxx:49
void reinit() override
Definition tacan.cxx:116
void init() override
Definition tacan.cxx:70
SGSharedPtr< FGNavRecord > FGNavRecordRef