2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Module: FGAircraft.cpp
|
|
|
|
Author: Jon S. Berndt
|
1999-02-11 21:05:34 +00:00
|
|
|
Date started: 12/12/98
|
1999-02-05 21:26:01 +00:00
|
|
|
Purpose: Encapsulates an aircraft
|
|
|
|
Called by: FGFDMExec
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
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.
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
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.
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
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.
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Further information about the GNU General Public License can also be found on
|
|
|
|
the world wide web at http://www.gnu.org.
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
FUNCTIONAL DESCRIPTION
|
|
|
|
--------------------------------------------------------------------------------
|
1999-02-11 21:05:34 +00:00
|
|
|
Models the aircraft reactions and forces. This class is instantiated by the
|
|
|
|
FGFDMExec class and scheduled as an FDM entry. LoadAircraft() is supplied with a
|
|
|
|
name of a valid, registered aircraft, and the data file is parsed.
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
HISTORY
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
12/12/98 JSB Created
|
1999-04-15 23:58:04 +00:00
|
|
|
04/03/99 JSB Changed Aero() method to correct body axis force calculation
|
|
|
|
from wind vector. Fix provided by Tony Peden.
|
1999-05-08 03:19:08 +00:00
|
|
|
05/03/99 JSB Changed (for the better?) the way configurations are read in.
|
1999-12-20 20:24:49 +00:00
|
|
|
9/17/99 TP Combined force and moment functions. Added aero reference
|
|
|
|
point to config file. Added calculations for moments due to
|
2000-04-24 23:49:06 +00:00
|
|
|
difference in cg and aero reference point
|
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
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
COMMENTS, REFERENCES, and NOTES
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
[1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
|
|
|
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
|
|
|
School, January 1994
|
|
|
|
[2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
|
|
|
JSC 12960, July 1977
|
|
|
|
[3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
|
|
|
NASA-Ames", NASA CR-2497, January 1975
|
|
|
|
[4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
|
|
|
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
|
|
|
[5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
|
|
|
1982 ISBN 0-471-08936-2
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
The aerodynamic coefficients used in this model are:
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Longitudinal
|
|
|
|
CL0 - Reference lift at zero alpha
|
|
|
|
CD0 - Reference drag at zero alpha
|
|
|
|
CDM - Drag due to Mach
|
|
|
|
CLa - Lift curve slope (w.r.t. alpha)
|
|
|
|
CDa - Drag curve slope (w.r.t. alpha)
|
|
|
|
CLq - Lift due to pitch rate
|
|
|
|
CLM - Lift due to Mach
|
|
|
|
CLadt - Lift due to alpha rate
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Cmadt - Pitching Moment due to alpha rate
|
|
|
|
Cm0 - Reference Pitching moment at zero alpha
|
|
|
|
Cma - Pitching moment slope (w.r.t. alpha)
|
|
|
|
Cmq - Pitch damping (pitch moment due to pitch rate)
|
|
|
|
CmM - Pitch Moment due to Mach
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Lateral
|
|
|
|
Cyb - Side force due to sideslip
|
|
|
|
Cyr - Side force due to yaw rate
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Clb - Dihedral effect (roll moment due to sideslip)
|
|
|
|
Clp - Roll damping (roll moment due to roll rate)
|
|
|
|
Clr - Roll moment due to yaw rate
|
|
|
|
Cnb - Weathercocking stability (yaw moment due to sideslip)
|
|
|
|
Cnp - Rudder adverse yaw (yaw moment due to roll rate)
|
|
|
|
Cnr - Yaw damping (yaw moment due to yaw rate)
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Control
|
|
|
|
CLDe - Lift due to elevator
|
|
|
|
CDDe - Drag due to elevator
|
|
|
|
CyDr - Side force due to rudder
|
|
|
|
CyDa - Side force due to aileron
|
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
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
CmDe - Pitch moment due to elevator
|
|
|
|
ClDa - Roll moment due to aileron
|
|
|
|
ClDr - Roll moment due to rudder
|
|
|
|
CnDr - Yaw moment due to rudder
|
|
|
|
CnDa - Yaw moment due to aileron
|
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
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
INCLUDES
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-05-08 03:19:08 +00:00
|
|
|
|
2000-02-10 23:37:56 +00:00
|
|
|
#include <sys/stat.h>
|
2000-04-24 23:49:06 +00:00
|
|
|
#include <sys/types.h>
|
1999-02-26 22:09:10 +00:00
|
|
|
|
|
|
|
#ifdef FGFS
|
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
|
|
|
# ifndef __BORLANDC__
|
|
|
|
# include <simgear/compiler.h>
|
|
|
|
# endif
|
2001-03-23 22:15:19 +00:00
|
|
|
# ifdef SG_HAVE_STD_INCLUDES
|
1999-02-26 22:09:10 +00:00
|
|
|
# include <cmath>
|
|
|
|
# else
|
|
|
|
# include <math.h>
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# include <cmath>
|
|
|
|
#endif
|
1999-02-05 21:26:01 +00:00
|
|
|
|
1999-02-11 21:05:34 +00:00
|
|
|
#include "FGAircraft.h"
|
|
|
|
#include "FGTranslation.h"
|
|
|
|
#include "FGRotation.h"
|
|
|
|
#include "FGAtmosphere.h"
|
|
|
|
#include "FGState.h"
|
|
|
|
#include "FGFDMExec.h"
|
|
|
|
#include "FGFCS.h"
|
|
|
|
#include "FGPosition.h"
|
|
|
|
#include "FGAuxiliary.h"
|
|
|
|
#include "FGOutput.h"
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
DEFINITIONS
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
|
|
|
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
GLOBAL DATA
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
|
|
|
2000-10-14 02:10:10 +00:00
|
|
|
static const char *IdSrc = "$Header$";
|
|
|
|
static const char *IdHdr = ID_AIRCRAFT;
|
2000-10-13 23:34:54 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
CLASS IMPLEMENTATION
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex),
|
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
|
|
|
vMoments(3),
|
|
|
|
vForces(3),
|
2000-07-06 21:02:46 +00:00
|
|
|
vFs(3),
|
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
|
|
|
vXYZrp(3),
|
|
|
|
vbaseXYZcg(3),
|
|
|
|
vXYZcg(3),
|
|
|
|
vXYZep(3),
|
2000-07-06 21:02:46 +00:00
|
|
|
vEuler(3)
|
|
|
|
|
2000-05-27 05:48:14 +00:00
|
|
|
{
|
1999-02-26 22:09:10 +00:00
|
|
|
Name = "FGAircraft";
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2000-05-02 18:25:30 +00:00
|
|
|
AxisIdx["DRAG"] = 0;
|
2000-04-24 23:49:06 +00:00
|
|
|
AxisIdx["SIDE"] = 1;
|
2000-05-02 18:25:30 +00:00
|
|
|
AxisIdx["LIFT"] = 2;
|
2000-04-24 23:49:06 +00:00
|
|
|
AxisIdx["ROLL"] = 3;
|
|
|
|
AxisIdx["PITCH"] = 4;
|
|
|
|
AxisIdx["YAW"] = 5;
|
2000-10-02 23:07:30 +00:00
|
|
|
|
|
|
|
Coeff = new CoeffArray[6];
|
2000-04-27 21:57:08 +00:00
|
|
|
|
2000-05-27 05:48:14 +00:00
|
|
|
GearUp = false;
|
2000-10-02 23:07:30 +00:00
|
|
|
|
|
|
|
alphaclmin = alphaclmax = 0;
|
2000-05-27 05:48:14 +00:00
|
|
|
|
2000-04-28 19:59:46 +00:00
|
|
|
numTanks = numEngines = numSelectedFuelTanks = numSelectedOxiTanks = 0;
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
FGAircraft::~FGAircraft(void) {
|
|
|
|
unsigned int i,j;
|
2000-10-09 21:16:21 +00:00
|
|
|
|
|
|
|
if (Engine != NULL) {
|
|
|
|
for (i=0; i<numEngines; i++)
|
2000-10-02 23:07:30 +00:00
|
|
|
delete Engine[i];
|
|
|
|
}
|
2000-10-09 21:16:21 +00:00
|
|
|
if (Tank != NULL) {
|
|
|
|
for (i=0; i<numTanks; i++)
|
2000-10-02 23:07:30 +00:00
|
|
|
delete Tank[i];
|
|
|
|
}
|
2000-10-09 21:16:21 +00:00
|
|
|
for (i=0; i<6; i++) {
|
|
|
|
for (j=0; j<Coeff[i].size(); j++) {
|
2000-10-02 23:07:30 +00:00
|
|
|
delete Coeff[i][j];
|
|
|
|
}
|
2000-10-09 21:16:21 +00:00
|
|
|
}
|
2000-10-02 23:07:30 +00:00
|
|
|
delete[] Coeff;
|
|
|
|
}
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string fname) {
|
1999-02-26 22:09:10 +00:00
|
|
|
string path;
|
|
|
|
string filename;
|
2000-04-24 23:49:06 +00:00
|
|
|
string aircraftCfgFileName;
|
|
|
|
string token;
|
|
|
|
|
|
|
|
AircraftPath = aircraft_path;
|
|
|
|
EnginePath = engine_path;
|
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
# ifndef macintosh
|
|
|
|
aircraftCfgFileName = AircraftPath + "/" + fname + "/" + fname + ".xml";
|
|
|
|
# else
|
|
|
|
aircraftCfgFileName = AircraftPath + ";" + fname + ";" + fname + ".xml";
|
|
|
|
# endif
|
2000-04-24 23:49:06 +00:00
|
|
|
|
|
|
|
FGConfigFile AC_cfg(aircraftCfgFileName);
|
2000-05-30 16:48:52 +00:00
|
|
|
if (!AC_cfg.IsOpen()) return false;
|
2000-04-24 23:49:06 +00:00
|
|
|
|
|
|
|
ReadPrologue(&AC_cfg);
|
|
|
|
|
|
|
|
while ((AC_cfg.GetNextConfigLine() != "EOF") &&
|
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
|
|
|
(token = AC_cfg.GetValue()) != "/FDM_CONFIG") {
|
2000-04-24 23:49:06 +00:00
|
|
|
if (token == "METRICS") {
|
|
|
|
cout << " Reading Metrics" << endl;
|
|
|
|
ReadMetrics(&AC_cfg);
|
|
|
|
} else if (token == "AERODYNAMICS") {
|
|
|
|
cout << " Reading Aerodynamics" << endl;
|
|
|
|
ReadAerodynamics(&AC_cfg);
|
|
|
|
} else if (token == "UNDERCARRIAGE") {
|
|
|
|
cout << " Reading Landing Gear" << endl;
|
|
|
|
ReadUndercarriage(&AC_cfg);
|
|
|
|
} else if (token == "PROPULSION") {
|
|
|
|
cout << " Reading Propulsion" << endl;
|
|
|
|
ReadPropulsion(&AC_cfg);
|
|
|
|
} else if (token == "FLIGHT_CONTROL") {
|
|
|
|
cout << " Reading Flight Control" << endl;
|
|
|
|
ReadFlightControls(&AC_cfg);
|
2000-05-02 18:25:30 +00:00
|
|
|
} else if (token == "OUTPUT") {
|
|
|
|
ReadOutput(&AC_cfg);
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
}
|
2000-04-24 23:49:06 +00:00
|
|
|
|
1999-06-21 05:01:31 +00:00
|
|
|
return true;
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
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
|
|
|
bool FGAircraft::Run(void) {
|
1999-02-05 21:26:01 +00:00
|
|
|
if (!FGModel::Run()) { // if false then execute this Run()
|
|
|
|
GetState();
|
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
for (int i = 1; i <= 3; i++) vForces(i) = vMoments(i) = 0.0;
|
1999-02-05 21:26:01 +00:00
|
|
|
|
1999-02-11 21:05:34 +00:00
|
|
|
MassChange();
|
2000-04-24 23:49:06 +00:00
|
|
|
FMProp();
|
|
|
|
FMAero();
|
|
|
|
FMGear();
|
|
|
|
FMMass();
|
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
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
nlf = 0;
|
|
|
|
if (fabs(Position->GetGamma()) < 1.57) {
|
|
|
|
nlf = vFs(eZ)/(Weight*cos(Position->GetGamma()));
|
|
|
|
}
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
} else { // skip Run() execution this time
|
|
|
|
}
|
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
|
|
|
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::MassChange() {
|
2000-04-24 23:49:06 +00:00
|
|
|
static FGColumnVector vXYZtank(3);
|
|
|
|
float Tw;
|
1999-09-28 14:19:34 +00:00
|
|
|
float IXXt, IYYt, IZZt, IXZt;
|
2000-07-06 21:02:46 +00:00
|
|
|
unsigned int t;
|
2000-04-24 23:49:06 +00:00
|
|
|
unsigned int axis_ctr;
|
|
|
|
|
|
|
|
for (axis_ctr=1; axis_ctr<=3; axis_ctr++) vXYZtank(axis_ctr) = 0.0;
|
1999-09-28 14:19:34 +00:00
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
// UPDATE TANK CONTENTS
|
|
|
|
//
|
|
|
|
// For each engine, cycle through the tanks and draw an equal amount of
|
|
|
|
// fuel (or oxidizer) from each active tank. The needed amount of fuel is
|
|
|
|
// determined by the engine in the FGEngine class. If more fuel is needed
|
|
|
|
// than is available in the tank, then that amount is considered a shortage,
|
|
|
|
// and will be drawn from the next tank. If the engine cannot be fed what it
|
|
|
|
// needs, it will be considered to be starved, and will shut down.
|
|
|
|
|
1999-02-11 21:05:34 +00:00
|
|
|
float Oshortage, Fshortage;
|
|
|
|
|
2000-07-06 21:02:46 +00:00
|
|
|
for (unsigned int e=0; e<numEngines; e++) {
|
1999-02-05 21:26:01 +00:00
|
|
|
Fshortage = Oshortage = 0.0;
|
1999-10-07 23:08:48 +00:00
|
|
|
for (t=0; t<numTanks; t++) {
|
1999-02-05 21:26:01 +00:00
|
|
|
switch(Engine[e]->GetType()) {
|
1999-02-26 22:09:10 +00:00
|
|
|
case FGEngine::etRocket:
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
switch(Tank[t]->GetType()) {
|
1999-02-26 22:09:10 +00:00
|
|
|
case FGTank::ttFUEL:
|
1999-02-05 21:26:01 +00:00
|
|
|
if (Tank[t]->GetSelected()) {
|
1999-02-11 21:05:34 +00:00
|
|
|
Fshortage = Tank[t]->Reduce((Engine[e]->CalcFuelNeed()/
|
1999-12-20 20:24:49 +00:00
|
|
|
numSelectedFuelTanks)*(dt*rate) + Fshortage);
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
break;
|
1999-02-26 22:09:10 +00:00
|
|
|
case FGTank::ttOXIDIZER:
|
1999-02-05 21:26:01 +00:00
|
|
|
if (Tank[t]->GetSelected()) {
|
1999-02-11 21:05:34 +00:00
|
|
|
Oshortage = Tank[t]->Reduce((Engine[e]->CalcOxidizerNeed()/
|
1999-12-20 20:24:49 +00:00
|
|
|
numSelectedOxiTanks)*(dt*rate) + Oshortage);
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
1999-02-26 22:09:10 +00:00
|
|
|
|
|
|
|
case FGEngine::etPiston:
|
|
|
|
case FGEngine::etTurboJet:
|
|
|
|
case FGEngine::etTurboProp:
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
if (Tank[t]->GetSelected()) {
|
1999-02-11 21:05:34 +00:00
|
|
|
Fshortage = Tank[t]->Reduce((Engine[e]->CalcFuelNeed()/
|
1999-12-20 20:24:49 +00:00
|
|
|
numSelectedFuelTanks)*(dt*rate) + Fshortage);
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1999-02-11 21:05:34 +00:00
|
|
|
if ((Fshortage <= 0.0) || (Oshortage <= 0.0)) Engine[e]->SetStarved();
|
1999-02-05 21:26:01 +00:00
|
|
|
else Engine[e]->SetStarved(false);
|
|
|
|
}
|
|
|
|
|
1999-02-11 21:05:34 +00:00
|
|
|
Weight = EmptyWeight;
|
1999-10-07 23:08:48 +00:00
|
|
|
for (t=0; t<numTanks; t++)
|
1999-02-11 21:05:34 +00:00
|
|
|
Weight += Tank[t]->GetContents();
|
|
|
|
|
|
|
|
Mass = Weight / GRAVITY;
|
1999-09-28 14:19:34 +00:00
|
|
|
// Calculate new CG here.
|
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
Tw = 0;
|
1999-10-07 23:08:48 +00:00
|
|
|
for (t=0; t<numTanks; t++) {
|
2000-04-24 23:49:06 +00:00
|
|
|
vXYZtank(eX) += Tank[t]->GetX()*Tank[t]->GetContents();
|
|
|
|
vXYZtank(eY) += Tank[t]->GetY()*Tank[t]->GetContents();
|
|
|
|
vXYZtank(eZ) += Tank[t]->GetZ()*Tank[t]->GetContents();
|
1999-09-28 14:19:34 +00:00
|
|
|
|
|
|
|
Tw += Tank[t]->GetContents();
|
|
|
|
}
|
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
vXYZcg = (vXYZtank + EmptyWeight*vbaseXYZcg) / (Tw + EmptyWeight);
|
1999-09-28 14:19:34 +00:00
|
|
|
|
|
|
|
// Calculate new moments of inertia here
|
|
|
|
|
|
|
|
IXXt = IYYt = IZZt = IXZt = 0.0;
|
1999-10-07 23:08:48 +00:00
|
|
|
for (t=0; t<numTanks; t++) {
|
2000-04-24 23:49:06 +00:00
|
|
|
IXXt += ((Tank[t]->GetX()-vXYZcg(eX))/12.0)*((Tank[t]->GetX() - vXYZcg(eX))/12.0)*Tank[t]->GetContents()/GRAVITY;
|
|
|
|
IYYt += ((Tank[t]->GetY()-vXYZcg(eY))/12.0)*((Tank[t]->GetY() - vXYZcg(eY))/12.0)*Tank[t]->GetContents()/GRAVITY;
|
|
|
|
IZZt += ((Tank[t]->GetZ()-vXYZcg(eZ))/12.0)*((Tank[t]->GetZ() - vXYZcg(eZ))/12.0)*Tank[t]->GetContents()/GRAVITY;
|
|
|
|
IXZt += ((Tank[t]->GetX()-vXYZcg(eX))/12.0)*((Tank[t]->GetZ() - vXYZcg(eZ))/12.0)*Tank[t]->GetContents()/GRAVITY;
|
1999-09-28 14:19:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Ixx = baseIxx + IXXt;
|
|
|
|
Iyy = baseIyy + IYYt;
|
|
|
|
Izz = baseIzz + IZZt;
|
|
|
|
Ixz = baseIxz + IXZt;
|
|
|
|
|
1999-02-11 21:05:34 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-11 21:05:34 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::FMAero(void) {
|
2000-04-24 23:49:06 +00:00
|
|
|
static FGColumnVector vDXYZcg(3);
|
2000-07-06 21:02:46 +00:00
|
|
|
static FGColumnVector vAeroBodyForces(3);
|
2000-04-24 23:49:06 +00:00
|
|
|
unsigned int axis_ctr,ctr;
|
|
|
|
|
|
|
|
for (axis_ctr=1; axis_ctr<=3; axis_ctr++) vFs(axis_ctr) = 0.0;
|
1999-02-11 21:05:34 +00:00
|
|
|
|
1999-12-30 18:01:59 +00:00
|
|
|
for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
|
2000-04-24 23:49:06 +00:00
|
|
|
for (ctr=0; ctr < Coeff[axis_ctr].size(); ctr++) {
|
2000-10-02 23:07:30 +00:00
|
|
|
vFs(axis_ctr+1) += Coeff[axis_ctr][ctr]->TotalValue();
|
1999-12-30 18:01:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-06 21:02:46 +00:00
|
|
|
vAeroBodyForces = State->GetTs2b(alpha, beta)*vFs;
|
|
|
|
vForces += vAeroBodyForces;
|
2000-10-02 23:07:30 +00:00
|
|
|
|
2000-11-14 20:31:58 +00:00
|
|
|
// see http://home.earthlink.net/~apeden/jsbsim_moments_due_to_forces.txt
|
|
|
|
// for details on this
|
2000-04-24 23:49:06 +00:00
|
|
|
vDXYZcg(eX) = -(vXYZrp(eX) - vXYZcg(eX))/12.0; //cg and rp values are in inches
|
|
|
|
vDXYZcg(eY) = (vXYZrp(eY) - vXYZcg(eY))/12.0;
|
|
|
|
vDXYZcg(eZ) = -(vXYZrp(eZ) - vXYZcg(eZ))/12.0;
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2000-07-06 21:02:46 +00:00
|
|
|
vMoments(eL) += vAeroBodyForces(eZ)*vDXYZcg(eY) - vAeroBodyForces(eY)*vDXYZcg(eZ); // rolling moment
|
|
|
|
vMoments(eM) += vAeroBodyForces(eX)*vDXYZcg(eZ) - vAeroBodyForces(eZ)*vDXYZcg(eX); // pitching moment
|
|
|
|
vMoments(eN) += vAeroBodyForces(eY)*vDXYZcg(eX) - vAeroBodyForces(eX)*vDXYZcg(eY); // yawing moment
|
|
|
|
|
1999-05-08 03:19:08 +00:00
|
|
|
for (axis_ctr = 0; axis_ctr < 3; axis_ctr++) {
|
2000-04-24 23:49:06 +00:00
|
|
|
for (ctr = 0; ctr < Coeff[axis_ctr+3].size(); ctr++) {
|
2000-10-02 23:07:30 +00:00
|
|
|
vMoments(axis_ctr+1) += Coeff[axis_ctr+3][ctr]->TotalValue();
|
1999-05-08 03:19:08 +00:00
|
|
|
}
|
|
|
|
}
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::FMGear(void) {
|
2000-10-02 23:07:30 +00:00
|
|
|
|
2000-10-10 17:44:35 +00:00
|
|
|
if ( !GearUp ) {
|
|
|
|
vector <FGLGear>::iterator iGear = lGear.begin();
|
|
|
|
while (iGear != lGear.end()) {
|
|
|
|
vForces += iGear->Force();
|
|
|
|
vMoments += iGear->Moment();
|
|
|
|
iGear++;
|
1999-12-20 20:24:49 +00:00
|
|
|
}
|
2000-10-10 17:44:35 +00:00
|
|
|
} else {
|
|
|
|
// Crash Routine
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::FMMass(void) {
|
2000-04-24 23:49:06 +00:00
|
|
|
vForces(eX) += -GRAVITY*sin(vEuler(eTht)) * Mass;
|
|
|
|
vForces(eY) += GRAVITY*sin(vEuler(ePhi))*cos(vEuler(eTht)) * Mass;
|
|
|
|
vForces(eZ) += GRAVITY*cos(vEuler(ePhi))*cos(vEuler(eTht)) * Mass;
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::FMProp(void) {
|
2000-07-06 21:02:46 +00:00
|
|
|
for (unsigned int i=0;i<numEngines;i++) {
|
|
|
|
|
|
|
|
// Changes required here for new engine placement parameters (i.e. location and direction)
|
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
vForces(eX) += Engine[i]->CalcThrust();
|
1999-12-20 20:24:49 +00:00
|
|
|
}
|
2000-07-06 21:02:46 +00:00
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::GetState(void) {
|
1999-02-05 21:26:01 +00:00
|
|
|
dt = State->Getdt();
|
1999-02-11 21:05:34 +00:00
|
|
|
|
|
|
|
alpha = Translation->Getalpha();
|
|
|
|
beta = Translation->Getbeta();
|
2000-04-24 23:49:06 +00:00
|
|
|
vEuler = Rotation->GetEuler();
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg) {
|
2000-04-24 23:49:06 +00:00
|
|
|
string token = "";
|
|
|
|
string parameter;
|
|
|
|
|
|
|
|
AC_cfg->GetNextConfigLine();
|
|
|
|
|
|
|
|
while ((token = AC_cfg->GetValue()) != "/METRICS") {
|
|
|
|
*AC_cfg >> parameter;
|
2000-07-06 21:02:46 +00:00
|
|
|
if (parameter == "AC_WINGAREA") {
|
|
|
|
*AC_cfg >> WingArea;
|
|
|
|
cout << " WingArea: " << WingArea << endl;
|
|
|
|
} else if (parameter == "AC_WINGSPAN") {
|
|
|
|
*AC_cfg >> WingSpan;
|
|
|
|
cout << " WingSpan: " << WingSpan << endl;
|
|
|
|
} else if (parameter == "AC_CHORD") {
|
|
|
|
*AC_cfg >> cbar;
|
|
|
|
cout << " Chord: " << cbar << endl;
|
|
|
|
} else if (parameter == "AC_IXX") {
|
|
|
|
*AC_cfg >> baseIxx;
|
|
|
|
cout << " baseIxx: " << baseIxx << endl;
|
|
|
|
} else if (parameter == "AC_IYY") {
|
|
|
|
*AC_cfg >> baseIyy;
|
|
|
|
cout << " baseIyy: " << baseIyy << endl;
|
|
|
|
} else if (parameter == "AC_IZZ") {
|
|
|
|
*AC_cfg >> baseIzz;
|
|
|
|
cout << " baseIzz: " << baseIzz << endl;
|
|
|
|
} else if (parameter == "AC_IXZ") {
|
|
|
|
*AC_cfg >> baseIxz;
|
|
|
|
cout << " baseIxz: " << baseIxz << endl;
|
|
|
|
} else if (parameter == "AC_EMPTYWT") {
|
|
|
|
*AC_cfg >> EmptyWeight;
|
|
|
|
cout << " EmptyWeight: " << EmptyWeight << endl;
|
|
|
|
} else if (parameter == "AC_CGLOC") {
|
|
|
|
*AC_cfg >> vbaseXYZcg(eX) >> vbaseXYZcg(eY) >> vbaseXYZcg(eZ);
|
2000-10-02 23:07:30 +00:00
|
|
|
cout << " CG (x, y, z): " << vbaseXYZcg << endl;
|
2000-07-06 21:02:46 +00:00
|
|
|
} else if (parameter == "AC_EYEPTLOC") {
|
|
|
|
*AC_cfg >> vXYZep(eX) >> vXYZep(eY) >> vXYZep(eZ);
|
2000-10-02 23:07:30 +00:00
|
|
|
cout << " Eyepoint (x, y, z): " << vXYZep << endl;
|
2000-07-06 21:02:46 +00:00
|
|
|
} else if (parameter == "AC_AERORP") {
|
|
|
|
*AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
|
2000-10-02 23:07:30 +00:00
|
|
|
cout << " Ref Pt (x, y, z): " << vXYZrp << endl;
|
2000-07-06 21:02:46 +00:00
|
|
|
} else if (parameter == "AC_ALPHALIMITS") {
|
|
|
|
*AC_cfg >> alphaclmin >> alphaclmax;
|
|
|
|
cout << " Maximum Alpha: " << alphaclmax
|
2000-10-02 23:07:30 +00:00
|
|
|
<< " Minimum Alpha: " << alphaclmin
|
2000-07-06 21:02:46 +00:00
|
|
|
<< endl;
|
|
|
|
}
|
2000-04-24 23:49:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg) {
|
2000-04-24 23:49:06 +00:00
|
|
|
string token;
|
|
|
|
string engine_name;
|
|
|
|
string parameter;
|
|
|
|
|
|
|
|
AC_cfg->GetNextConfigLine();
|
|
|
|
|
|
|
|
while ((token = AC_cfg->GetValue()) != "/PROPULSION") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
|
|
|
|
if (parameter == "AC_ENGINE") {
|
|
|
|
|
|
|
|
*AC_cfg >> engine_name;
|
|
|
|
Engine[numEngines] = new FGEngine(FDMExec, EnginePath, engine_name, numEngines);
|
|
|
|
numEngines++;
|
|
|
|
|
|
|
|
} else if (parameter == "AC_TANK") {
|
|
|
|
|
|
|
|
Tank[numTanks] = new FGTank(AC_cfg);
|
|
|
|
switch(Tank[numTanks]->GetType()) {
|
|
|
|
case FGTank::ttFUEL:
|
|
|
|
numSelectedFuelTanks++;
|
|
|
|
break;
|
|
|
|
case FGTank::ttOXIDIZER:
|
|
|
|
numSelectedOxiTanks++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
numTanks++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg) {
|
2000-04-24 23:49:06 +00:00
|
|
|
string token;
|
|
|
|
|
|
|
|
FCS->LoadFCS(AC_cfg);
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg) {
|
2000-04-24 23:49:06 +00:00
|
|
|
string token, axis;
|
|
|
|
|
|
|
|
AC_cfg->GetNextConfigLine();
|
2000-10-02 23:07:30 +00:00
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
while ((token = AC_cfg->GetValue()) != "/AERODYNAMICS") {
|
|
|
|
if (token == "AXIS") {
|
2000-10-02 23:07:30 +00:00
|
|
|
CoeffArray ca;
|
2000-04-24 23:49:06 +00:00
|
|
|
axis = AC_cfg->GetValue("NAME");
|
|
|
|
AC_cfg->GetNextConfigLine();
|
|
|
|
while ((token = AC_cfg->GetValue()) != "/AXIS") {
|
2000-10-02 23:07:30 +00:00
|
|
|
ca.push_back(new FGCoefficient(FDMExec, AC_cfg));
|
|
|
|
DisplayCoeffFactors(ca.back()->Getmultipliers());
|
2000-04-24 23:49:06 +00:00
|
|
|
}
|
2000-10-02 23:07:30 +00:00
|
|
|
Coeff[AxisIdx[axis]]=ca;
|
2000-04-24 23:49:06 +00:00
|
|
|
AC_cfg->GetNextConfigLine();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg) {
|
2000-04-24 23:49:06 +00:00
|
|
|
string token;
|
|
|
|
|
|
|
|
AC_cfg->GetNextConfigLine();
|
|
|
|
|
|
|
|
while ((token = AC_cfg->GetValue()) != "/UNDERCARRIAGE") {
|
2000-10-10 17:44:35 +00:00
|
|
|
lGear.push_back(FGLGear(AC_cfg, FDMExec));
|
2000-04-24 23:49:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadOutput(FGConfigFile* AC_cfg) {
|
2000-05-02 18:25:30 +00:00
|
|
|
string token, parameter;
|
|
|
|
int OutRate = 0;
|
|
|
|
int subsystems = 0;
|
|
|
|
|
|
|
|
token = AC_cfg->GetValue("NAME");
|
|
|
|
Output->SetFilename(token);
|
|
|
|
token = AC_cfg->GetValue("TYPE");
|
|
|
|
Output->SetType(token);
|
|
|
|
AC_cfg->GetNextConfigLine();
|
|
|
|
|
|
|
|
while ((token = AC_cfg->GetValue()) != "/OUTPUT") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "RATE_IN_HZ") *AC_cfg >> OutRate;
|
|
|
|
if (parameter == "SIMULATION") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssSimulation;
|
|
|
|
}
|
|
|
|
if (parameter == "AEROSURFACES") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssAerosurfaces;
|
|
|
|
}
|
|
|
|
if (parameter == "RATES") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssRates;
|
|
|
|
}
|
|
|
|
if (parameter == "VELOCITIES") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssVelocities;
|
|
|
|
}
|
|
|
|
if (parameter == "FORCES") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssForces;
|
|
|
|
}
|
|
|
|
if (parameter == "MOMENTS") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssMoments;
|
|
|
|
}
|
|
|
|
if (parameter == "ATMOSPHERE") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssAtmosphere;
|
|
|
|
}
|
|
|
|
if (parameter == "MASSPROPS") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssMassProps;
|
|
|
|
}
|
|
|
|
if (parameter == "POSITION") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssPosition;
|
|
|
|
}
|
|
|
|
if (parameter == "COEFFICIENTS") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssCoefficients;
|
|
|
|
}
|
2000-05-27 05:48:14 +00:00
|
|
|
if (parameter == "GROUND_REACTIONS") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssGroundReactions;
|
|
|
|
}
|
2000-11-14 20:31:58 +00:00
|
|
|
if (parameter == "FCS") {
|
|
|
|
*AC_cfg >> parameter;
|
|
|
|
if (parameter == "ON") subsystems += ssFCS;
|
|
|
|
}
|
2000-05-02 18:25:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Output->SetSubsystems(subsystems);
|
|
|
|
|
|
|
|
OutRate = OutRate>120?120:(OutRate<0?0:OutRate);
|
|
|
|
Output->SetRate( (int)(0.5 + 1.0/(State->Getdt()*OutRate)) );
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-05-02 18:25:30 +00:00
|
|
|
|
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
|
|
|
void FGAircraft::ReadPrologue(FGConfigFile* AC_cfg) {
|
2000-04-24 23:49:06 +00:00
|
|
|
string token = AC_cfg->GetValue();
|
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
|
|
|
string scratch;
|
2000-04-24 23:49:06 +00:00
|
|
|
AircraftName = AC_cfg->GetValue("NAME");
|
|
|
|
cout << "Reading Aircraft Configuration File: " << AircraftName << endl;
|
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
|
|
|
scratch=AC_cfg->GetValue("VERSION").c_str();
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
CFGVersion = AC_cfg->GetValue("VERSION");
|
|
|
|
cout << " Version: " << CFGVersion << endl;
|
|
|
|
if (CFGVersion != NEEDED_CFG_VERSION) {
|
|
|
|
cout << endl << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT."
|
|
|
|
" RESULTS WILL BE UNPREDICTABLE !!" << endl;
|
2000-04-24 23:49:06 +00:00
|
|
|
cout << "Current version needed is: " << NEEDED_CFG_VERSION << endl;
|
|
|
|
cout << " You have version: " << CFGVersion << endl << endl;
|
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
|
|
|
//exit(-1);
|
2000-04-24 23:49:06 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
void FGAircraft::DisplayCoeffFactors(vector <eParam> multipliers) {
|
2000-04-24 23:49:06 +00:00
|
|
|
cout << " Non-Dimensionalized by: ";
|
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
for (unsigned int i=0; i<multipliers.size();i++)
|
|
|
|
cout << State->paramdef[multipliers[i]];
|
2000-04-24 23:49:06 +00:00
|
|
|
|
|
|
|
cout << endl;
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
1999-05-08 03:19:08 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-04-24 23:49:06 +00:00
|
|
|
|
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
|
|
|
string FGAircraft::GetCoefficientStrings(void) {
|
2000-05-02 18:25:30 +00:00
|
|
|
string CoeffStrings = "";
|
|
|
|
bool firstime = true;
|
|
|
|
|
|
|
|
for (unsigned int axis = 0; axis < 6; axis++) {
|
|
|
|
for (unsigned int sd = 0; sd < Coeff[axis].size(); sd++) {
|
|
|
|
if (firstime) {
|
|
|
|
firstime = false;
|
|
|
|
} else {
|
|
|
|
CoeffStrings += ", ";
|
|
|
|
}
|
2000-10-02 23:07:30 +00:00
|
|
|
CoeffStrings += Coeff[axis][sd]->Getname();
|
2000-05-02 18:25:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return CoeffStrings;
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-05-02 18:25:30 +00:00
|
|
|
|
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
|
|
|
string FGAircraft::GetCoefficientValues(void) {
|
2000-05-02 18:25:30 +00:00
|
|
|
string SDValues = "";
|
|
|
|
char buffer[10];
|
|
|
|
bool firstime = true;
|
|
|
|
|
|
|
|
for (unsigned int axis = 0; axis < 6; axis++) {
|
|
|
|
for (unsigned int sd = 0; sd < Coeff[axis].size(); sd++) {
|
|
|
|
if (firstime) {
|
|
|
|
firstime = false;
|
|
|
|
} else {
|
|
|
|
SDValues += ", ";
|
|
|
|
}
|
2000-10-02 23:07:30 +00:00
|
|
|
sprintf(buffer, "%9.6f", Coeff[axis][sd]->GetSD());
|
2000-05-02 18:25:30 +00:00
|
|
|
SDValues += string(buffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
return SDValues;
|
2000-05-02 18:25:30 +00:00
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-05-27 05:48:14 +00:00
|
|
|
|
|
|
|
string FGAircraft::GetGroundReactionStrings(void) {
|
|
|
|
string GroundReactionStrings = "";
|
|
|
|
bool firstime = true;
|
|
|
|
|
|
|
|
for (unsigned int i=0;i<lGear.size();i++) {
|
|
|
|
if (!firstime) GroundReactionStrings += ", ";
|
2000-10-10 17:44:35 +00:00
|
|
|
GroundReactionStrings += (lGear[i].GetName() + "_WOW, ");
|
|
|
|
GroundReactionStrings += (lGear[i].GetName() + "_compressLength, ");
|
|
|
|
GroundReactionStrings += (lGear[i].GetName() + "_compressSpeed, ");
|
|
|
|
GroundReactionStrings += (lGear[i].GetName() + "_Force");
|
2000-05-27 05:48:14 +00:00
|
|
|
|
|
|
|
firstime = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GroundReactionStrings;
|
|
|
|
}
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2000-05-27 05:48:14 +00:00
|
|
|
|
|
|
|
string FGAircraft::GetGroundReactionValues(void) {
|
|
|
|
char buff[20];
|
|
|
|
string GroundReactionValues = "";
|
|
|
|
|
|
|
|
bool firstime = true;
|
|
|
|
|
|
|
|
for (unsigned int i=0;i<lGear.size();i++) {
|
|
|
|
if (!firstime) GroundReactionValues += ", ";
|
2000-10-10 17:44:35 +00:00
|
|
|
GroundReactionValues += string( lGear[i].GetWOW()?"1":"0" ) + ", ";
|
|
|
|
GroundReactionValues += (string(gcvt(lGear[i].GetCompLen(), 5, buff)) + ", ");
|
|
|
|
GroundReactionValues += (string(gcvt(lGear[i].GetCompVel(), 6, buff)) + ", ");
|
|
|
|
GroundReactionValues += (string(gcvt(lGear[i].GetCompForce(), 10, buff)));
|
2000-05-27 05:48:14 +00:00
|
|
|
|
|
|
|
firstime = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GroundReactionValues;
|
|
|
|
}
|
2000-04-24 23:49:06 +00:00
|
|
|
|