1 // kt-70.hxx -- class to impliment the King KT 70 panel-m transponder
3 // Written by Curtis Olson, started July 2002.
5 // Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <Main/fg_props.hxx>
30 #include <simgear/compiler.h>
31 #include <simgear/structure/subsystem_mgr.hxx>
32 #include <simgear/props/tiedpropertylist.hxx>
33 #include <simgear/math/interpolater.hxx>
34 #include <simgear/timing/timestamp.hxx>
36 #include <Navaids/navlist.hxx>
37 #include <Sound/beacon.hxx>
38 #include <Sound/morse.hxx>
41 class FGKT_70 : public SGSubsystem
44 SGPropertyNode_ptr lon_node;
45 SGPropertyNode_ptr lat_node;
46 SGPropertyNode_ptr alt_node;
47 SGPropertyNode_ptr bus_power;
48 SGPropertyNode_ptr serviceable_node;
54 bool ident_mode; // false = normal, true = ident/squawk
59 int digit1, digit2, digit3, digit4;
60 int func_knob; // 0 = OFF, 1 = SBY, 2 = TST, 3 = GND, 4 = ON,
68 bool fl_ann; // flight level
69 bool alt_ann; // altitude
70 bool gnd_ann; // ground
72 bool sby_ann; // standby
73 bool reply_ann; // reply
77 simgear::TiedPropertyList _tiedProperties;
81 FGKT_70(SGPropertyNode *node);
87 void update (double dt);
88 void search () { /* empty placeholder */ }
91 inline bool has_power() const {
92 return (func_knob > 0) && (bus_power->getDoubleValue() > 1.0);
96 inline bool get_ident_btn() const { return ident_btn; }
97 inline void set_ident_btn( bool val ) { ident_btn = val; }
98 inline int get_digit1() const { return digit1; }
99 inline void set_digit1( int val ) { digit1 = val; }
100 inline int get_digit2() const { return digit2; }
101 inline void set_digit2( int val ) { digit2 = val; }
102 inline int get_digit3() const { return digit3; }
103 inline void set_digit3( int val ) { digit3 = val; }
104 inline int get_digit4() const { return digit4; }
105 inline void set_digit4( int val ) { digit4 = val; }
106 inline int get_func_knob() const { return func_knob; }
107 inline void set_func_knob( int val ) { func_knob = val; }
110 inline int get_id_code () const { return id_code; }
111 inline void set_id_code( int c ) { id_code = c; }
112 inline int get_flight_level () const { return flight_level; }
115 inline bool get_fl_ann() const { return fl_ann; }
116 inline bool get_alt_ann() const { return alt_ann; }
117 inline bool get_gnd_ann() const { return gnd_ann; }
118 inline bool get_on_ann() const { return on_ann; }
119 inline bool get_sby_ann() const { return sby_ann; }
120 inline bool get_reply_ann() const { return reply_ann; }
124 #endif // _FG_KT_70_HXX