2000-03-22 22:01:33 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
FILENAME: uiuc_menu.cpp
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
DESCRIPTION: reads input file for specified aircraft and creates
|
|
|
|
approporiate data storage space
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
STATUS: alpha version
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
REFERENCES: based on "menu reader" format of Michael Selig
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
HISTORY: 01/29/2000 initial release
|
|
|
|
02/18/2000 (JS) added 1D data file capability for
|
|
|
|
CL(a) and CD(a) -- calls
|
|
|
|
uiuc_1DdataFileReader
|
|
|
|
02/22/2000 (JS) added ice map functions
|
|
|
|
02/29/2000 (JS) added 2D data file capability for
|
|
|
|
CL(a,de), CD(a,de), Cm(a,de), CY(a,da),
|
|
|
|
CY(beta,dr), Cl(a,da), Cl(beta,dr),
|
|
|
|
Cn(a,da), Cn(beta,dr) -- calls
|
|
|
|
uiuc_2DdataFileReader
|
|
|
|
02/02/2000 (JS) added record options for 1D and
|
|
|
|
2D interpolated variables
|
2000-09-06 19:52:37 +00:00
|
|
|
03/28/2000 (JS) streamlined conversion factors for
|
|
|
|
file readers -- since they are global
|
|
|
|
variables, it is not necessary to put
|
|
|
|
them in the function calls
|
|
|
|
03/29/2000 (JS) added Cmfa and Weight flags;
|
|
|
|
added misc map; added Dx_cg (etc) to init
|
|
|
|
map
|
|
|
|
04/01/2000 (JS) added throttle, longitudinal, lateral,
|
|
|
|
and rudder inputs to record map
|
|
|
|
04/05/2000 (JS) added Altitude to init and record
|
|
|
|
maps; added zero_Long_trim to
|
|
|
|
controlSurface map
|
From: David Megginson <david@megginson.com>
I have created a set of patches to provide configurable landing gear
for the UIUC models. The patches (including four new files) are
available at
http://megginson.com/private/fgfs/uiuc-20010309.tar.gz
A modified UIUC configuration file for the Twin Otter (DHC-6) is
available at
http://megginson.com/private/fgfs/aircraft.dat
It should be possible to configure appropriate gear for all of the
UIUC models now. As a bonus, the models also support braking, both
absolute and differential, as well as nose-wheel steering (all of
which are currently missing from the UIUC models) -- when you land,
you don't have to keep rolling off the end of the runway anymore, and
you don't have to bank to steer in a taxi.
My sample configuration file contains absolutely bizarre, wild
guesses, and many places that I didn't even bother to guess properly.
The only actual data I had was the wing-span of the DHC-6 (65ft),
which I used for positioning the wing tips. The wing-tips for this
model actually work now -- I hit the aileron hard while accelerating
for take-off, and the wingtip noticeably strikes the ground and
bounces up (quite dramatic in external view using the DHC-6 model from
Wolfram's site).
Details
-------
The UIUC models now support up to 16 gear points each where a gear
point is anything in the aircraft that can come in contact with the
ground, including the tail and wing-tips. I have added the following
new fields to the UIUC configuration files, where <index> is an
integer between 0 and 15, and <value> is a real number:
gear <index> Dx_gear <value> # x offset from CG [ft]
gear <index> Dy_gear <value> # y offset from CG [ft]
gear <index> Dz_gear <value> # z offset from CG [ft]
gear <index> cgear <value> # spring damping [lbs/ft/sec]
gear <index> kgear <value> # springiness [lbs/ft]
gear <index> muGear <value> # rolling coefficient
gear <index> strutLength <value> # gear travel [ft] (not yet used)
Most of these names were already pencilled into the UIUC documentation
(as TODO items), but I had to make up Dx_gear, Dy_gear, and Dz_gear --
if those are inappropriate, I'd appreciate suggestions for better
names.
It will be necessary to modify the other UIUC configuration files to
include some kind of gear support as well, or the planes will sink
nose-first into the ground down to their CG's (it's actually quite
funny to watch with an external view).
Background
----------
As I frequently remind everyone here, I have no math background worth
spitting at, so I will not even pretend to have done the hard stuff.
The UIUC code uses a copy of a very old version of the LaRCsim
c172_gear.c -- I wanted to update it with Tony Peden's excellent newer
version, which includes differential braking among other goodies (the
UIUC models don't support brakes, period).
I copied the newer code into uiuc_aero.c, and it compiled and ran, but
all of the planes ended up sitting on their tails with their noses in
the air. Since Tony made his gear code nicely parameterized, I
experimented with different values, and found that it wasn't too hard
to balance the Twin Otter by moving the gear back a bit. At first, I
used properties to set different values, but then I decided to
integrate the whole thing properly into the UIUC configuration
framework. Thanks to Tony Peden, who did the real modelling work -- I
can take credit only for two or three hours of integration. It turns
out that Tony's code is generalized enough to deal with a wide range
of different gear structures -- I suspect that it will even work for
the 747, when I get around to trying some values.
2001-03-29 03:16:25 +00:00
|
|
|
03/09/2001 (DPM) added support for gear.
|
2001-09-14 20:36:34 +00:00
|
|
|
06/18/2001 (RD) Added Alpha, Beta, U_body,
|
|
|
|
V_body, and W_body to init map. Added
|
|
|
|
aileron_input, rudder_input, pilot_elev_no,
|
|
|
|
pilot_ail_no, and pilot_rud_no to
|
|
|
|
controlSurface map. Added Throttle_pct_input
|
|
|
|
to engine map. Added CZfa to CL map.
|
|
|
|
07/05/2001 (RD) Changed pilot_elev_no = true to pilot_
|
|
|
|
elev_no_check=false. This is to allow pilot
|
|
|
|
to fly aircraft after input files have been
|
|
|
|
used.
|
|
|
|
08/27/2001 (RD) Added xxx_init_true and xxx_init for
|
|
|
|
P_body, Q_body, R_body, Phi, Theta, Psi,
|
|
|
|
U_body, V_body, and W_body to help in
|
|
|
|
starting the A/C at an initial condition.
|
2002-04-01 21:37:33 +00:00
|
|
|
10/25/2001 (RD) Added new variables needed for the non-
|
|
|
|
linear Twin Otter model at zero flaps
|
|
|
|
(Cxfxxf0)
|
|
|
|
11/12/2001 (RD) Added new variables needed for the non-
|
|
|
|
linear Twin Otter model with flaps
|
|
|
|
(Cxfxxf). Removed zero flap variables.
|
|
|
|
Added minmaxfind() which is needed for non-
|
|
|
|
linear variables
|
2002-09-02 23:26:28 +00:00
|
|
|
01/11/2002 (AP) Added keywords for bootTime
|
2002-04-01 21:37:33 +00:00
|
|
|
02/13/2002 (RD) Added variables so linear aero model
|
|
|
|
values can be recorded
|
|
|
|
02/18/2002 (RD) Added variables necessary to use the
|
|
|
|
uiuc_3Dinterp_quick() function. Takes
|
|
|
|
advantage of data in a "nice" form (data
|
|
|
|
that are in a rectangular matrix).
|
|
|
|
03/13/2002 (RD) Added aircraft_directory so full path
|
|
|
|
is no longer needed in the aircraft.dat file
|
2002-04-03 00:57:06 +00:00
|
|
|
04/02/2002 (RD) Removed minmaxfind() since it was no
|
|
|
|
longer needed. Added d_2_to_3(),
|
|
|
|
d_1_to_2(), and i_1_to_2() so uiuc_menu()
|
|
|
|
will compile with certain compilers.
|
2002-09-02 23:26:28 +00:00
|
|
|
08/29/2002 (RD) Separated each primary keyword into its
|
|
|
|
own function to speed up compile time
|
2002-09-11 02:31:10 +00:00
|
|
|
08/29/2002 (RD w/ help from CO) Made changes to shorten
|
|
|
|
compile time. [] RD to add more comments here.
|
2002-11-08 17:03:49 +00:00
|
|
|
08/29/2003 (MSS) Adding new keywords for new engine model
|
2002-09-11 02:31:10 +00:00
|
|
|
and slipstream effects on tail.
|
2003-05-13 18:45:04 +00:00
|
|
|
03/02/2003 (RD) Changed Cxfxxf areas so that there is a
|
|
|
|
conversion factor for flap angle
|
|
|
|
03/03/2003 (RD) Added flap_cmd_record
|
|
|
|
03/16/2003 (RD) Added trigger record flags
|
|
|
|
04/02/2003 (RD) Tokens are now equal to 0 when no value
|
|
|
|
is given in the input file
|
|
|
|
04/04/2003 (RD) To speed up compile time on this file,
|
|
|
|
each first level token now goes to its
|
|
|
|
own file uiuc_menu_*.cpp
|
2000-03-22 22:01:33 +00:00
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
|
2003-05-13 18:45:04 +00:00
|
|
|
Jeff Scott http://www.jeffscott.net/
|
2001-09-14 20:36:34 +00:00
|
|
|
Robert Deters <rdeters@uiuc.edu>
|
2000-03-22 22:01:33 +00:00
|
|
|
Michael Selig <m-selig@uiuc.edu>
|
From: David Megginson <david@megginson.com>
I have created a set of patches to provide configurable landing gear
for the UIUC models. The patches (including four new files) are
available at
http://megginson.com/private/fgfs/uiuc-20010309.tar.gz
A modified UIUC configuration file for the Twin Otter (DHC-6) is
available at
http://megginson.com/private/fgfs/aircraft.dat
It should be possible to configure appropriate gear for all of the
UIUC models now. As a bonus, the models also support braking, both
absolute and differential, as well as nose-wheel steering (all of
which are currently missing from the UIUC models) -- when you land,
you don't have to keep rolling off the end of the runway anymore, and
you don't have to bank to steer in a taxi.
My sample configuration file contains absolutely bizarre, wild
guesses, and many places that I didn't even bother to guess properly.
The only actual data I had was the wing-span of the DHC-6 (65ft),
which I used for positioning the wing tips. The wing-tips for this
model actually work now -- I hit the aileron hard while accelerating
for take-off, and the wingtip noticeably strikes the ground and
bounces up (quite dramatic in external view using the DHC-6 model from
Wolfram's site).
Details
-------
The UIUC models now support up to 16 gear points each where a gear
point is anything in the aircraft that can come in contact with the
ground, including the tail and wing-tips. I have added the following
new fields to the UIUC configuration files, where <index> is an
integer between 0 and 15, and <value> is a real number:
gear <index> Dx_gear <value> # x offset from CG [ft]
gear <index> Dy_gear <value> # y offset from CG [ft]
gear <index> Dz_gear <value> # z offset from CG [ft]
gear <index> cgear <value> # spring damping [lbs/ft/sec]
gear <index> kgear <value> # springiness [lbs/ft]
gear <index> muGear <value> # rolling coefficient
gear <index> strutLength <value> # gear travel [ft] (not yet used)
Most of these names were already pencilled into the UIUC documentation
(as TODO items), but I had to make up Dx_gear, Dy_gear, and Dz_gear --
if those are inappropriate, I'd appreciate suggestions for better
names.
It will be necessary to modify the other UIUC configuration files to
include some kind of gear support as well, or the planes will sink
nose-first into the ground down to their CG's (it's actually quite
funny to watch with an external view).
Background
----------
As I frequently remind everyone here, I have no math background worth
spitting at, so I will not even pretend to have done the hard stuff.
The UIUC code uses a copy of a very old version of the LaRCsim
c172_gear.c -- I wanted to update it with Tony Peden's excellent newer
version, which includes differential braking among other goodies (the
UIUC models don't support brakes, period).
I copied the newer code into uiuc_aero.c, and it compiled and ran, but
all of the planes ended up sitting on their tails with their noses in
the air. Since Tony made his gear code nicely parameterized, I
experimented with different values, and found that it wasn't too hard
to balance the Twin Otter by moving the gear back a bit. At first, I
used properties to set different values, but then I decided to
integrate the whole thing properly into the UIUC configuration
framework. Thanks to Tony Peden, who did the real modelling work -- I
can take credit only for two or three hours of integration. It turns
out that Tony's code is generalized enough to deal with a wide range
of different gear structures -- I suspect that it will even work for
the 747, when I get around to trying some values.
2001-03-29 03:16:25 +00:00
|
|
|
David Megginson <david@megginson.com>
|
2002-09-02 23:26:28 +00:00
|
|
|
Ann Peedikayil <peedikay@uiuc.edu>
|
2000-03-22 22:01:33 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
VARIABLES:
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
INPUTS: n/a
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
OUTPUTS: n/a
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
2000-09-06 19:52:37 +00:00
|
|
|
CALLED BY: uiuc_wrapper.cpp
|
2000-03-22 22:01:33 +00:00
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
CALLS TO: aircraft.dat
|
|
|
|
tabulated data files (if needed)
|
2003-05-13 18:45:04 +00:00
|
|
|
uiuc_menu_init()
|
|
|
|
uiuc_menu_geometry()
|
|
|
|
uiuc_menu_mass()
|
|
|
|
uiuc_menu_controlSurface()
|
|
|
|
uiuc_menu_CD()
|
|
|
|
uiuc_menu_CL()
|
|
|
|
uiuc_menu_Cm()
|
|
|
|
uiuc_menu_CY()
|
|
|
|
uiuc_menu_Cl()
|
|
|
|
uiuc_menu_Cn()
|
|
|
|
uiuc_menu_ice()
|
|
|
|
uiuc_menu_engine()
|
|
|
|
uiuc_menu_fog()
|
|
|
|
uiuc_menu_gear()
|
|
|
|
uiuc_menu_record()
|
|
|
|
uiuc_menu_misc()
|
2000-03-22 22:01:33 +00:00
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
COPYRIGHT: (C) 2000 by Michael Selig
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
|
|
USA or view http://www.gnu.org/copyleft/gpl.html.
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
2000-10-02 21:49:04 +00:00
|
|
|
#include <simgear/compiler.h>
|
|
|
|
|
2000-12-13 23:02:02 +00:00
|
|
|
#if defined( __MWERKS__ )
|
|
|
|
// -dw- optimizer chokes (big-time) trying to optimize humongous
|
|
|
|
// loop/switch statements
|
|
|
|
#pragma optimization_level 0
|
|
|
|
#endif
|
|
|
|
|
2003-05-13 18:45:04 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <string>
|
From: David Megginson <david@megginson.com>
I have created a set of patches to provide configurable landing gear
for the UIUC models. The patches (including four new files) are
available at
http://megginson.com/private/fgfs/uiuc-20010309.tar.gz
A modified UIUC configuration file for the Twin Otter (DHC-6) is
available at
http://megginson.com/private/fgfs/aircraft.dat
It should be possible to configure appropriate gear for all of the
UIUC models now. As a bonus, the models also support braking, both
absolute and differential, as well as nose-wheel steering (all of
which are currently missing from the UIUC models) -- when you land,
you don't have to keep rolling off the end of the runway anymore, and
you don't have to bank to steer in a taxi.
My sample configuration file contains absolutely bizarre, wild
guesses, and many places that I didn't even bother to guess properly.
The only actual data I had was the wing-span of the DHC-6 (65ft),
which I used for positioning the wing tips. The wing-tips for this
model actually work now -- I hit the aileron hard while accelerating
for take-off, and the wingtip noticeably strikes the ground and
bounces up (quite dramatic in external view using the DHC-6 model from
Wolfram's site).
Details
-------
The UIUC models now support up to 16 gear points each where a gear
point is anything in the aircraft that can come in contact with the
ground, including the tail and wing-tips. I have added the following
new fields to the UIUC configuration files, where <index> is an
integer between 0 and 15, and <value> is a real number:
gear <index> Dx_gear <value> # x offset from CG [ft]
gear <index> Dy_gear <value> # y offset from CG [ft]
gear <index> Dz_gear <value> # z offset from CG [ft]
gear <index> cgear <value> # spring damping [lbs/ft/sec]
gear <index> kgear <value> # springiness [lbs/ft]
gear <index> muGear <value> # rolling coefficient
gear <index> strutLength <value> # gear travel [ft] (not yet used)
Most of these names were already pencilled into the UIUC documentation
(as TODO items), but I had to make up Dx_gear, Dy_gear, and Dz_gear --
if those are inappropriate, I'd appreciate suggestions for better
names.
It will be necessary to modify the other UIUC configuration files to
include some kind of gear support as well, or the planes will sink
nose-first into the ground down to their CG's (it's actually quite
funny to watch with an external view).
Background
----------
As I frequently remind everyone here, I have no math background worth
spitting at, so I will not even pretend to have done the hard stuff.
The UIUC code uses a copy of a very old version of the LaRCsim
c172_gear.c -- I wanted to update it with Tony Peden's excellent newer
version, which includes differential braking among other goodies (the
UIUC models don't support brakes, period).
I copied the newer code into uiuc_aero.c, and it compiled and ran, but
all of the planes ended up sitting on their tails with their noses in
the air. Since Tony made his gear code nicely parameterized, I
experimented with different values, and found that it wasn't too hard
to balance the Twin Otter by moving the gear back a bit. At first, I
used properties to set different values, but then I decided to
integrate the whole thing properly into the UIUC configuration
framework. Thanks to Tony Peden, who did the real modelling work -- I
can take credit only for two or three hours of integration. It turns
out that Tony's code is generalized enough to deal with a wide range
of different gear structures -- I suspect that it will even work for
the 747, when I get around to trying some values.
2001-03-29 03:16:25 +00:00
|
|
|
#include STL_IOSTREAM
|
2000-10-02 21:49:04 +00:00
|
|
|
|
2000-12-13 23:02:02 +00:00
|
|
|
#include "uiuc_menu.h"
|
|
|
|
|
2001-03-23 22:59:18 +00:00
|
|
|
SG_USING_STD(cerr);
|
|
|
|
SG_USING_STD(cout);
|
|
|
|
SG_USING_STD(endl);
|
2001-01-11 04:54:33 +00:00
|
|
|
|
2002-12-31 18:26:02 +00:00
|
|
|
#ifndef _MSC_VER
|
2001-03-23 22:59:18 +00:00
|
|
|
SG_USING_STD(exit);
|
2001-01-11 04:54:33 +00:00
|
|
|
#endif
|
2000-03-22 22:01:33 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
void uiuc_menu( string aircraft_name )
|
|
|
|
{
|
|
|
|
string aircraft_directory;
|
|
|
|
stack command_list;
|
|
|
|
double token_value;
|
|
|
|
int token_value_recordRate;
|
|
|
|
int token_value_convert1, token_value_convert2, token_value_convert3;
|
|
|
|
|
|
|
|
string linetoken1;
|
|
|
|
string linetoken2;
|
|
|
|
string linetoken3;
|
|
|
|
string linetoken4;
|
|
|
|
string linetoken5;
|
|
|
|
string linetoken6;
|
|
|
|
string linetoken7;
|
|
|
|
string linetoken8;
|
|
|
|
string linetoken9;
|
2003-05-13 18:45:04 +00:00
|
|
|
string linetoken10;
|
2002-09-02 23:26:28 +00:00
|
|
|
|
|
|
|
/* the following default setting should eventually be moved to a default or uiuc_init routine */
|
2000-03-22 22:01:33 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
recordRate = 1; /* record every time step, default */
|
|
|
|
recordStartTime = 0; /* record from beginning of simulation */
|
2000-03-22 22:01:33 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
/* set speed at which dynamic pressure terms will be accounted for,
|
|
|
|
since if velocity is too small, coefficients will go to infinity */
|
2002-09-11 02:31:10 +00:00
|
|
|
dyn_on_speed = 33; /* 20 kts (33 ft/sec), default */
|
|
|
|
dyn_on_speed_zero = 0.5 * dyn_on_speed; /* only used if use_dyn_on_speed_curve1 is used */
|
2002-09-02 23:26:28 +00:00
|
|
|
bootindex = 0; // the index for the bootTime
|
2000-03-22 22:01:33 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
/* Read the file and get the list of commands */
|
|
|
|
airplane = new ParseFile(aircraft_name); /* struct that includes all lines of the input file */
|
|
|
|
command_list = airplane -> getCommands();
|
|
|
|
/* structs to include all parts included in the input file for specific keyword groups */
|
|
|
|
initParts = new ParseFile();
|
|
|
|
geometryParts = new ParseFile();
|
|
|
|
massParts = new ParseFile();
|
|
|
|
engineParts = new ParseFile();
|
|
|
|
aeroDragParts = new ParseFile();
|
|
|
|
aeroLiftParts = new ParseFile();
|
|
|
|
aeroPitchParts = new ParseFile();
|
|
|
|
aeroSideforceParts = new ParseFile();
|
|
|
|
aeroRollParts = new ParseFile();
|
|
|
|
aeroYawParts = new ParseFile();
|
|
|
|
gearParts = new ParseFile();
|
|
|
|
recordParts = new ParseFile();
|
2000-03-22 22:01:33 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
if (command_list.begin() == command_list.end())
|
|
|
|
{
|
|
|
|
cerr << "UIUC ERROR: File " << aircraft_name <<" does not exist" << endl;
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
//construct aircraft-directory
|
|
|
|
aircraft_directory = aircraft_name;
|
|
|
|
int index_aircraft_dat = aircraft_directory.find("aircraft.dat");
|
|
|
|
aircraft_directory.erase(index_aircraft_dat,12);
|
2000-09-06 19:52:37 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
|
|
|
|
{
|
|
|
|
cout << *command_line << endl;
|
2000-09-06 19:52:37 +00:00
|
|
|
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken1 = airplane -> getToken (*command_line, 1);
|
|
|
|
linetoken2 = airplane -> getToken (*command_line, 2);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken2=="")
|
|
|
|
linetoken2="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken3 = airplane -> getToken (*command_line, 3);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken3=="")
|
|
|
|
linetoken3="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken4 = airplane -> getToken (*command_line, 4);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken4=="")
|
|
|
|
linetoken4="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken5 = airplane -> getToken (*command_line, 5);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken5=="")
|
|
|
|
linetoken5="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken6 = airplane -> getToken (*command_line, 6);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken6=="")
|
|
|
|
linetoken6="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken7 = airplane -> getToken (*command_line, 7);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken7=="")
|
|
|
|
linetoken7="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken8 = airplane -> getToken (*command_line, 8);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken8=="")
|
|
|
|
linetoken8="0";
|
2002-09-02 23:26:28 +00:00
|
|
|
linetoken9 = airplane -> getToken (*command_line, 9);
|
2003-05-13 18:45:04 +00:00
|
|
|
if (linetoken9=="")
|
|
|
|
linetoken9="0";
|
|
|
|
linetoken10 = airplane -> getToken (*command_line, 10);
|
|
|
|
if (linetoken10=="")
|
|
|
|
linetoken10="0";
|
|
|
|
|
|
|
|
//cout << linetoken1 << endl;
|
|
|
|
//cout << linetoken2 << endl;
|
|
|
|
//cout << linetoken3 << endl;
|
|
|
|
//cout << linetoken4 << endl;
|
|
|
|
//cout << linetoken5 << endl;
|
|
|
|
//cout << linetoken6 << endl;
|
|
|
|
//cout << linetoken7 << endl;
|
|
|
|
//cout << linetoken8 << endl;
|
|
|
|
//cout << linetoken9 << endl;
|
|
|
|
//cout << linetoken10 << endl;
|
|
|
|
|
|
|
|
//istrstream token3(linetoken3.c_str());
|
|
|
|
//istrstream token4(linetoken4.c_str());
|
|
|
|
//istrstream token5(linetoken5.c_str());
|
|
|
|
//istrstream token6(linetoken6.c_str());
|
|
|
|
//istrstream token7(linetoken7.c_str());
|
|
|
|
//istrstream token8(linetoken8.c_str());
|
|
|
|
//istrstream token9(linetoken9.c_str());
|
|
|
|
//istrstream token10(linetoken10.c_str());
|
2002-09-02 23:26:28 +00:00
|
|
|
|
|
|
|
switch (Keyword_map[linetoken1])
|
|
|
|
{
|
|
|
|
case init_flag:
|
|
|
|
{
|
2003-05-13 18:45:04 +00:00
|
|
|
parse_init( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end init map
|
|
|
|
|
|
|
|
|
|
|
|
case geometry_flag:
|
|
|
|
{
|
2003-05-13 18:45:04 +00:00
|
|
|
parse_geometry( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end geometry map
|
|
|
|
|
|
|
|
|
|
|
|
case controlSurface_flag:
|
|
|
|
{
|
|
|
|
parse_controlSurface( linetoken2, linetoken3, linetoken4,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end controlSurface map
|
|
|
|
|
|
|
|
|
|
|
|
case mass_flag:
|
|
|
|
{
|
2003-05-13 18:45:04 +00:00
|
|
|
parse_mass( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end mass map
|
|
|
|
|
|
|
|
|
|
|
|
case engine_flag:
|
|
|
|
{
|
|
|
|
parse_engine( linetoken2, linetoken3, linetoken4,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end engine map
|
|
|
|
|
|
|
|
|
|
|
|
case CD_flag:
|
|
|
|
{
|
|
|
|
parse_CD( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end CD map
|
|
|
|
|
|
|
|
|
|
|
|
case CL_flag:
|
|
|
|
{
|
|
|
|
parse_CL( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end CL map
|
|
|
|
|
|
|
|
|
|
|
|
case Cm_flag:
|
|
|
|
{
|
|
|
|
parse_Cm( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end Cm map
|
|
|
|
|
|
|
|
|
|
|
|
case CY_flag:
|
|
|
|
{
|
|
|
|
parse_CY( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end CY map
|
|
|
|
|
|
|
|
|
|
|
|
case Cl_flag:
|
|
|
|
{
|
|
|
|
parse_Cl( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end Cl map
|
|
|
|
|
|
|
|
|
|
|
|
case Cn_flag:
|
|
|
|
{
|
|
|
|
parse_Cn( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end Cn map
|
|
|
|
|
|
|
|
|
|
|
|
case gear_flag:
|
|
|
|
{
|
|
|
|
parse_gear( linetoken2, linetoken3, linetoken4,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end gear map
|
|
|
|
|
|
|
|
|
|
|
|
case ice_flag:
|
|
|
|
{
|
|
|
|
parse_ice( linetoken2, linetoken3, linetoken4,
|
2002-11-08 17:03:49 +00:00
|
|
|
linetoken5, linetoken6, linetoken7,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end ice map
|
|
|
|
|
|
|
|
|
|
|
|
case fog_flag:
|
|
|
|
{
|
|
|
|
parse_fog( linetoken2, linetoken3, linetoken4,
|
2003-05-13 18:45:04 +00:00
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2002-09-02 23:26:28 +00:00
|
|
|
break;
|
|
|
|
} // end fog map
|
|
|
|
|
|
|
|
|
|
|
|
case record_flag:
|
|
|
|
{
|
|
|
|
static int fout_flag=0;
|
|
|
|
if (fout_flag==0)
|
|
|
|
{
|
|
|
|
fout_flag=-1;
|
|
|
|
fout.open("uiuc_record.dat");
|
|
|
|
}
|
2003-05-13 18:45:04 +00:00
|
|
|
parse_record( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2000-03-22 22:01:33 +00:00
|
|
|
break;
|
|
|
|
} // end record map
|
2000-09-06 19:52:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
case misc_flag:
|
|
|
|
{
|
2003-05-13 18:45:04 +00:00
|
|
|
parse_misc( linetoken2, linetoken3, linetoken4,
|
|
|
|
linetoken5, linetoken6, linetoken7,
|
|
|
|
linetoken8, linetoken9, linetoken10,
|
|
|
|
aircraft_directory, command_line );
|
2000-09-06 19:52:37 +00:00
|
|
|
break;
|
|
|
|
} // end misc map
|
|
|
|
|
|
|
|
|
2000-03-22 22:01:33 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
if (linetoken1=="*")
|
|
|
|
return;
|
2003-05-13 18:45:04 +00:00
|
|
|
if (ignore_unknown_keywords) {
|
|
|
|
// do nothing
|
|
|
|
} else {
|
|
|
|
// print error message
|
2002-09-02 23:26:28 +00:00
|
|
|
uiuc_warnings_errors(2, *command_line);
|
2003-05-13 18:45:04 +00:00
|
|
|
}
|
2000-03-22 22:01:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} // end keyword map
|
|
|
|
|
|
|
|
delete airplane;
|
|
|
|
}
|
|
|
|
|
|
|
|
// end menu.cpp
|