1998-04-24 00:49:17 +00:00
|
|
|
// options.hxx -- class to handle command line options
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started April 1998.
|
|
|
|
//
|
|
|
|
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
|
|
|
|
//
|
|
|
|
// 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 _OPTIONS_HXX
|
|
|
|
#define _OPTIONS_HXX
|
|
|
|
|
|
|
|
|
1998-09-08 21:40:08 +00:00
|
|
|
#ifndef __cplusplus
|
1998-04-24 00:49:17 +00:00
|
|
|
# error This library requires C++
|
|
|
|
#endif
|
|
|
|
|
1998-09-08 21:40:08 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#include <simgear/compiler.h>
|
1999-01-19 20:57:00 +00:00
|
|
|
|
1998-09-17 18:35:30 +00:00
|
|
|
#ifdef HAVE_WINDOWS_H
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <GL/glut.h>
|
2000-02-16 23:01:03 +00:00
|
|
|
#include <simgear/xgl/xgl.h>
|
1998-09-17 18:35:30 +00:00
|
|
|
|
1999-03-11 23:09:26 +00:00
|
|
|
#if defined(FX) && defined(XMESA)
|
|
|
|
extern bool global_fullscreen;
|
|
|
|
#endif
|
|
|
|
|
2000-09-26 23:39:29 +00:00
|
|
|
#include <simgear/math/sg_types.hxx>
|
2000-07-06 22:13:24 +00:00
|
|
|
#include <simgear/timing/sg_time.hxx>
|
1999-11-19 02:10:24 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
#include <FDM/flight.hxx>
|
|
|
|
|
|
|
|
#include "globals.hxx"
|
|
|
|
|
1999-01-19 20:57:00 +00:00
|
|
|
#include STL_STRING
|
1999-02-02 20:13:29 +00:00
|
|
|
#include <vector>
|
1999-02-26 22:08:34 +00:00
|
|
|
|
1999-02-02 20:13:29 +00:00
|
|
|
FG_USING_STD(vector);
|
|
|
|
FG_USING_STD(string);
|
1998-11-16 13:59:58 +00:00
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#define NEW_DEFAULT_MODEL_HZ 120
|
|
|
|
|
|
|
|
|
2000-10-19 21:24:43 +00:00
|
|
|
class FGOptions {
|
1998-10-25 14:08:37 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
public:
|
1998-10-25 14:08:37 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FG_OPTIONS_OK = 0,
|
|
|
|
FG_OPTIONS_HELP = 1,
|
|
|
|
FG_OPTIONS_ERROR = 2
|
|
|
|
};
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-11-02 23:04:02 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FG_UNITS_FEET = 0,
|
|
|
|
FG_UNITS_METERS = 1
|
|
|
|
};
|
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
enum fgFogKind
|
|
|
|
{
|
|
|
|
FG_FOG_DISABLED = 0,
|
|
|
|
FG_FOG_FASTEST = 1,
|
|
|
|
FG_FOG_NICEST = 2
|
|
|
|
};
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-11-23 21:48:09 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FG_RADIUS_MIN = 1,
|
|
|
|
FG_RADIUS_MAX = 4
|
|
|
|
};
|
1998-08-27 17:01:55 +00:00
|
|
|
|
1999-08-10 03:44:47 +00:00
|
|
|
enum fgControlMode
|
|
|
|
{
|
|
|
|
FG_JOYSTICK = 0,
|
|
|
|
FG_KEYBOARD = 1,
|
|
|
|
FG_MOUSE = 2
|
|
|
|
};
|
|
|
|
|
1999-09-09 00:16:28 +00:00
|
|
|
enum fgViewMode
|
|
|
|
{
|
1999-10-15 13:55:44 +00:00
|
|
|
FG_VIEW_PILOT = 0, // Pilot perspective
|
|
|
|
FG_VIEW_FOLLOW = 1, // Following in the "foot steps" so to speak
|
|
|
|
FG_VIEW_CHASE = 2, // Chase
|
|
|
|
FG_VIEW_CIRCLING = 3, // Circling
|
|
|
|
FG_VIEW_SATELLITE = 4, // From high above
|
|
|
|
FG_VIEW_ANCHOR = 5, // Drop an anchor and watch from there
|
|
|
|
FG_VIEW_TOWER = 6, // From nearest tower?
|
|
|
|
FG_VIEW_SPOTTER = 7 // Fron a ground spotter
|
1999-09-09 00:16:28 +00:00
|
|
|
};
|
|
|
|
|
1999-10-06 20:58:57 +00:00
|
|
|
enum fgAutoCoordMode
|
|
|
|
{
|
|
|
|
FG_AUTO_COORD_NOT_SPECIFIED = 0,
|
|
|
|
FG_AUTO_COORD_DISABLED = 1,
|
|
|
|
FG_AUTO_COORD_ENABLED = 2
|
|
|
|
};
|
|
|
|
|
2000-07-07 21:52:45 +00:00
|
|
|
enum fgTimingOffsetType {
|
|
|
|
FG_TIME_SYS_OFFSET = 0,
|
|
|
|
FG_TIME_GMT_OFFSET = 1,
|
|
|
|
FG_TIME_LAT_OFFSET = 2,
|
|
|
|
FG_TIME_SYS_ABSOLUTE = 3,
|
|
|
|
FG_TIME_GMT_ABSOLUTE = 4,
|
|
|
|
FG_TIME_LAT_ABSOLUTE = 5
|
|
|
|
};
|
I tested:
LaRCsim c172 on-ground and in-air starts, reset: all work
UIUC Cessna172 on-ground and in-air starts work as expected, reset
results in an aircraft that is upside down but does not crash FG. I
don't know what it was like before, so it may well be no change.
JSBSim c172 and X15 in-air starts work fine, resets now work (and are
trimmed), on-ground starts do not -- the c172 ends up on its back. I
suspect this is no worse than before.
I did not test:
Balloon (the weather code returns nan's for the atmosphere data --this
is in the weather module and apparently is a linux only bug)
ADA (don't know how)
MagicCarpet (needs work yet)
External (don't know how)
known to be broken:
LaRCsim c172 on-ground starts with a negative terrain altitude (this
happens at KPAO when the scenery is not present). The FDM inits to
about 50 feet AGL and the model falls to the ground. It does stay
upright, however, and seems to be fine once it settles out, FWIW.
To do:
--implement set_Model on the bus
--bring Christian's weather data into JSBSim
-- add default method to bus for updating things like the sin and cos of
latitude (for Balloon, MagicCarpet)
-- lots of cleanup
The files:
src/FDM/flight.cxx
src/FDM/flight.hxx
-- all data members now declared protected instead of private.
-- eliminated all but a small set of 'setters', no change to getters.
-- that small set is declared virtual, the default implementation
provided preserves the old behavior
-- all of the vector data members are now initialized.
-- added busdump() method -- FG_LOG's all the bus data when called,
useful for diagnostics.
src/FDM/ADA.cxx
-- bus data members now directly assigned to
src/FDM/Balloon.cxx
-- bus data members now directly assigned to
-- changed V_equiv_kts to V_calibrated_kts
src/FDM/JSBSim.cxx
src/FDM/JSBSim.hxx
-- bus data members now directly assigned to
-- implemented the FGInterface virtual setters with JSBSim specific
logic
-- changed the static FDMExec to a dynamic fdmex (needed so that the
JSBSim object can be deleted when a model change is called for)
-- implemented constructor and destructor, moved some of the logic
formerly in init() to constructor
-- added logic to bring up FGEngInterface objects and set the RPM and
throttle values.
src/FDM/LaRCsim.cxx
src/FDM/LaRCsim.hxx
-- bus data members now directly assigned to
-- implemented the FGInterface virtual setters with LaRCsim specific
logic, uses LaRCsimIC
-- implemented constructor and destructor, moved some of the logic
formerly in init() to constructor
-- moved default inertias to here from fg_init.cxx
-- eliminated the climb rate calculation. The equivalent, climb_rate =
-1*vdown, is now in copy_from_LaRCsim().
src/FDM/LaRCsimIC.cxx
src/FDM/LaRCsimIC.hxx
-- similar to FGInitialCondition, this class has all the logic needed to
turn data like Vc and Mach into the more fundamental quantities LaRCsim
needs to initialize.
-- put it in src/FDM since it is a class
src/FDM/MagicCarpet.cxx
-- bus data members now directly assigned to
src/FDM/Makefile.am
-- adds LaRCsimIC.hxx and cxx
src/FDM/JSBSim/FGAtmosphere.h
src/FDM/JSBSim/FGDefs.h
src/FDM/JSBSim/FGInitialCondition.cpp
src/FDM/JSBSim/FGInitialCondition.h
src/FDM/JSBSim/JSBSim.cpp
-- changes to accomodate the new bus
src/FDM/LaRCsim/atmos_62.h
src/FDM/LaRCsim/ls_geodesy.h
-- surrounded prototypes with #ifdef __cplusplus ... #endif , functions
here are needed in LaRCsimIC
src/FDM/LaRCsim/c172_main.c
src/FDM/LaRCsim/cherokee_aero.c
src/FDM/LaRCsim/ls_aux.c
src/FDM/LaRCsim/ls_constants.h
src/FDM/LaRCsim/ls_geodesy.c
src/FDM/LaRCsim/ls_geodesy.h
src/FDM/LaRCsim/ls_step.c
src/FDM/UIUCModel/uiuc_betaprobe.cpp
-- changed PI to LS_PI, eliminates preprocessor naming conflict with
weather module
src/FDM/LaRCsim/ls_interface.c
src/FDM/LaRCsim/ls_interface.h
-- added function ls_set_model_dt()
src/Main/bfi.cxx
-- eliminated calls that set the NED speeds to body components. They
are no longer needed and confuse the new bus.
src/Main/fg_init.cxx
-- eliminated calls that just brought the bus data up-to-date (e.g.
set_sin_cos_latitude). or set default values. The bus now handles the
defaults and updates itself when the setters are called (for LaRCsim and
JSBSim). A default method for doing this needs to be added to the bus.
-- added fgVelocityInit() to set the speed the user asked for. Both
JSBSim and LaRCsim can now be initialized using any of:
vc,mach, NED components, UVW components.
src/Main/main.cxx
--eliminated call to fgFDMSetGroundElevation, this data is now 'pulled'
onto the bus every update()
src/Main/options.cxx
src/Main/options.hxx
-- added enum to keep track of the speed requested by the user
-- eliminated calls to set NED velocity properties to body speeds, they
are no longer needed.
-- added options for the NED components.
src/Network/garmin.cxx
src/Network/nmea.cxx
--eliminated calls that just brought the bus data up-to-date (e.g.
set_sin_cos_latitude). The bus now updates itself when the setters are
called (for LaRCsim and JSBSim). A default method for doing this needs
to be added to the bus.
-- changed set_V_equiv_kts to set_V_calibrated_kts. set_V_equiv_kts no
longer exists ( get_V_equiv_kts still does, though)
src/WeatherCM/FGLocalWeatherDatabase.cpp
-- commented out the code to put the weather data on the bus, a
different scheme for this is needed.
2000-10-24 00:34:50 +00:00
|
|
|
|
|
|
|
enum fgSpeedSet {
|
|
|
|
FG_VC = 1,
|
|
|
|
FG_MACH = 2,
|
|
|
|
FG_VTUVW = 3,
|
|
|
|
FG_VTNED = 4
|
|
|
|
};
|
2000-07-07 21:52:45 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
private:
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-05-13 18:29:56 +00:00
|
|
|
// The flight gear "root" directory
|
2001-01-12 15:37:40 +00:00
|
|
|
// string fg_root;
|
1998-04-24 00:49:17 +00:00
|
|
|
|
2000-07-14 16:57:55 +00:00
|
|
|
// The scenery "root" directory
|
2001-01-12 15:37:40 +00:00
|
|
|
// string fg_scenery;
|
2000-07-14 16:57:55 +00:00
|
|
|
|
1998-07-30 23:48:24 +00:00
|
|
|
// Starting position and orientation
|
2001-01-12 15:37:40 +00:00
|
|
|
|
|
|
|
// These are now all SGValue pointers, but they won't stay
|
|
|
|
// that way forever -- it's just to ease the transition to the
|
|
|
|
// property manager. Gradually, references to the methods that
|
|
|
|
// use these variables will be culled out, and the variables
|
|
|
|
// and methods will be removed.
|
|
|
|
|
|
|
|
SGValue * airport_id; // ID of initial starting airport
|
|
|
|
SGValue * lon; // starting longitude in degrees (west = -)
|
|
|
|
SGValue * lat; // starting latitude in degrees (south = -)
|
|
|
|
SGValue * altitude; // starting altitude in meters
|
|
|
|
SGValue * heading; // heading (yaw) angle in degress (Psi)
|
|
|
|
SGValue * roll; // roll angle in degrees (Phi)
|
|
|
|
SGValue * pitch; // pitch angle in degrees (Theta)
|
|
|
|
SGValue * speedset; // which speed does the user want
|
|
|
|
SGValue * uBody; // Body axis X velocity (U)
|
|
|
|
SGValue * vBody; // Body axis Y velocity (V)
|
|
|
|
SGValue * wBody; // Body axis Z velocity (W)
|
|
|
|
SGValue * vNorth; // North component of vt
|
|
|
|
SGValue * vEast; // East component of vt
|
|
|
|
SGValue * vDown; // Down component of vt
|
|
|
|
SGValue * vkcas; // Calibrated airspeed, knots
|
|
|
|
SGValue * mach; // Mach number
|
1998-04-25 15:11:10 +00:00
|
|
|
|
1998-07-06 21:34:17 +00:00
|
|
|
// Miscellaneous
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * game_mode; // Game mode enabled/disabled
|
|
|
|
SGValue * splash_screen; // show splash screen
|
|
|
|
SGValue * intro_music; // play introductory music
|
|
|
|
SGValue * mouse_pointer; // show mouse pointer
|
|
|
|
SGValue * control_mode; // primary control mode
|
|
|
|
SGValue * auto_coordination; // enable auto coordination
|
1998-07-06 21:34:17 +00:00
|
|
|
|
1998-04-30 12:34:17 +00:00
|
|
|
// Features
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * hud_status; // HUD on/off
|
|
|
|
SGValue * panel_status; // Panel on/off
|
|
|
|
SGValue * sound; // play sound effects
|
|
|
|
SGValue * anti_alias_hud;
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-07-30 23:48:24 +00:00
|
|
|
// Flight Model options
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * flight_model; // Core flight model code
|
|
|
|
SGValue * aircraft; // Aircraft to model
|
|
|
|
SGValue * model_hz; // number of FDM iterations per second
|
|
|
|
SGValue * speed_up; // Sim mechanics run this much faster than
|
|
|
|
// normal speed
|
|
|
|
SGValue * trim; // use the FDM trimming routine during init
|
|
|
|
// <0 --notrim set, 0 no trim, >0 trim
|
|
|
|
// default behavior is to enable trimming for
|
|
|
|
// jsbsim and disable for all other fdm's
|
1998-07-30 23:48:24 +00:00
|
|
|
|
1998-04-30 12:34:17 +00:00
|
|
|
// Rendering options
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * fog; // Fog nicest/fastest/disabled
|
|
|
|
SGValue * clouds; // Enable clouds
|
|
|
|
SGValue * clouds_asl; // Cloud layer height above sea level
|
|
|
|
SGValue * fullscreen; // Full screen mode enabled/disabled
|
|
|
|
SGValue * shading; // shading method, 0 = Flat, 1 = Smooth
|
|
|
|
SGValue * skyblend; // Blend sky to haze (using polygons) or
|
|
|
|
// just clear
|
|
|
|
SGValue * textures; // Textures enabled/disabled
|
|
|
|
SGValue * wireframe; // Wireframe mode enabled/disabled
|
|
|
|
SGValue * xsize; // window size derived from geometry string
|
|
|
|
SGValue * ysize;
|
|
|
|
SGValue * bpp; // bits per pixel
|
|
|
|
SGValue * view_mode; // view mode
|
|
|
|
SGValue * default_view_offset; // default forward view offset (for use by
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
// multi-display configuration
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * visibility; // visibilty in meters
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-08-24 20:11:12 +00:00
|
|
|
// HUD options
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * units; // feet or meters
|
|
|
|
SGValue * tris_or_culled;
|
1998-08-24 20:11:12 +00:00
|
|
|
|
1998-04-30 12:34:17 +00:00
|
|
|
// Time options
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * time_offset; // Use this value to change time.
|
|
|
|
SGValue * time_offset_type; // Will be set to one of the
|
2000-07-07 21:52:45 +00:00
|
|
|
// FG_TIME_* enums, to deterine how
|
2000-07-05 02:39:30 +00:00
|
|
|
// time_offset should be used
|
1998-04-28 01:20:20 +00:00
|
|
|
|
1998-11-16 13:59:58 +00:00
|
|
|
// Serial port configuration strings
|
2001-01-12 15:37:40 +00:00
|
|
|
// string_list channel_options_list;
|
1999-06-22 21:24:31 +00:00
|
|
|
|
|
|
|
// Network options
|
2001-01-12 15:37:40 +00:00
|
|
|
SGValue * network_olk;
|
|
|
|
SGValue * net_id;
|
|
|
|
|
1998-07-13 21:00:09 +00:00
|
|
|
public:
|
|
|
|
|
2000-10-19 21:24:43 +00:00
|
|
|
FGOptions();
|
|
|
|
~FGOptions();
|
1998-04-24 00:49:17 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
void init ();
|
|
|
|
|
|
|
|
void set_default_props ();
|
|
|
|
|
1998-05-13 18:29:56 +00:00
|
|
|
// Parse a single option
|
1998-08-27 17:01:55 +00:00
|
|
|
int parse_option( const string& arg );
|
1998-05-13 18:29:56 +00:00
|
|
|
|
2000-10-04 22:52:34 +00:00
|
|
|
// Scan the command line options for an fg_root definition and set
|
|
|
|
// just that.
|
|
|
|
int scan_command_line_for_root( int argc, char **argv );
|
|
|
|
|
|
|
|
// Scan the config file for an fg_root definition and set just
|
|
|
|
// that.
|
|
|
|
int scan_config_file_for_root( const string& path );
|
|
|
|
|
1998-05-13 18:29:56 +00:00
|
|
|
// Parse the command line options
|
|
|
|
int parse_command_line( int argc, char **argv );
|
|
|
|
|
1998-04-24 00:49:17 +00:00
|
|
|
// Parse the command line options
|
1998-08-27 17:01:55 +00:00
|
|
|
int parse_config_file( const string& path );
|
1998-04-24 00:49:17 +00:00
|
|
|
|
|
|
|
// Print usage message
|
|
|
|
void usage ( void );
|
|
|
|
|
1998-07-13 21:00:09 +00:00
|
|
|
// Query functions
|
2001-01-12 15:37:40 +00:00
|
|
|
string get_fg_root() const;
|
|
|
|
string get_fg_scenery() const;
|
|
|
|
inline string get_airport_id() const {
|
|
|
|
return airport_id->getStringValue();
|
|
|
|
}
|
|
|
|
inline double get_lon() const { return lon->getDoubleValue(); }
|
|
|
|
inline double get_lat() const { return lat->getDoubleValue(); }
|
|
|
|
inline double get_altitude() const { return altitude->getDoubleValue(); }
|
|
|
|
inline double get_heading() const { return heading->getDoubleValue(); }
|
|
|
|
inline double get_roll() const { return roll->getDoubleValue(); }
|
|
|
|
inline double get_pitch() const { return pitch->getDoubleValue(); }
|
|
|
|
inline fgSpeedSet get_speedset() const {
|
|
|
|
const string &s = speedset->getStringValue();
|
|
|
|
if (s == "UVW" || s == "uvw")
|
|
|
|
return FG_VTUVW;
|
|
|
|
else if (s == "NED" || s == "ned")
|
|
|
|
return FG_VTNED;
|
|
|
|
else if (s == "knots" || s == "KNOTS")
|
|
|
|
return FG_VC;
|
|
|
|
else if (s == "mach" || s == "MACH")
|
|
|
|
return FG_MACH;
|
|
|
|
else
|
|
|
|
return FG_VC;
|
|
|
|
}
|
|
|
|
inline double get_uBody() const {return uBody->getDoubleValue();}
|
|
|
|
inline double get_vBody() const {return vBody->getDoubleValue();}
|
|
|
|
inline double get_wBody() const {return wBody->getDoubleValue();}
|
|
|
|
inline double get_vNorth() const {return vNorth->getDoubleValue();}
|
|
|
|
inline double get_vEast() const {return vEast->getDoubleValue();}
|
|
|
|
inline double get_vDown() const {return vDown->getDoubleValue();}
|
|
|
|
inline double get_vc() const {return vkcas->getDoubleValue();}
|
|
|
|
inline double get_mach() const {return mach->getDoubleValue();}
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
inline bool get_game_mode() const { return game_mode->getBoolValue(); }
|
|
|
|
inline bool get_splash_screen() const {
|
|
|
|
return splash_screen->getBoolValue();
|
|
|
|
}
|
|
|
|
inline bool get_intro_music() const {
|
|
|
|
return intro_music->getBoolValue();
|
|
|
|
}
|
|
|
|
inline int get_mouse_pointer() const {
|
|
|
|
return mouse_pointer->getBoolValue();
|
|
|
|
}
|
|
|
|
inline bool get_anti_alias_hud() const {
|
|
|
|
return anti_alias_hud->getBoolValue();
|
|
|
|
}
|
|
|
|
inline fgControlMode get_control_mode() const {
|
|
|
|
const string &s = control_mode->getStringValue();
|
|
|
|
if (s == "joystick")
|
|
|
|
return FG_JOYSTICK;
|
|
|
|
else if (s == "keyboard")
|
|
|
|
return FG_KEYBOARD;
|
|
|
|
else if (s == "mouse")
|
|
|
|
return FG_MOUSE;
|
|
|
|
else
|
|
|
|
return FG_JOYSTICK;
|
|
|
|
}
|
|
|
|
inline void set_control_mode( fgControlMode mode ) {
|
|
|
|
if(mode == FG_JOYSTICK)
|
|
|
|
control_mode->setStringValue("joystick");
|
|
|
|
else if (mode == FG_KEYBOARD)
|
|
|
|
control_mode->setStringValue("keyboard");
|
|
|
|
else if (mode == FG_MOUSE)
|
|
|
|
control_mode->setStringValue("mouse");
|
|
|
|
else
|
|
|
|
control_mode->setStringValue("joystick");
|
|
|
|
}
|
1999-10-06 20:58:57 +00:00
|
|
|
inline fgAutoCoordMode get_auto_coordination() const {
|
2001-01-12 15:37:40 +00:00
|
|
|
if (auto_coordination->getBoolValue())
|
|
|
|
return FG_AUTO_COORD_ENABLED;
|
|
|
|
else
|
|
|
|
return FG_AUTO_COORD_DISABLED;
|
1999-10-06 20:58:57 +00:00
|
|
|
}
|
|
|
|
inline void set_auto_coordination(fgAutoCoordMode m) {
|
2001-01-12 15:37:40 +00:00
|
|
|
if (m == FG_AUTO_COORD_ENABLED)
|
|
|
|
auto_coordination->setBoolValue(true);
|
|
|
|
else if (m == FG_AUTO_COORD_DISABLED)
|
|
|
|
auto_coordination->setBoolValue(false);
|
|
|
|
}
|
|
|
|
inline bool get_hud_status() const { return hud_status->getBoolValue(); }
|
|
|
|
inline bool get_panel_status() const {
|
|
|
|
return panel_status->getBoolValue();
|
|
|
|
}
|
|
|
|
inline bool get_sound() const { return sound->getBoolValue(); }
|
|
|
|
inline int get_flight_model() const {
|
|
|
|
return parse_fdm(flight_model->getStringValue());
|
1999-10-06 20:58:57 +00:00
|
|
|
}
|
2001-01-12 15:37:40 +00:00
|
|
|
inline string get_aircraft() const { return aircraft->getStringValue(); }
|
|
|
|
inline int get_model_hz() const { return model_hz->getIntValue(); }
|
|
|
|
inline int get_speed_up() const { return speed_up->getIntValue(); }
|
|
|
|
inline void set_speed_up( int speed ) { speed_up->setIntValue(speed); }
|
|
|
|
inline int get_trim_mode(void) { return trim->getIntValue(); }
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
inline bool fog_enabled() const {
|
|
|
|
return fog->getStringValue() != "disabled";
|
|
|
|
}
|
|
|
|
inline fgFogKind get_fog() const {
|
|
|
|
const string &s = fog->getStringValue();
|
|
|
|
if (s == "disabled")
|
|
|
|
return FG_FOG_DISABLED;
|
|
|
|
else if (s == "fastest")
|
|
|
|
return FG_FOG_FASTEST;
|
|
|
|
else if (s == "nicest")
|
|
|
|
return FG_FOG_NICEST;
|
|
|
|
else
|
|
|
|
return FG_FOG_DISABLED;
|
|
|
|
}
|
|
|
|
inline bool get_clouds() const { return clouds->getBoolValue(); }
|
|
|
|
inline double get_clouds_asl() const {
|
|
|
|
return clouds_asl->getDoubleValue() * FEET_TO_METER;
|
|
|
|
}
|
|
|
|
inline bool get_fullscreen() const { return fullscreen->getBoolValue(); }
|
|
|
|
inline int get_shading() const { return shading->getIntValue(); }
|
|
|
|
inline bool get_skyblend() const { return skyblend->getBoolValue(); }
|
|
|
|
inline bool get_textures() const { return textures->getBoolValue(); }
|
|
|
|
inline bool get_wireframe() const { return wireframe->getBoolValue(); }
|
|
|
|
inline int get_xsize() const { return xsize->getIntValue(); }
|
|
|
|
inline int get_ysize() const { return ysize->getIntValue(); }
|
|
|
|
inline int get_bpp() const { return bpp->getIntValue(); }
|
|
|
|
inline fgViewMode get_view_mode() const {
|
|
|
|
return (fgViewMode)(view_mode->getIntValue()); // FIXME!!
|
|
|
|
}
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
inline double get_default_view_offset() const {
|
2001-01-12 15:37:40 +00:00
|
|
|
return default_view_offset->getDoubleValue();;
|
|
|
|
}
|
|
|
|
inline double get_default_visibility() const {
|
|
|
|
return visibility->getDoubleValue();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
inline int get_units() const {
|
|
|
|
if (units->getStringValue() == "meters")
|
|
|
|
return FG_UNITS_METERS;
|
|
|
|
else
|
|
|
|
return FG_UNITS_FEET;
|
|
|
|
}
|
|
|
|
inline int get_tris_or_culled() const {
|
|
|
|
if (tris_or_culled->getStringValue() == "tris")
|
|
|
|
return 1; // FIXME: check this!!!
|
|
|
|
else
|
|
|
|
return 2;
|
|
|
|
}
|
1998-08-24 20:11:12 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
inline int get_time_offset() const { return time_offset->getIntValue(); }
|
2000-07-07 21:52:45 +00:00
|
|
|
inline fgTimingOffsetType get_time_offset_type() const {
|
2001-01-12 15:37:40 +00:00
|
|
|
const string &s = time_offset_type->getStringValue();
|
|
|
|
if (s == "system-offset")
|
|
|
|
return FG_TIME_SYS_OFFSET;
|
|
|
|
else if (s == "gmt-offset")
|
|
|
|
return FG_TIME_GMT_OFFSET;
|
|
|
|
else if (s == "latitude-offset")
|
|
|
|
return FG_TIME_LAT_OFFSET;
|
|
|
|
else if (s == "system")
|
|
|
|
return FG_TIME_SYS_ABSOLUTE;
|
|
|
|
else if (s == "gmt")
|
|
|
|
return FG_TIME_GMT_ABSOLUTE;
|
|
|
|
else if (s == "latitude")
|
|
|
|
return FG_TIME_LAT_ABSOLUTE;
|
|
|
|
else
|
|
|
|
return FG_TIME_SYS_OFFSET;
|
2000-07-05 02:39:30 +00:00
|
|
|
};
|
1998-11-16 13:59:58 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
string_list get_channel_options_list () const;
|
2000-02-28 04:16:12 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
inline bool get_network_olk() const { return network_olk->getBoolValue(); }
|
|
|
|
inline string get_net_id() const { return net_id->getStringValue(); }
|
1998-11-16 13:59:58 +00:00
|
|
|
|
1998-08-24 20:11:12 +00:00
|
|
|
// Update functions
|
2001-01-12 15:37:40 +00:00
|
|
|
inline void set_airport_id( const string id ) {
|
|
|
|
airport_id->setStringValue(id);
|
1998-09-17 18:35:30 +00:00
|
|
|
}
|
2001-01-12 15:37:40 +00:00
|
|
|
inline void set_lon (double value) { lon->setDoubleValue(value); }
|
|
|
|
inline void set_lat (double value) { lat->setDoubleValue(value); }
|
|
|
|
inline void set_altitude (double value) {
|
|
|
|
altitude->setDoubleValue(value);
|
|
|
|
}
|
|
|
|
inline void set_heading (double value) { heading->setDoubleValue(value); }
|
|
|
|
inline void set_roll (double value) { roll->setDoubleValue(value); }
|
|
|
|
inline void set_pitch (double value) { pitch->setDoubleValue(value); }
|
|
|
|
inline void set_anti_alias_hud (bool value) {
|
|
|
|
anti_alias_hud->setBoolValue(value);
|
|
|
|
}
|
|
|
|
inline void set_hud_status( bool status ) {
|
|
|
|
hud_status->setBoolValue(status);
|
2000-07-05 02:39:30 +00:00
|
|
|
}
|
2001-01-12 15:37:40 +00:00
|
|
|
inline void set_flight_model (int value) {
|
|
|
|
if (value == FGInterface::FG_ADA)
|
|
|
|
flight_model->setStringValue("ada");
|
|
|
|
else if (value == FGInterface::FG_BALLOONSIM)
|
|
|
|
flight_model->setStringValue("balloon");
|
|
|
|
else if (value == FGInterface::FG_EXTERNAL)
|
|
|
|
flight_model->setStringValue("external");
|
|
|
|
else if (value == FGInterface::FG_JSBSIM)
|
|
|
|
flight_model->setStringValue("jsb");
|
|
|
|
else if (value == FGInterface::FG_LARCSIM)
|
|
|
|
flight_model->setStringValue("larcsim");
|
|
|
|
else if (value == FGInterface::FG_MAGICCARPET)
|
|
|
|
flight_model->setStringValue("magic");
|
|
|
|
else
|
|
|
|
flight_model->setStringValue("larcsim");
|
|
|
|
}
|
|
|
|
inline void set_aircraft (const string &ac) {
|
|
|
|
aircraft->setStringValue(ac);
|
|
|
|
}
|
|
|
|
inline void set_textures( bool status ) { textures->setBoolValue(status); }
|
|
|
|
inline void cycle_fog( void ) {
|
|
|
|
const string &s = fog->getStringValue();
|
|
|
|
if ( s == "disabled" ) {
|
|
|
|
fog->setStringValue("fastest");
|
|
|
|
} else if ( s == "fastest" ) {
|
|
|
|
fog->setStringValue("nicest");
|
|
|
|
glHint ( GL_FOG_HINT, GL_NICEST );
|
|
|
|
} else if ( s == "nicest" ) {
|
|
|
|
fog->setStringValue("disabled");
|
|
|
|
glHint ( GL_FOG_HINT, GL_FASTEST );
|
1999-09-09 00:16:28 +00:00
|
|
|
}
|
|
|
|
}
|
2001-01-12 15:37:40 +00:00
|
|
|
void toggle_panel();
|
|
|
|
inline void set_xsize( int x ) { xsize->setIntValue(x); }
|
|
|
|
inline void set_ysize( int y ) { ysize->setIntValue(y); }
|
1999-09-09 00:16:28 +00:00
|
|
|
|
2001-01-12 15:37:40 +00:00
|
|
|
inline void set_net_id( const string id ) { net_id->setStringValue(id); }
|
1998-08-24 20:11:12 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
private:
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1999-08-10 03:44:47 +00:00
|
|
|
void parse_control( const string& mode );
|
1998-08-27 17:01:55 +00:00
|
|
|
double parse_time( const string& time_str );
|
1999-04-11 13:19:29 +00:00
|
|
|
long int parse_date( const string& date_str );
|
1998-08-27 17:01:55 +00:00
|
|
|
double parse_degree( const string& degree_str );
|
|
|
|
int parse_time_offset( const string& time_str );
|
2001-01-12 15:37:40 +00:00
|
|
|
int parse_fdm( const string& fm ) const;
|
1998-08-27 17:01:55 +00:00
|
|
|
double parse_fov( const string& arg );
|
1999-11-19 02:10:24 +00:00
|
|
|
bool parse_channel( const string& type, const string& channel_str );
|
2000-10-12 01:08:09 +00:00
|
|
|
bool parse_wp( const string& arg );
|
2000-11-28 23:38:24 +00:00
|
|
|
bool parse_flightplan(const string& arg);
|
1998-04-24 00:49:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _OPTIONS_HXX */
|
|
|
|
|
|
|
|
|