]> git.mxchange.org Git - flightgear.git/blob - src/Main/bfi.hxx
Contributed by Dave Luff:
[flightgear.git] / src / Main / bfi.hxx
1 // bfi.hxx - Big Flat Interface
2 //
3 // Written by David Megginson, started February, 2000.
4 //
5 // Copyright (C) 2000  David Megginson - david@megginson.com
6 //
7 // THIS INTERFACE IS DEPRECATED; USE THE PROPERTY MANAGER INSTEAD.
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //
23 // $Id$
24
25 #include <time.h>
26 #include <string>
27
28 #include <simgear/compiler.h>
29
30 FG_USING_NAMESPACE(std);
31
32
33 /**
34  * Big Flat Interface
35  *
36  * This class implements the Facade design pattern (GOF p.185) to provide
37  * a single, (deceptively) simple flat interface for the FlightGear
38  * subsystems.  
39  *
40  * To help cut down on interdependence, subsystems should
41  * use the BFI whenever possible for inter-system communication.
42  *
43  * TODO:
44  * - add selectors to switch the current plane, throttle, brake, etc.
45  * - add more autopilot settings
46  */
47 class FGBFI
48 {
49 public:
50
51                                 // Initialize before first use.
52   static void init ();
53
54                                 // Reinit if necessary.
55   static void update ();
56
57                                 // Simulation
58   static int getFlightModel ();
59   static void setFlightModel (int flightModel);
60
61   static string getAircraft ();
62   static void setAircraft (string aircraft);
63
64   static string getAircraftDir ();
65   static void setAircraftDir (string aircraftDir);
66
67 //   static time_t getTimeGMT ();
68 //   static void setTimeGMT (time_t time);
69   static string getDateString ();// ISO 8601 subset
70   static void setDateString (string time_string); // ISO 8601 subset
71
72                                 // deprecated
73   static string getGMTString ();
74
75                                 // Position
76   static double getLatitude (); // degrees
77   static void setLatitude (double latitude); // degrees
78
79   static double getLongitude (); // degrees
80   static void setLongitude (double longitude); // degrees
81
82   static double getAltitude (); // feet
83   static void setAltitude (double altitude); // feet
84
85   static double getAGL ();      // feet
86
87
88                                 // Attitude
89   static double getHeading ();    // degrees
90   static void setHeading (double heading); // degrees
91
92   static double getHeadingMag (); // degrees
93
94   static double getPitch ();    // degrees
95   static void setPitch (double pitch); // degrees
96
97   static double getRoll ();     // degrees
98   static void setRoll (double roll); // degrees
99
100                                 // Engine
101   static double getRPM ();      // revolutions/minute
102   static void setRPM ( double rpm ); // revolutions/minute
103
104   static double getEGT ();      // deg Fahrenheit
105   static double getCHT ();      // deg Fahrenheit
106   static double getMP ();       // inches mercury
107   static double getFuelFlow (); // gals/hr
108
109                                  // Consumables
110   static double getTank1Fuel (); // gals
111   static void setTank1Fuel( double gals );
112   static double getTank2Fuel (); // gals
113   static void setTank2Fuel( double gals );
114
115                                 // Velocities
116   static double getAirspeed (); // knots
117   static void setAirspeed (double speed); // knots
118
119   static double getSideSlip (); // [unit??]
120
121   static double getVerticalSpeed (); // feet/second
122
123   static double getSpeedNorth (); // feet/second
124
125   static double getSpeedEast (); // feet/second
126
127   static double getSpeedDown (); // feet/second
128
129 //   static void setSpeedNorth (double speed);
130 //   static void setSpeedEast (double speed);
131 //   static void setSpeedDown (double speed);
132
133
134                                 // Autopilot
135   static bool getAPAltitudeLock ();
136   static void setAPAltitudeLock (bool lock);
137
138   static double getAPAltitude (); // feet
139   static void setAPAltitude (double altitude); // feet
140
141   static double getAPClimb (); // fpm
142   static void setAPClimb (double rate); // fpm
143
144   static bool getAPHeadingLock ();
145   static void setAPHeadingLock (bool lock);
146
147   static double getAPHeadingBug (); // degrees
148   static void setAPHeadingBug (double heading); // degrees
149
150   static bool getAPWingLeveler ();
151   static void setAPWingLeveler (bool lock);
152
153   static bool getAPNAV1Lock ();
154   static void setAPNAV1Lock (bool lock);
155
156
157                                 // GPS
158   static string getTargetAirport ();
159   static void setTargetAirport (string targetAirport);
160
161   static bool getGPSLock ();
162   static void setGPSLock (bool lock);
163
164   static double getGPSTargetLatitude (); // degrees
165
166   static double getGPSTargetLongitude (); // degrees
167
168
169                                 // Weather
170   static double getVisibility ();// meters
171   static void setVisibility (double visiblity); // meters
172   static double getWindNorth (); // feet/second
173   static void setWindNorth (double speed); // feet/second
174   static double getWindEast (); // feet/second
175   static void setWindEast (double speed); // feet/second
176   static double getWindDown (); // feet/second
177   static void setWindDown (double speed); // feet/second
178
179                                 // View
180   static double getFOV ();      // degrees
181   static void setFOV (double fov); // degrees
182   static void setViewAxisLong (double axis);// -1.0:1.0
183   static void setViewAxisLat (double axis); // -1.0:1.0
184
185
186                                 // Time (this varies with time) huh, huh
187   static double getMagVar ();   // degrees
188   static double getMagDip ();   // degrees
189
190
191 private:
192                                 // Will cause a linking error if invoked.
193   FGBFI ();
194
195 };
196
197 // end of bfi.hxx