]> git.mxchange.org Git - flightgear.git/blob - src/Main/bfi.hxx
Internal interface changes by David Megginson.
[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   static bool getHUDVisible ();
76   static void setHUDVisible (bool hudVisible);
77
78                                 // Position
79   static double getLatitude (); // degrees
80   static void setLatitude (double latitude); // degrees
81
82   static double getLongitude (); // degrees
83   static void setLongitude (double longitude); // degrees
84
85   static double getAltitude (); // feet
86   static void setAltitude (double altitude); // feet
87
88   static double getAGL ();      // feet
89
90
91                                 // Attitude
92   static double getHeading ();    // degrees
93   static void setHeading (double heading); // degrees
94
95   static double getHeadingMag (); // degrees
96
97   static double getPitch ();    // degrees
98   static void setPitch (double pitch); // degrees
99
100   static double getRoll ();     // degrees
101   static void setRoll (double roll); // degrees
102
103                                 // Engine
104   static double getRPM ();      // revolutions/minute
105   static void setRPM ( double rpm ); // revolutions/minute
106
107   static double getEGT ();      // [unit??]
108   static double getCHT ();      // [unit??]
109   static double getMP ();       // [unit??]
110
111                                 // Velocities
112   static double getAirspeed (); // knots
113   static void setAirspeed (double speed); // knots
114
115   static double getSideSlip (); // [unit??]
116
117   static double getVerticalSpeed (); // feet/second
118
119   static double getSpeedNorth (); // feet/second
120
121   static double getSpeedEast (); // feet/second
122
123   static double getSpeedDown (); // feet/second
124
125 //   static void setSpeedNorth (double speed);
126 //   static void setSpeedEast (double speed);
127 //   static void setSpeedDown (double speed);
128
129
130 #if 0
131                                 // Controls
132   static double getThrottle (); // 0.0:1.0
133   static void setThrottle (double throttle); // 0.0:1.0
134
135   static double getMixture ();  // 0.0:1.0
136   static void setMixture (double mixture); // 0.0:1.0
137
138   static double getPropAdvance (); // 0.0:1.0
139   static void setPropAdvance (double pitch); // 0.0:1.0
140
141   static double getFlaps ();    // 0.0:1.0
142   static void setFlaps (double flaps); // 0.0:1.0
143
144   static double getAileron ();  // -1.0:1.0
145   static void setAileron (double aileron); // -1.0:1.0
146
147   static double getRudder ();   // -1.0:1.0
148   static void setRudder (double rudder); // -1.0:1.0
149
150   static double getElevator (); // -1.0:1.0
151   static void setElevator (double elevator); // -1.0:1.0
152
153   static double getElevatorTrim (); // -1.0:1.0
154   static void setElevatorTrim (double trim); // -1.0:1.0
155
156   static double getBrakes ();   // 0.0:1.0
157   static void setBrakes (double brake); // 0.0:1.0
158
159   static double getLeftBrake (); // 0.0:1.0
160   static void setLeftBrake (double brake); // 0.0:1.0
161
162   static double getRightBrake (); // 0.0:1.0
163   static void setRightBrake (double brake); // 0.0:1.0
164
165   static double getCenterBrake (); // 0.0:1.0
166   static void setCenterBrake (double brake); // 0.0:1.0
167
168 #endif
169
170                                 // Autopilot
171   static bool getAPAltitudeLock ();
172   static void setAPAltitudeLock (bool lock);
173
174   static double getAPAltitude (); // feet
175   static void setAPAltitude (double altitude); // feet
176
177   static bool getAPHeadingLock ();
178   static void setAPHeadingLock (bool lock);
179
180   static double getAPHeading (); // degrees
181   static void setAPHeading (double heading); // degrees
182
183   static double getAPHeadingMag (); // degrees
184   static void setAPHeadingMag (double heading); // degrees
185
186   static bool getAPNAV1Lock ();
187   static void setAPNAV1Lock (bool lock);
188
189
190                                 // GPS
191   static string getTargetAirport ();
192   static void setTargetAirport (string targetAirport);
193
194   static bool getGPSLock ();
195   static void setGPSLock (bool lock);
196
197   static double getGPSTargetLatitude (); // degrees
198
199   static double getGPSTargetLongitude (); // degrees
200
201
202                                 // Weather
203   static double getVisibility ();// meters
204   static void setVisibility (double visiblity); // meters
205   static double getWindNorth (); // feet/second
206   static void setWindNorth (double speed); // feet/second
207   static double getWindEast (); // feet/second
208   static void setWindEast (double speed); // feet/second
209   static double getWindDown (); // feet/second
210   static void setWindDown (double speed); // feet/second
211
212                                 // View
213   static void setViewAxisLong (double axis);// -1.0:1.0
214   static void setViewAxisLat (double axis); // -1.0:1.0
215
216
217                                 // Time (this varies with time) huh, huh
218   static double getMagVar ();   // degrees
219   static double getMagDip ();   // degrees
220
221
222 private:
223                                 // Will cause a linking error if invoked.
224   FGBFI ();
225
226 };
227
228 // end of bfi.hxx