1 // transponder.hxx -- class to impliment a transponder
3 // Written by Roy Vegard Ovesen, started September 2004.
5 // Copyright (C) 2004 Roy Vegard Ovesen - rvovesen@tiscali.no
6 // Copyright (C) 2013 Clement de l'Hamaide - clemaez@hotmail.fr
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef TRANSPONDER_HXX
23 #define TRANSPONDER_HXX 1
26 # error This library requires C++
29 #include <Main/fg_props.hxx>
31 #include <simgear/structure/subsystem_mgr.hxx>
32 #include <simgear/props/tiedpropertylist.hxx>
34 class Transponder : public SGSubsystem, public SGPropertyChangeListener
37 Transponder(SGPropertyNode *node);
38 virtual ~Transponder();
41 virtual void update (double dt);
43 virtual void unbind();
63 // annunciators, for KT-70 compatibility only
64 // these should be replaced with conditionals in the instrument
65 bool getFLAnnunciator() const;
66 bool getAltAnnunciator() const;
67 bool getGroundAnnuciator() const;
68 bool getOnAnnunciator() const;
69 bool getStandbyAnnunciator() const;
70 bool getReplyAnnunciator() const;
73 SGPropertyNode_ptr _pressureAltitude_node;
74 SGPropertyNode_ptr _busPower_node;
75 SGPropertyNode_ptr _serviceable_node;
77 SGPropertyNode_ptr _mode_node;
78 SGPropertyNode_ptr _knob_node;
79 SGPropertyNode_ptr _idCode_node;
80 SGPropertyNode_ptr _digit_node[4];
82 simgear::TiedPropertyList _tiedProperties;
84 SGPropertyNode_ptr _identBtn_node;
89 SGPropertyNode_ptr _altitude_node;
90 SGPropertyNode_ptr _altitudeValid_node;
91 SGPropertyNode_ptr _transmittedId_node;
92 SGPropertyNode_ptr _ident_node;
100 int _listener_active;
101 double _requiredBusVolts;
102 std::string _altitudeSourcePath;
104 void valueChanged (SGPropertyNode *);
105 int setMinMax(int val);
106 bool has_power() const;
109 #endif // TRANSPONDER_HXX