]> git.mxchange.org Git - flightgear.git/blob - src/Main/bfi.hxx
Applied changes relative to David Megginson's property manager rewrite.
[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 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 #include <time.h>
24 #include <string>
25
26 #include <simgear/compiler.h>
27
28 FG_USING_NAMESPACE(std);
29
30
31 /**
32  * Big Flat Interface
33  *
34  * This class implements the Facade design pattern (GOF p.185) to provide
35  * a single, (deceptively) simple flat interface for the FlightGear
36  * subsystems.  
37  *
38  * To help cut down on interdependence, subsystems should
39  * use the BFI whenever possible for inter-system communication.
40  *
41  * TODO:
42  * - add selectors to switch the current plane, throttle, brake, etc.
43  * - add more autopilot settings
44  */
45 class FGBFI
46 {
47 public:
48
49                                 // Initialize before first use.
50   static void init ();
51
52                                 // Reinit if necessary.
53   static void update ();
54
55                                 // Simulation
56   static int getFlightModel ();
57   static void setFlightModel (int flightModel);
58
59   static string getAircraft ();
60   static void setAircraft (string aircraft);
61
62   static string getAircraftDir ();
63   static void setAircraftDir (string aircraftDir);
64
65 //   static time_t getTimeGMT ();
66 //   static void setTimeGMT (time_t time);
67   static string getDateString ();
68   static void setDateString (string time_string);
69
70                                 // deprecated
71   static string getGMTString ();
72
73   static bool getHUDVisible ();
74   static void setHUDVisible (bool hudVisible);
75
76   static bool getPanelVisible ();
77   static void setPanelVisible (bool panelVisible);
78
79   static int getPanelXOffset ();
80   static void setPanelXOffset (int i);
81
82   static int getPanelYOffset ();
83   static void setPanelYOffset (int i);
84
85
86                                 // Position
87   static double getLatitude ();
88   static void setLatitude (double latitude);
89
90   static double getLongitude ();
91   static void setLongitude (double longitude);
92
93   static double getAltitude ();
94   static void setAltitude (double altitude);
95
96   static double getAGL ();
97
98
99                                 // Attitude
100   static double getHeading ();    // true heading
101   static void setHeading (double heading);
102
103   static double getHeadingMag (); // exact magnetic heading
104
105   static double getPitch ();
106   static void setPitch (double pitch);
107
108   static double getRoll ();
109   static void setRoll (double roll);
110
111                                 // Engine
112   static double getRPM ();
113   static void setRPM ( double rpm );
114
115   static double getEGT ();
116   static double getCHT ();
117   static double getMP ();
118
119                                 // Velocities
120   static double getAirspeed ();
121   static void setAirspeed (double speed);
122
123   static double getSideSlip ();
124
125   static double getVerticalSpeed ();
126
127   static double getSpeedNorth ();
128
129   static double getSpeedEast ();
130
131   static double getSpeedDown ();
132
133 //   static void setSpeedNorth (double speed);
134 //   static void setSpeedEast (double speed);
135 //   static void setSpeedDown (double speed);
136
137
138                                 // Controls
139   static double getThrottle ();
140   static void setThrottle (double throttle);
141
142   static double getMixture ();
143   static void setMixture (double mixture);
144
145   static double getPropAdvance ();
146   static void setPropAdvance (double pitch);
147
148   static double getFlaps ();
149   static void setFlaps (double flaps);
150
151   static double getAileron ();
152   static void setAileron (double aileron);
153
154   static double getRudder ();
155   static void setRudder (double rudder);
156
157   static double getElevator ();
158   static void setElevator (double elevator);
159
160   static double getElevatorTrim ();
161   static void setElevatorTrim (double trim);
162
163   static double getBrakes ();
164   static void setBrakes (double brake);
165
166   static double getLeftBrake ();
167   static void setLeftBrake (double brake);
168
169   static double getRightBrake ();
170   static void setRightBrake (double brake);
171
172   static double getCenterBrake ();
173   static void setCenterBrake (double brake);
174
175
176                                 // Autopilot
177   static bool getAPAltitudeLock ();
178   static void setAPAltitudeLock (bool lock);
179
180   static double getAPAltitude ();
181   static void setAPAltitude (double altitude);
182
183   static bool getAPHeadingLock ();
184   static void setAPHeadingLock (bool lock);
185
186   static double getAPHeading ();
187   static void setAPHeading (double heading);
188
189   static double getAPHeadingMag ();
190   static void setAPHeadingMag (double heading);
191
192   static bool getAPNAV1Lock ();
193   static void setAPNAV1Lock (bool lock);
194
195                                 // Radio Navigation
196   static double getNAV1Freq ();
197   static void setNAV1Freq (double freq);
198
199   static double getNAV1AltFreq ();
200   static void setNAV1AltFreq (double freq);
201
202   static double getNAV1Radial ();
203
204   static double getNAV1SelRadial ();
205   static void setNAV1SelRadial (double radial);
206
207   static double getNAV1DistDME ();
208
209   static bool getNAV1TO ();
210
211   static bool getNAV1FROM ();
212
213   static bool getNAV1InRange ();
214
215   static bool getNAV1DMEInRange ();
216
217   static double getNAV2Freq ();
218   static void setNAV2Freq (double freq);
219
220   static double getNAV2AltFreq ();
221   static void setNAV2AltFreq (double freq);
222
223   static double getNAV2Radial ();
224
225   static double getNAV2SelRadial ();
226   static void setNAV2SelRadial (double radial);
227
228   static double getNAV2DistDME ();
229
230   static bool getNAV2TO ();
231
232   static bool getNAV2FROM ();
233
234   static bool getNAV2InRange ();
235
236   static bool getNAV2DMEInRange ();
237
238   static double getADFFreq ();
239   static void setADFFreq (double freq);
240
241   static double getADFAltFreq ();
242   static void setADFAltFreq (double freq);
243
244   static double getADFRotation ();
245   static void setADFRotation (double rot);
246
247                                 // GPS
248   static string getTargetAirport ();
249   static void setTargetAirport (string targetAirport);
250
251   static bool getGPSLock ();
252   static void setGPSLock (bool lock);
253
254   static double getGPSTargetLatitude ();
255
256   static double getGPSTargetLongitude ();
257
258
259                                 // Weather
260   static double getVisibility ();
261   static void setVisibility (double visiblity);
262
263
264                                 // Time (this varies with time) huh, huh
265   static double getMagVar (); 
266   static double getMagDip (); 
267
268
269 private:
270                                 // Will cause a linking error if invoked.
271   FGBFI ();
272
273 };
274
275 // end of bfi.hxx