1 // radiostack.hxx -- class to manage an instance of the radio stack
3 // Written by Curtis Olson, started April 2000.
5 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _FG_RADIOSTACK_HXX
25 #define _FG_RADIOSTACK_HXX
28 #include <Main/fgfs.hxx>
29 #include <Main/fg_props.hxx>
31 #include <simgear/compiler.h>
33 #include <simgear/math/interpolater.hxx>
34 #include <simgear/timing/timestamp.hxx>
36 #include <Navaids/ilslist.hxx>
37 #include <Navaids/navlist.hxx>
38 #include <Sound/beacon.hxx>
39 #include <Sound/morse.hxx>
41 #include "kr_87.hxx" // ADF
42 #include "kt_70.hxx" // Transponder
45 class FGRadioStack : public FGSubsystem
50 SGInterpTable *term_tbl;
51 SGInterpTable *low_tbl;
52 SGInterpTable *high_tbl;
54 SGPropertyNode *lon_node;
55 SGPropertyNode *lat_node;
56 SGPropertyNode *alt_node;
67 double dme_effective_range;
75 SGTimeStamp dme_last_time;
86 FGKR_87 adf; // King KR 87 Digital ADF model
87 FGKT_70 xponder; // Bendix/King KT 70 Panel-Mounted Transponder
91 // model standard VOR/DME/TACAN service volumes as per AIM 1-1-8
92 double adjustNavRange( double stationElev, double aircraftElev,
93 double nominalRange );
95 // model standard ILS service volumes as per AIM 1-1-9
96 double adjustILSRange( double stationElev, double aircraftElev,
97 double offsetDegrees, double distance );
107 void update (double dt);
109 // Update nav/adf radios based on current postition
112 inline FGNavCom *get_navcom1() { return &navcom1; }
113 inline FGNavCom *get_navcom2() { return &navcom2; }
116 inline void set_dme_freq (double freq) {
117 dme_freq = freq; need_update = true;
122 inline double get_dme_freq () const { return dme_freq; }
124 // Marker Beacon Accessors
125 inline bool get_inner_blink () const { return inner_blink; }
126 inline bool get_middle_blink () const { return middle_blink; }
127 inline bool get_outer_blink () const { return outer_blink; }
129 // Calculated values.
130 inline bool get_dme_inrange () const { return dme_inrange; }
131 inline double get_dme_dist () const { return dme_dist; }
132 inline double get_dme_spd () const { return dme_spd; }
133 inline double get_dme_ete () const { return dme_ete; }
137 extern FGRadioStack *current_radiostack;
139 #endif // _FG_RADIOSTACK_HXX