]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/encoder.hxx
Modified Files:
[flightgear.git] / src / Instrumentation / encoder.hxx
1 // encoder.hxx -- class to impliment an altitude encoder
2 //
3 // Written by Roy Vegard Ovesen, started September 2004.
4 //
5 // Copyright (C) 2004  Roy Vegard Ovesen - rvovesen@tiscali.no
6 //
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.
11 //
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.
16 //
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.
20
21 #ifndef ENCODER_HXX
22 #define ENCODER_HXX 1
23
24 #ifndef __cplusplus
25 # error This library requires C++
26 #endif
27
28 #include <Main/fg_props.hxx>
29
30 #include <simgear/math/interpolater.hxx>
31 #include <simgear/structure/subsystem_mgr.hxx>
32
33
34 class Encoder : public SGSubsystem
35 {
36 public:
37     Encoder(SGPropertyNode *node);
38     ~Encoder();
39
40     void init ();
41     void update (double dt);
42
43 private:
44     // Inputs
45     SGPropertyNode_ptr staticPressureNode;
46     SGPropertyNode_ptr busPowerNode;
47     SGPropertyNode_ptr serviceableNode;
48
49     // Outputs
50     SGPropertyNode_ptr pressureAltitudeNode;
51     SGPropertyNode_ptr modeCAltitudeNode;
52
53     // Internal
54     string _name;
55     int _num;
56     string _static_pressure;
57
58     SGInterpTable* altitudeTable;
59 };
60
61 #endif // ENCODER_HXX