]> git.mxchange.org Git - flightgear.git/blob - src/Main/bfi.hxx
Win32 fixes.
[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 SG_USING_NAMESPACE(std);
31
32 // Uncomment the appropriate line to get the desired heading hold
33 // autopilot behavior
34
35 // #define DEFAULT_AP_HEADING_LOCK FGAutopilot::FG_TRUE_HEADING_LOCK
36 #define DEFAULT_AP_HEADING_LOCK FGAutopilot::FG_DG_HEADING_LOCK
37
38 /**
39  * Big Flat Interface
40  *
41  * This class implements the Facade design pattern (GOF p.185) to provide
42  * a single, (deceptively) simple flat interface for the FlightGear
43  * subsystems.  
44  *
45  * To help cut down on interdependence, subsystems should
46  * use the BFI whenever possible for inter-system communication.
47  *
48  * TODO:
49  * - add selectors to switch the current plane, throttle, brake, etc.
50  * - add more autopilot settings
51  */
52 class FGBFI
53 {
54 public:
55
56                                 // Initialize before first use.
57   static void init ();
58
59                                 // Reinit if necessary.
60   static void update ();
61
62                                 // Simulation
63   static int getFlightModel ();
64   static void setFlightModel (int flightModel);
65
66   static string getAircraft ();
67   static void setAircraft (string aircraft);
68
69   static string getAircraftDir ();
70   static void setAircraftDir (string aircraftDir);
71
72 //   static time_t getTimeGMT ();
73 //   static void setTimeGMT (time_t time);
74   static string getDateString ();// ISO 8601 subset
75   static void setDateString (string time_string); // ISO 8601 subset
76
77                                 // deprecated
78   static string getGMTString ();
79
80                                 // Position
81   static double getLatitude (); // degrees
82   static void setLatitude (double latitude); // degrees
83
84   static double getLongitude (); // degrees
85   static void setLongitude (double longitude); // degrees
86
87   static double getAltitude (); // feet
88   static void setAltitude (double altitude); // feet
89
90   static double getAGL ();      // feet
91
92
93                                 // Attitude
94   static double getHeading ();    // degrees
95   static void setHeading (double heading); // degrees
96
97   static double getHeadingMag (); // degrees
98
99   static double getPitch ();    // degrees
100   static void setPitch (double pitch); // degrees
101
102   static double getRoll ();     // degrees
103   static void setRoll (double roll); // degrees
104
105                                 // Engine
106   static double getRPM ();      // revolutions/minute
107   static void setRPM ( double rpm ); // revolutions/minute
108
109   static double getEGT ();      // deg Fahrenheit
110   static double getCHT ();      // deg Fahrenheit
111   static double getMP ();       // inches mercury
112   static double getFuelFlow (); // gals/hr
113
114                                  // Consumables
115   static double getTank1Fuel (); // gals
116   static void setTank1Fuel( double gals );
117   static double getTank2Fuel (); // gals
118   static void setTank2Fuel( double gals );
119
120                                 // Velocities
121   static double getAirspeed (); // knots
122   static void setAirspeed (double speed); // knots
123
124   static double getSideSlip (); // [unit??]
125
126   static double getVerticalSpeed (); // feet/second
127
128   static double getSpeedNorth (); // feet/second
129
130   static double getSpeedEast (); // feet/second
131
132   static double getSpeedDown (); // feet/second
133
134 //   static void setSpeedNorth (double speed);
135 //   static void setSpeedEast (double speed);
136 //   static void setSpeedDown (double speed);
137
138
139                                 // Autopilot
140   static bool getAPAltitudeLock ();
141   static void setAPAltitudeLock (bool lock);
142
143   static double getAPAltitude (); // feet
144   static void setAPAltitude (double altitude); // feet
145
146   static double getAPClimb (); // fpm
147   static void setAPClimb (double rate); // fpm
148
149   static bool getAPHeadingLock ();
150   static void setAPHeadingLock (bool lock);
151
152   static double getAPHeadingBug (); // degrees
153   static void setAPHeadingBug (double heading); // degrees
154
155   static bool getAPWingLeveler ();
156   static void setAPWingLeveler (bool lock);
157
158   static bool getAPNAV1Lock ();
159   static void setAPNAV1Lock (bool lock);
160
161   static bool getAPAutoThrottleLock ();
162   static void setAPAutoThrottleLock (bool lock);
163
164   static double getAPRudderControl ();
165   static void setAPRudderControl (double value);
166   static double getAPElevatorControl ();
167   static void setAPElevatorControl (double value);
168   static double getAPThrottleControl ();
169   static void setAPThrottleControl (double value);
170
171
172                                 // GPS
173   static string getTargetAirport ();
174   static void setTargetAirport (string targetAirport);
175
176   static bool getGPSLock ();
177   static void setGPSLock (bool lock);
178
179   static double getGPSTargetLatitude (); // degrees
180
181   static double getGPSTargetLongitude (); // degrees
182
183
184                                 // Weather
185   static double getVisibility ();// meters
186   static void setVisibility (double visiblity); // meters
187   static double getWindNorth (); // feet/second
188   static void setWindNorth (double speed); // feet/second
189   static double getWindEast (); // feet/second
190   static void setWindEast (double speed); // feet/second
191   static double getWindDown (); // feet/second
192   static void setWindDown (double speed); // feet/second
193
194                                 // View
195   static double getFOV ();      // degrees
196   static void setFOV (double fov); // degrees
197   static void setViewAxisLong (double axis);// -1.0:1.0
198   static void setViewAxisLat (double axis); // -1.0:1.0
199
200
201                                 // Time (this varies with time) huh, huh
202   static double getMagVar ();   // degrees
203   static double getMagDip ();   // degrees
204
205
206 private:
207                                 // Will cause a linking error if invoked.
208   FGBFI ();
209
210 };
211
212 // end of bfi.hxx