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 string getAircraftDir ();
64 static void setAircraftDir (string aircraftDir);
66 static double getViewOffset ();
67 static void setViewOffset (double offset);
68 static double getGoalViewOffset ();
69 static void setGoalViewOffset (double offset);
71 static string getDateString ();// ISO 8601 subset
72 static void setDateString (string time_string); // ISO 8601 subset
75 static string getGMTString ();
78 static double getLatitude (); // degrees
79 static void setLatitude (double latitude); // degrees
81 static double getLongitude (); // degrees
82 static void setLongitude (double longitude); // degrees
84 static double getAltitude (); // feet
85 static void setAltitude (double altitude); // feet
87 static double getAGL (); // feet
91 static double getHeading (); // degrees
92 static void setHeading (double heading); // degrees
94 static double getHeadingMag (); // degrees
96 static double getPitch (); // degrees
97 static void setPitch (double pitch); // degrees
99 static double getRoll (); // degrees
100 static void setRoll (double roll); // degrees
103 static double getRPM (); // revolutions/minute
104 static void setRPM ( double rpm ); // revolutions/minute
106 static double getEGT (); // deg Fahrenheit
107 static double getCHT (); // deg Fahrenheit
108 static double getMP (); // inches mercury
109 static double getFuelFlow (); // gals/hr
112 static double getTank1Fuel (); // gals
113 static void setTank1Fuel( double gals );
114 static double getTank2Fuel (); // gals
115 static void setTank2Fuel( double gals );
118 static double getAirspeed (); // knots
119 static void setAirspeed (double speed); // knots
121 static double getSideSlip (); // [unit??]
123 static double getVerticalSpeed (); // feet/second
125 static double getSpeedNorth (); // feet/second
127 static double getSpeedEast (); // feet/second
129 static double getSpeedDown (); // feet/second
131 // static void setSpeedNorth (double speed);
132 // static void setSpeedEast (double speed);
133 // static void setSpeedDown (double speed);
137 static bool getAPAltitudeLock ();
138 static void setAPAltitudeLock (bool lock);
140 static bool getAPGSLock ();
141 static void setAPGSLock (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.