1 // steam.hxx - Steam Gauge Indications
3 // Started by Alex Perry
5 // Copyright (C) 2000 Alexander Perry - alex.perry@ieee.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.
32 #include <simgear/compiler.h>
37 SG_USING_NAMESPACE(std);
43 * This class is a mapping layer, which retrieves information from
44 * the BFI (which reports truthful and ideal values) and generates
45 * all the instrument errors and inaccuracies that pilots (err)
46 * love, of course. Please report any missing flaws (!).
48 * These should be used to operate cockpit instruments,
49 * and autopilot features where these are slaved thus.
50 * They should not be used for other simulation purposes.
57 static void update ( int timesteps );
60 static double get_ALT_ft ();
61 static double get_TC_rad ();
62 static double get_MH_deg ();
63 static double get_DG_deg ();
64 static double get_DG_err ();
65 static void set_DG_err(double approx_magvar);
68 static double get_ASI_kias ();
69 static double get_TC_std ();
70 static double get_VSI_fps ();
73 static double get_VACUUM_inhg ();
76 static double get_ALT_datum_mb ();
77 static void set_ALT_datum_mb(double datum_mb);
79 // Hacks ... temporary stuff
80 // static double get_HackVOR1_deg ();
81 static double get_HackOBS1_deg ();
82 // static double get_HackGS_deg ();
83 // static double get_HackVOR2_deg ();
84 static double get_HackOBS2_deg ();
85 static double get_HackADF_deg ();
89 static double the_ALT_ft;
90 static double the_ALT_datum_mb;
91 static double the_TC_rad, the_TC_std;
92 static double the_STATIC_inhg, the_VACUUM_inhg;
93 static double the_VSI_fps, the_VSI_case;
94 static double the_MH_deg, the_MH_degps, the_MH_err;
95 static double the_DG_deg, the_DG_degps, the_DG_inhg, the_DG_err;
97 static int _UpdatesPending;
98 static void _CatchUp ();
100 static void set_lowpass ( double *outthe,
101 double inthe, double tc );