]> git.mxchange.org Git - flightgear.git/blob - src/Cockpit/steam.hxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Cockpit / steam.hxx
1 // steam.hxx - Steam Gauge Indications
2 //
3 // Started by Alex Perry
4 //
5 // Copyright (C) 2000  Alexander Perry - alex.perry@ieee.org
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifndef FG_STEAM
25 #define FG_STEAM
26
27
28 #ifdef HAVE_CONFIG_H
29 #  include <config.h>
30 #endif
31
32 #include <simgear/compiler.h>
33
34 #include <Main/fgfs.hxx>
35
36 #include <time.h>
37 #include STL_STRING
38
39 SG_USING_NAMESPACE(std);
40
41
42 /**
43  * STEAM GAUGES
44  *
45  * This class is a mapping layer, which retrieves information from the
46  * property manager (which reports truthful and ideal values) and
47  * generates all the instrument errors and inaccuracies that pilots
48  * (err) love, of course.  Please report any missing flaws (!).
49  *
50  * These should be used to operate cockpit instruments, 
51  * and autopilot features where these are slaved thus.
52  * They should not be used for other simulation purposes.
53  */
54 class FGSteam : public FGSubsystem
55 {
56 public:
57
58   FGSteam ();
59   virtual ~FGSteam ();
60
61   virtual void init ();
62
63   virtual void update (double dt_sec);
64
65   virtual void bind ();
66
67   virtual void unbind ();
68
69                                 // Position
70   virtual double get_ALT_ft () const;
71   virtual double get_TC_rad () const;
72   virtual double get_MH_deg () const;
73   virtual double get_DG_deg () const;
74   virtual double get_DG_err () const;
75   virtual void set_DG_err(double approx_magvar);
76
77                                 // Velocities
78   virtual double get_ASI_kias () const;
79   virtual double get_TC_std () const;
80   virtual double get_VSI_fps () const;
81
82                                 // Engine Gauges
83   virtual double get_VACUUM_inhg () const;
84
85                                 // Atmosphere
86   virtual double get_ALT_datum_mb () const;
87   virtual void set_ALT_datum_mb(double datum_mb);
88
89                                 // Hacks ... temporary stuff
90   // static double get_HackVOR1_deg ();
91   virtual double get_HackOBS1_deg () const;
92   // static double get_HackGS_deg ();
93   // static double get_HackVOR2_deg ();
94   virtual double get_HackOBS2_deg () const;
95
96
97 private:
98
99   void  _CatchUp ();
100   void  set_lowpass ( double *outthe, double inthe, double tc );
101
102   double the_ALT_ft;
103   double the_ALT_datum_mb;
104   double the_TC_rad, the_TC_std;
105   double the_STATIC_inhg, the_VACUUM_inhg;
106   double the_VSI_fps, the_VSI_case;
107   double the_MH_deg, the_MH_degps, the_MH_err;
108   double the_DG_deg, the_DG_degps, the_DG_inhg, the_DG_err;
109
110   double        _UpdateTimePending;
111
112   SGPropertyNode_ptr _heading_deg_node;
113   SGPropertyNode_ptr _mag_var_deg_node;
114   SGPropertyNode_ptr _mag_dip_deg_node;
115   SGPropertyNode_ptr _engine_0_rpm_node;
116   SGPropertyNode_ptr _pressure_inhg_node;
117
118 };
119
120
121 #endif // FG_STEAM