File no longer used.
This commit is contained in:
parent
f367e6d432
commit
f7c1a37611
4 changed files with 0 additions and 1663 deletions
1270
src/Main/bfi.cxx
1270
src/Main/bfi.cxx
File diff suppressed because it is too large
Load diff
212
src/Main/bfi.hxx
212
src/Main/bfi.hxx
|
@ -1,212 +0,0 @@
|
||||||
// bfi.hxx - Big Flat Interface
|
|
||||||
//
|
|
||||||
// Written by David Megginson, started February, 2000.
|
|
||||||
//
|
|
||||||
// Copyright (C) 2000 David Megginson - david@megginson.com
|
|
||||||
//
|
|
||||||
// THIS INTERFACE IS DEPRECATED; USE THE PROPERTY MANAGER INSTEAD.
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 2 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful, but
|
|
||||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
// General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
|
||||||
|
|
||||||
SG_USING_NAMESPACE(std);
|
|
||||||
|
|
||||||
// Uncomment the appropriate line to get the desired heading hold
|
|
||||||
// autopilot behavior
|
|
||||||
|
|
||||||
// #define DEFAULT_AP_HEADING_LOCK FGAutopilot::FG_TRUE_HEADING_LOCK
|
|
||||||
#define DEFAULT_AP_HEADING_LOCK FGAutopilot::FG_DG_HEADING_LOCK
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Big Flat Interface
|
|
||||||
*
|
|
||||||
* This class implements the Facade design pattern (GOF p.185) to provide
|
|
||||||
* a single, (deceptively) simple flat interface for the FlightGear
|
|
||||||
* subsystems.
|
|
||||||
*
|
|
||||||
* To help cut down on interdependence, subsystems should
|
|
||||||
* use the BFI whenever possible for inter-system communication.
|
|
||||||
*
|
|
||||||
* TODO:
|
|
||||||
* - add selectors to switch the current plane, throttle, brake, etc.
|
|
||||||
* - add more autopilot settings
|
|
||||||
*/
|
|
||||||
class FGBFI
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Initialize before first use.
|
|
||||||
static void init ();
|
|
||||||
|
|
||||||
// Reinit if necessary.
|
|
||||||
static void update ();
|
|
||||||
|
|
||||||
// Simulation
|
|
||||||
static string getAircraftDir ();
|
|
||||||
static void setAircraftDir (string aircraftDir);
|
|
||||||
|
|
||||||
static double getViewOffset ();
|
|
||||||
static void setViewOffset (double offset);
|
|
||||||
static double getGoalViewOffset ();
|
|
||||||
static void setGoalViewOffset (double offset);
|
|
||||||
|
|
||||||
static string getDateString ();// ISO 8601 subset
|
|
||||||
static void setDateString (string time_string); // ISO 8601 subset
|
|
||||||
|
|
||||||
// deprecated
|
|
||||||
static string getGMTString ();
|
|
||||||
|
|
||||||
// Position
|
|
||||||
static double getLatitude (); // degrees
|
|
||||||
static void setLatitude (double latitude); // degrees
|
|
||||||
|
|
||||||
static double getLongitude (); // degrees
|
|
||||||
static void setLongitude (double longitude); // degrees
|
|
||||||
|
|
||||||
static double getAltitude (); // feet
|
|
||||||
static void setAltitude (double altitude); // feet
|
|
||||||
|
|
||||||
static double getAGL (); // feet
|
|
||||||
|
|
||||||
|
|
||||||
// Attitude
|
|
||||||
static double getHeading (); // degrees
|
|
||||||
static void setHeading (double heading); // degrees
|
|
||||||
|
|
||||||
static double getHeadingMag (); // degrees
|
|
||||||
|
|
||||||
static double getPitch (); // degrees
|
|
||||||
static void setPitch (double pitch); // degrees
|
|
||||||
|
|
||||||
static double getRoll (); // degrees
|
|
||||||
static void setRoll (double roll); // degrees
|
|
||||||
|
|
||||||
// Engine
|
|
||||||
static double getRPM (); // revolutions/minute
|
|
||||||
static void setRPM ( double rpm ); // revolutions/minute
|
|
||||||
|
|
||||||
static double getEGT (); // deg Fahrenheit
|
|
||||||
static double getCHT (); // deg Fahrenheit
|
|
||||||
static double getMP (); // inches mercury
|
|
||||||
static double getFuelFlow (); // gals/hr
|
|
||||||
|
|
||||||
// Consumables
|
|
||||||
static double getTank1Fuel (); // gals
|
|
||||||
static void setTank1Fuel( double gals );
|
|
||||||
static double getTank2Fuel (); // gals
|
|
||||||
static void setTank2Fuel( double gals );
|
|
||||||
|
|
||||||
// Velocities
|
|
||||||
static double getAirspeed (); // knots
|
|
||||||
static void setAirspeed (double speed); // knots
|
|
||||||
|
|
||||||
static double getSideSlip (); // [unit??]
|
|
||||||
|
|
||||||
static double getVerticalSpeed (); // feet/second
|
|
||||||
|
|
||||||
static double getSpeedNorth (); // feet/second
|
|
||||||
|
|
||||||
static double getSpeedEast (); // feet/second
|
|
||||||
|
|
||||||
static double getSpeedDown (); // feet/second
|
|
||||||
|
|
||||||
// static void setSpeedNorth (double speed);
|
|
||||||
// static void setSpeedEast (double speed);
|
|
||||||
// static void setSpeedDown (double speed);
|
|
||||||
|
|
||||||
|
|
||||||
// Autopilot
|
|
||||||
static bool getAPAltitudeLock ();
|
|
||||||
static void setAPAltitudeLock (bool lock);
|
|
||||||
|
|
||||||
static bool getAPGSLock ();
|
|
||||||
static void setAPGSLock (bool lock);
|
|
||||||
|
|
||||||
static double getAPAltitude (); // feet
|
|
||||||
static void setAPAltitude (double altitude); // feet
|
|
||||||
|
|
||||||
static double getAPClimb (); // fpm
|
|
||||||
static void setAPClimb (double rate); // fpm
|
|
||||||
|
|
||||||
static bool getAPHeadingLock ();
|
|
||||||
static void setAPHeadingLock (bool lock);
|
|
||||||
|
|
||||||
static double getAPHeadingBug (); // degrees
|
|
||||||
static void setAPHeadingBug (double heading); // degrees
|
|
||||||
|
|
||||||
static bool getAPWingLeveler ();
|
|
||||||
static void setAPWingLeveler (bool lock);
|
|
||||||
|
|
||||||
static bool getAPNAV1Lock ();
|
|
||||||
static void setAPNAV1Lock (bool lock);
|
|
||||||
|
|
||||||
static bool getAPAutoThrottleLock ();
|
|
||||||
static void setAPAutoThrottleLock (bool lock);
|
|
||||||
|
|
||||||
static double getAPRudderControl ();
|
|
||||||
static void setAPRudderControl (double value);
|
|
||||||
static double getAPElevatorControl ();
|
|
||||||
static void setAPElevatorControl (double value);
|
|
||||||
static double getAPThrottleControl ();
|
|
||||||
static void setAPThrottleControl (double value);
|
|
||||||
|
|
||||||
|
|
||||||
// GPS
|
|
||||||
static string getTargetAirport ();
|
|
||||||
static void setTargetAirport (string targetAirport);
|
|
||||||
|
|
||||||
static bool getGPSLock ();
|
|
||||||
static void setGPSLock (bool lock);
|
|
||||||
|
|
||||||
static double getGPSTargetLatitude (); // degrees
|
|
||||||
|
|
||||||
static double getGPSTargetLongitude (); // degrees
|
|
||||||
|
|
||||||
|
|
||||||
// Weather
|
|
||||||
static double getVisibility ();// meters
|
|
||||||
static void setVisibility (double visiblity); // meters
|
|
||||||
static double getWindNorth (); // feet/second
|
|
||||||
static void setWindNorth (double speed); // feet/second
|
|
||||||
static double getWindEast (); // feet/second
|
|
||||||
static void setWindEast (double speed); // feet/second
|
|
||||||
static double getWindDown (); // feet/second
|
|
||||||
static void setWindDown (double speed); // feet/second
|
|
||||||
|
|
||||||
// View
|
|
||||||
static double getFOV (); // degrees
|
|
||||||
static void setFOV (double fov); // degrees
|
|
||||||
static void setViewAxisLong (double axis);// -1.0:1.0
|
|
||||||
static void setViewAxisLat (double axis); // -1.0:1.0
|
|
||||||
|
|
||||||
|
|
||||||
// Time (this varies with time) huh, huh
|
|
||||||
static double getMagVar (); // degrees
|
|
||||||
static double getMagDip (); // degrees
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Will cause a linking error if invoked.
|
|
||||||
FGBFI ();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// end of bfi.hxx
|
|
|
@ -1,127 +0,0 @@
|
||||||
// keyboard.cxx -- handle GLUT keyboard events
|
|
||||||
//
|
|
||||||
// Written by Curtis Olson, started May 1997.
|
|
||||||
//
|
|
||||||
// Copyright (C) 1997 - 1999 Curtis L. Olson - curt@flightgear.org
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 2 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful, but
|
|
||||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
// General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_WINDOWS_H
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <GL/glut.h>
|
|
||||||
|
|
||||||
#include <plib/pu.h>
|
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
|
||||||
|
|
||||||
#include <Input/input.hxx>
|
|
||||||
|
|
||||||
#include "keyboard.hxx"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct the modifiers.
|
|
||||||
*/
|
|
||||||
static inline int get_mods ()
|
|
||||||
{
|
|
||||||
int glut_modifiers = glutGetModifiers();
|
|
||||||
int modifiers = 0;
|
|
||||||
|
|
||||||
if (glut_modifiers & GLUT_ACTIVE_SHIFT)
|
|
||||||
modifiers |= FGInput::FG_MOD_SHIFT;
|
|
||||||
if (glut_modifiers & GLUT_ACTIVE_CTRL)
|
|
||||||
modifiers |= FGInput::FG_MOD_CTRL;
|
|
||||||
if (glut_modifiers & GLUT_ACTIVE_ALT)
|
|
||||||
modifiers |= FGInput::FG_MOD_ALT;
|
|
||||||
|
|
||||||
return modifiers;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Key-down event handler for Glut.
|
|
||||||
*
|
|
||||||
* <p>Pass the value on to the FGInput module unless PUI wants it.</p>
|
|
||||||
*
|
|
||||||
* @param k The integer value for the key pressed.
|
|
||||||
* @param x (unused)
|
|
||||||
* @param y (unused)
|
|
||||||
*/
|
|
||||||
void GLUTkey(unsigned char k, int x, int y)
|
|
||||||
{
|
|
||||||
// Give PUI a chance to grab it first.
|
|
||||||
if (!puKeyboard(k, PU_DOWN))
|
|
||||||
current_input.doKey(k, get_mods(), x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Key-up event handler for GLUT.
|
|
||||||
*
|
|
||||||
* <p>PUI doesn't use this, so always pass it to the input manager.</p>
|
|
||||||
*
|
|
||||||
* @param k The integer value for the key pressed.
|
|
||||||
* @param x (unused)
|
|
||||||
* @param y (unused)
|
|
||||||
*/
|
|
||||||
void GLUTkeyup(unsigned char k, int x, int y)
|
|
||||||
{
|
|
||||||
current_input.doKey(k, get_mods()|FGInput::FG_MOD_UP, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Special key-down handler for Glut.
|
|
||||||
*
|
|
||||||
* <p>Pass the value on to the FGInput module unless PUI wants it.
|
|
||||||
* The key value will have 256 added to it.</p>
|
|
||||||
*
|
|
||||||
* @param k The integer value for the key pressed (will have 256 added
|
|
||||||
* to it).
|
|
||||||
* @param x (unused)
|
|
||||||
* @param y (unused)
|
|
||||||
*/
|
|
||||||
void GLUTspecialkey(int k, int x, int y)
|
|
||||||
{
|
|
||||||
// Give PUI a chance to grab it first.
|
|
||||||
if (!puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN))
|
|
||||||
current_input.doKey(k + 256, get_mods(), x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Special key-up handler for Glut.
|
|
||||||
*
|
|
||||||
* @param k The integer value for the key pressed (will have 256 added
|
|
||||||
* to it).
|
|
||||||
* @param x (unused)
|
|
||||||
* @param y (unused)
|
|
||||||
*/
|
|
||||||
void GLUTspecialkeyup(int k, int x, int y)
|
|
||||||
{
|
|
||||||
current_input.doKey(k + 256, get_mods()|FGInput::FG_MOD_UP, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// end of keyboard.cxx
|
|
|
@ -1,54 +0,0 @@
|
||||||
// keyboard.hxx -- handle GLUT keyboard events
|
|
||||||
//
|
|
||||||
// Written by Curtis Olson, started May 1997.
|
|
||||||
//
|
|
||||||
// Copyright (C) 1997 - 1999 Curtis L. Olson - curt@flightgear.org
|
|
||||||
//
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 2 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful, but
|
|
||||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
// General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _KEYBOARD_HXX
|
|
||||||
#define _KEYBOARD_HXX
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __cplusplus
|
|
||||||
# error This library requires C++
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_WINDOWS_H
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <GL/glut.h>
|
|
||||||
#include <GL/gl.h>
|
|
||||||
|
|
||||||
|
|
||||||
// Handle keyboard events
|
|
||||||
void GLUTkey(unsigned char k, int x, int y);
|
|
||||||
void GLUTkeyup(unsigned char k, int x, int y);
|
|
||||||
void GLUTspecialkey(int k, int x, int y);
|
|
||||||
void GLUTspecialkeyup(int k, int x, int y);
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _KEYBOARD_HXX
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue