1 // bfi.hxx - Big Flat Interface
3 // Written by David Megginson, started February, 2000.
5 // Copyright (C) 2000 David Megginson - david@megginson.com
7 // THIS INTERFACE IS DEPRECATED; USE THE PROPERTY MANAGER INSTEAD.
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.
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.
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.
28 #include <simgear/compiler.h>
30 SG_USING_NAMESPACE(std);
32 // Uncomment the appropriate line to get the desired heading hold
35 // #define DEFAULT_AP_HEADING_LOCK FGAutopilot::FG_TRUE_HEADING_LOCK
36 #define DEFAULT_AP_HEADING_LOCK FGAutopilot::FG_DG_HEADING_LOCK
41 * This class implements the Facade design pattern (GOF p.185) to provide
42 * a single, (deceptively) simple flat interface for the FlightGear
45 * To help cut down on interdependence, subsystems should
46 * use the BFI whenever possible for inter-system communication.
49 * - add selectors to switch the current plane, throttle, brake, etc.
50 * - add more autopilot settings
56 // Initialize before first use.
59 // Reinit if necessary.
60 static void update ();
63 static int getFlightModel ();
64 static void setFlightModel (int flightModel);
66 static string getAircraft ();
67 static void setAircraft (string aircraft);
69 static string getAircraftDir ();
70 static void setAircraftDir (string aircraftDir);
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
78 static string getGMTString ();
81 static double getLatitude (); // degrees
82 static void setLatitude (double latitude); // degrees
84 static double getLongitude (); // degrees
85 static void setLongitude (double longitude); // degrees
87 static double getAltitude (); // feet
88 static void setAltitude (double altitude); // feet
90 static double getAGL (); // feet
94 static double getHeading (); // degrees
95 static void setHeading (double heading); // degrees
97 static double getHeadingMag (); // degrees
99 static double getPitch (); // degrees
100 static void setPitch (double pitch); // degrees
102 static double getRoll (); // degrees
103 static void setRoll (double roll); // degrees
106 static double getRPM (); // revolutions/minute
107 static void setRPM ( double rpm ); // revolutions/minute
109 static double getEGT (); // deg Fahrenheit
110 static double getCHT (); // deg Fahrenheit
111 static double getMP (); // inches mercury
112 static double getFuelFlow (); // gals/hr
115 static double getTank1Fuel (); // gals
116 static void setTank1Fuel( double gals );
117 static double getTank2Fuel (); // gals
118 static void setTank2Fuel( double gals );
121 static double getAirspeed (); // knots
122 static void setAirspeed (double speed); // knots
124 static double getSideSlip (); // [unit??]
126 static double getVerticalSpeed (); // feet/second
128 static double getSpeedNorth (); // feet/second
130 static double getSpeedEast (); // feet/second
132 static double getSpeedDown (); // feet/second
134 // static void setSpeedNorth (double speed);
135 // static void setSpeedEast (double speed);
136 // static void setSpeedDown (double speed);
140 static bool getAPAltitudeLock ();
141 static void setAPAltitudeLock (bool lock);
143 static double getAPAltitude (); // feet
144 static void setAPAltitude (double altitude); // feet
146 static double getAPClimb (); // fpm
147 static void setAPClimb (double rate); // fpm
149 static bool getAPHeadingLock ();
150 static void setAPHeadingLock (bool lock);
152 static double getAPHeadingBug (); // degrees
153 static void setAPHeadingBug (double heading); // degrees
155 static bool getAPWingLeveler ();
156 static void setAPWingLeveler (bool lock);
158 static bool getAPNAV1Lock ();
159 static void setAPNAV1Lock (bool lock);
161 static bool getAPAutoThrottleLock ();
162 static void setAPAutoThrottleLock (bool lock);
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);
173 static string getTargetAirport ();
174 static void setTargetAirport (string targetAirport);
176 static bool getGPSLock ();
177 static void setGPSLock (bool lock);
179 static double getGPSTargetLatitude (); // degrees
181 static double getGPSTargetLongitude (); // degrees
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
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
201 // Time (this varies with time) huh, huh
202 static double getMagVar (); // degrees
203 static double getMagDip (); // degrees
207 // Will cause a linking error if invoked.