2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2004-06-14 11:40:45 +00:00
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
Module: FGAuxiliary.cpp
|
2001-06-05 20:58:48 +00:00
|
|
|
Author: Tony Peden, Jon Berndt
|
1999-02-05 21:26:01 +00:00
|
|
|
Date started: 01/26/99
|
|
|
|
Purpose: Calculates additional parameters needed by the visual system, etc.
|
|
|
|
Called by: FGSimExec
|
2004-06-14 11:40:45 +00:00
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
|
2004-06-14 11:40:45 +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.
|
2004-06-14 11:40:45 +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.
|
2001-03-30 01:04:50 +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.
|
2001-03-30 01:04:50 +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.
|
2001-03-30 01:04:50 +00:00
|
|
|
|
1999-02-05 21:26:01 +00:00
|
|
|
FUNCTIONAL DESCRIPTION
|
|
|
|
--------------------------------------------------------------------------------
|
2000-04-24 23:49:06 +00:00
|
|
|
This class calculates various auxiliary parameters.
|
2001-03-30 01:04:50 +00:00
|
|
|
|
2000-01-10 21:07:00 +00:00
|
|
|
REFERENCES
|
2000-04-24 23:49:06 +00:00
|
|
|
Anderson, John D. "Introduction to Flight", 3rd Edition, McGraw-Hill, 1989
|
|
|
|
pgs. 112-126
|
1999-02-05 21:26:01 +00:00
|
|
|
HISTORY
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
01/26/99 JSB Created
|
2001-03-30 01:04:50 +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-02-05 21:26:01 +00:00
|
|
|
|
|
|
|
#include "FGAuxiliary.h"
|
2002-09-22 15:31:09 +00:00
|
|
|
#include "FGAerodynamics.h"
|
2004-06-14 11:40:45 +00:00
|
|
|
#include "FGPropagate.h"
|
1999-02-11 21:05:34 +00:00
|
|
|
#include "FGAtmosphere.h"
|
|
|
|
#include "FGState.h"
|
|
|
|
#include "FGFDMExec.h"
|
|
|
|
#include "FGAircraft.h"
|
2001-10-05 20:19:59 +00:00
|
|
|
#include "FGInertial.h"
|
2002-03-20 12:45:02 +00:00
|
|
|
#include "FGPropertyManager.h"
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2003-01-24 12:55:28 +00:00
|
|
|
namespace JSBSim {
|
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
static const char *IdSrc = "$Id$";
|
2000-10-14 02:10:10 +00:00
|
|
|
static const char *IdHdr = ID_AUXILIARY;
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
CLASS IMPLEMENTATION
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
|
2001-12-07 17:10:17 +00:00
|
|
|
FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
|
2001-06-05 20:58:48 +00:00
|
|
|
{
|
1999-02-26 22:09:10 +00:00
|
|
|
Name = "FGAuxiliary";
|
2004-06-14 11:40:45 +00:00
|
|
|
vcas = veas = pt = tat = 0;
|
2000-04-24 23:49:06 +00:00
|
|
|
psl = rhosl = 1;
|
2000-08-04 03:20:09 +00:00
|
|
|
earthPosAngle = 0.0;
|
2004-06-14 11:40:45 +00:00
|
|
|
qbar = 0;
|
|
|
|
qbarUW = 0.0;
|
|
|
|
qbarUV = 0.0;
|
|
|
|
Mach = 0.0;
|
|
|
|
alpha = beta = 0.0;
|
|
|
|
adot = bdot = 0.0;
|
|
|
|
gamma = Vt = Vground = 0.0;
|
|
|
|
psigt = 0.0;
|
|
|
|
day_of_year = 1;
|
|
|
|
seconds_in_day = 0.0;
|
|
|
|
hoverbmac = hoverbcg = 0.0;
|
|
|
|
|
|
|
|
vPilotAccel.InitMatrix();
|
2002-03-20 12:45:02 +00:00
|
|
|
vPilotAccelN.InitMatrix();
|
2004-06-14 11:40:45 +00:00
|
|
|
vToEyePt.InitMatrix();
|
|
|
|
vAeroPQR.InitMatrix();
|
|
|
|
vEulerRates.InitMatrix();
|
|
|
|
|
2002-09-22 15:31:09 +00:00
|
|
|
bind();
|
2004-06-14 11:40:45 +00:00
|
|
|
|
2001-12-24 13:54:55 +00:00
|
|
|
Debug(0);
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
FGAuxiliary::~FGAuxiliary()
|
|
|
|
{
|
2002-09-29 13:33:53 +00:00
|
|
|
unbind();
|
2001-12-24 13:54:55 +00:00
|
|
|
Debug(1);
|
2001-03-30 01:04:50 +00:00
|
|
|
}
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-02-05 21:26:01 +00:00
|
|
|
|
2001-06-05 20:58:48 +00:00
|
|
|
bool FGAuxiliary::Run()
|
|
|
|
{
|
2004-06-14 11:40:45 +00:00
|
|
|
double A,B,D, hdot_Vt;
|
|
|
|
const FGColumnVector3& vPQR = Propagate->GetPQR();
|
|
|
|
const FGColumnVector3& vUVW = Propagate->GetUVW();
|
|
|
|
const FGColumnVector3& vUVWdot = Propagate->GetUVWdot();
|
|
|
|
const FGColumnVector3& vVel = Propagate->GetVel();
|
|
|
|
|
|
|
|
if (!FGModel::Run())
|
|
|
|
{
|
|
|
|
p = Atmosphere->GetPressure();
|
|
|
|
rhosl = Atmosphere->GetDensitySL();
|
|
|
|
psl = Atmosphere->GetPressureSL();
|
|
|
|
sat = Atmosphere->GetTemperature();
|
|
|
|
|
|
|
|
// Rotation
|
|
|
|
|
2004-09-11 12:41:05 +00:00
|
|
|
double cTht = Propagate->GetCosEuler(eTht);
|
|
|
|
double cPhi = Propagate->GetCosEuler(ePhi);
|
|
|
|
double sPhi = Propagate->GetSinEuler(ePhi);
|
2004-06-14 11:40:45 +00:00
|
|
|
|
|
|
|
vEulerRates(eTht) = vPQR(eQ)*cPhi - vPQR(eR)*sPhi;
|
|
|
|
if (cTht != 0.0) {
|
|
|
|
vEulerRates(ePsi) = (vPQR(eQ)*sPhi + vPQR(eR)*cPhi)/cTht;
|
|
|
|
vEulerRates(ePhi) = vPQR(eP) + vEulerRates(ePsi)*sPhi;
|
|
|
|
}
|
|
|
|
|
|
|
|
vAeroPQR = vPQR + Atmosphere->GetTurbPQR();
|
|
|
|
|
|
|
|
// Translation
|
|
|
|
|
|
|
|
vAeroUVW = vUVW + Propagate->GetTl2b()*Atmosphere->GetWindNED();
|
|
|
|
|
|
|
|
Vt = vAeroUVW.Magnitude();
|
|
|
|
if ( Vt > 0.05) {
|
|
|
|
if (vAeroUVW(eW) != 0.0)
|
|
|
|
alpha = vAeroUVW(eU)*vAeroUVW(eU) > 0.0 ? atan2(vAeroUVW(eW), vAeroUVW(eU)) : 0.0;
|
|
|
|
if (vAeroUVW(eV) != 0.0)
|
|
|
|
beta = vAeroUVW(eU)*vAeroUVW(eU)+vAeroUVW(eW)*vAeroUVW(eW) > 0.0 ? atan2(vAeroUVW(eV),
|
|
|
|
sqrt(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW))) : 0.0;
|
|
|
|
|
|
|
|
double mUW = (vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
|
|
|
|
double signU=1;
|
|
|
|
if (vAeroUVW(eU) != 0.0)
|
|
|
|
signU = vAeroUVW(eU)/fabs(vAeroUVW(eU));
|
|
|
|
|
|
|
|
if ( (mUW == 0.0) || (Vt == 0.0) ) {
|
|
|
|
adot = 0.0;
|
|
|
|
bdot = 0.0;
|
|
|
|
} else {
|
|
|
|
adot = (vAeroUVW(eU)*vUVWdot(eW) - vAeroUVW(eW)*vUVWdot(eU))/mUW;
|
|
|
|
bdot = (signU*mUW*vUVWdot(eV) - vAeroUVW(eV)*(vAeroUVW(eU)*vUVWdot(eU)
|
|
|
|
+ vAeroUVW(eW)*vUVWdot(eW)))/(Vt*Vt*sqrt(mUW));
|
|
|
|
}
|
2001-06-05 20:58:48 +00:00
|
|
|
} else {
|
2004-06-14 11:40:45 +00:00
|
|
|
alpha = beta = adot = bdot = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
qbar = 0.5*Atmosphere->GetDensity()*Vt*Vt;
|
|
|
|
qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
|
|
|
|
qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
|
|
|
|
Mach = Vt / Atmosphere->GetSoundSpeed();
|
|
|
|
MachU = vMachUVW(eU) = vAeroUVW(eU) / Atmosphere->GetSoundSpeed();
|
|
|
|
vMachUVW(eV) = vAeroUVW(eV) / Atmosphere->GetSoundSpeed();
|
|
|
|
vMachUVW(eW) = vAeroUVW(eW) / Atmosphere->GetSoundSpeed();
|
|
|
|
|
|
|
|
// Position
|
|
|
|
|
|
|
|
Vground = sqrt( vVel(eNorth)*vVel(eNorth) + vVel(eEast)*vVel(eEast) );
|
|
|
|
|
|
|
|
if (vVel(eNorth) == 0) psigt = 0;
|
|
|
|
else psigt = atan2(vVel(eEast), vVel(eNorth));
|
|
|
|
|
|
|
|
if (psigt < 0.0) psigt += 2*M_PI;
|
2000-04-24 23:49:06 +00:00
|
|
|
|
2004-06-14 11:40:45 +00:00
|
|
|
if (Vt != 0) {
|
|
|
|
hdot_Vt = -vVel(eDown)/Vt;
|
|
|
|
if (fabs(hdot_Vt) <= 1) gamma = asin(hdot_Vt);
|
|
|
|
} else {
|
|
|
|
gamma = 0.0;
|
|
|
|
}
|
2000-04-24 23:49:06 +00:00
|
|
|
|
2004-06-14 11:40:45 +00:00
|
|
|
tat = sat*(1 + 0.2*Mach*Mach); // Total Temperature, isentropic flow
|
|
|
|
tatc = RankineToCelsius(tat);
|
2000-04-24 23:49:06 +00:00
|
|
|
|
2004-06-14 11:40:45 +00:00
|
|
|
if (MachU < 1) { // Calculate total pressure assuming isentropic flow
|
|
|
|
pt = p*pow((1 + 0.2*MachU*MachU),3.5);
|
|
|
|
} else {
|
|
|
|
// Use Rayleigh pitot tube formula for normal shock in front of pitot tube
|
|
|
|
B = 5.76*MachU*MachU/(5.6*MachU*MachU - 0.8);
|
|
|
|
D = (2.8*MachU*MachU-0.4)*0.4167;
|
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
|
|
|
pt = p*pow(B,3.5)*D;
|
|
|
|
}
|
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
|
|
|
A = pow(((pt-p)/psl+1),0.28571);
|
2004-06-14 11:40:45 +00:00
|
|
|
if (MachU > 0.0) {
|
2004-01-14 22:09:39 +00:00
|
|
|
vcas = sqrt(7*psl/rhosl*(A-1));
|
|
|
|
veas = sqrt(2*qbar/rhosl);
|
|
|
|
} else {
|
|
|
|
vcas = veas = 0.0;
|
|
|
|
}
|
2001-03-30 01:04:50 +00:00
|
|
|
|
2004-06-14 11:40:45 +00:00
|
|
|
vPilotAccel.InitMatrix();
|
|
|
|
if ( Vt > 1.0 ) {
|
|
|
|
vPilotAccel = Aerodynamics->GetForces()
|
2004-02-14 10:19:56 +00:00
|
|
|
+ Propulsion->GetForces()
|
|
|
|
+ GroundReactions->GetForces();
|
2002-09-29 14:13:39 +00:00
|
|
|
vPilotAccel /= MassBalance->GetMass();
|
2004-02-14 10:19:56 +00:00
|
|
|
vToEyePt = MassBalance->StructuralToBody(Aircraft->GetXYZep());
|
2004-06-14 11:40:45 +00:00
|
|
|
vPilotAccel += Propagate->GetPQRdot() * vToEyePt;
|
|
|
|
vPilotAccel += vPQR * (vPQR * vToEyePt);
|
2002-09-29 14:13:39 +00:00
|
|
|
} else {
|
2004-06-14 11:40:45 +00:00
|
|
|
vPilotAccel = Propagate->GetTl2b() * FGColumnVector3( 0.0, 0.0, Inertial->gravity() );
|
|
|
|
}
|
2002-09-29 14:13:39 +00:00
|
|
|
|
|
|
|
vPilotAccelN = vPilotAccel/Inertial->gravity();
|
2004-02-14 10:19:56 +00:00
|
|
|
|
2001-11-12 16:06:29 +00:00
|
|
|
earthPosAngle += State->Getdt()*Inertial->omega();
|
2004-06-14 11:40:45 +00:00
|
|
|
|
|
|
|
// VRP computation
|
|
|
|
const FGLocation& vLocation = Propagate->GetLocation();
|
|
|
|
FGColumnVector3 vrpStructural = Aircraft->GetXYZvrp();
|
|
|
|
FGColumnVector3 vrpBody = MassBalance->StructuralToBody( vrpStructural );
|
|
|
|
FGColumnVector3 vrpLocal = Propagate->GetTb2l() * vrpBody;
|
|
|
|
vLocationVRP = vLocation.LocalToLocation( vrpLocal );
|
|
|
|
|
|
|
|
// Recompute some derived values now that we know the dependent parameters values ...
|
|
|
|
hoverbcg = Propagate->GetDistanceAGL() / Aircraft->GetWingSpan();
|
|
|
|
|
|
|
|
FGColumnVector3 vMac = Propagate->GetTb2l()*MassBalance->StructuralToBody(Aircraft->GetXYZrp());
|
|
|
|
hoverbmac = (Propagate->GetDistanceAGL() + vMac(3)) / Aircraft->GetWingSpan();
|
|
|
|
|
2001-06-05 20:58:48 +00:00
|
|
|
return false;
|
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
|
|
|
} else {
|
2001-06-05 20:58:48 +00:00
|
|
|
return true;
|
1999-02-05 21:26:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2001-11-20 22:34:24 +00:00
|
|
|
double FGAuxiliary::GetHeadWind(void)
|
2001-06-05 20:58:48 +00:00
|
|
|
{
|
2004-06-14 11:40:45 +00:00
|
|
|
double psiw,vw;
|
2001-03-30 01:04:50 +00:00
|
|
|
|
|
|
|
psiw = Atmosphere->GetWindPsi();
|
|
|
|
vw = Atmosphere->GetWindNED().Magnitude();
|
2001-06-05 20:58:48 +00:00
|
|
|
|
2004-09-11 12:41:05 +00:00
|
|
|
return vw*cos(psiw - Propagate->GetEuler(ePsi));
|
2001-03-30 01:04:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2001-11-20 22:34:24 +00:00
|
|
|
double FGAuxiliary::GetCrossWind(void)
|
2001-06-05 20:58:48 +00:00
|
|
|
{
|
2004-06-14 11:40:45 +00:00
|
|
|
double psiw,vw;
|
2001-03-30 01:04:50 +00:00
|
|
|
|
|
|
|
psiw = Atmosphere->GetWindPsi();
|
|
|
|
vw = Atmosphere->GetWindNED().Magnitude();
|
2001-06-05 20:58:48 +00:00
|
|
|
|
2004-09-11 12:41:05 +00:00
|
|
|
return vw*sin(psiw - Propagate->GetEuler(ePsi));
|
2001-03-30 01:04:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2002-04-16 13:15:29 +00:00
|
|
|
void FGAuxiliary::bind(void)
|
|
|
|
{
|
2002-04-30 13:42:26 +00:00
|
|
|
typedef double (FGAuxiliary::*PMF)(int) const;
|
2004-06-14 11:40:45 +00:00
|
|
|
typedef double (FGAuxiliary::*PF)(void) const;
|
|
|
|
PropertyManager->Tie("velocities/vc-fps", this, &FGAuxiliary::GetVcalibratedFPS);
|
|
|
|
PropertyManager->Tie("velocities/vc-kts", this, &FGAuxiliary::GetVcalibratedKTS);
|
|
|
|
PropertyManager->Tie("velocities/ve-fps", this, &FGAuxiliary::GetVequivalentFPS);
|
|
|
|
PropertyManager->Tie("velocities/ve-kts", this, &FGAuxiliary::GetVequivalentKTS);
|
|
|
|
PropertyManager->Tie("velocities/machU", this, &FGAuxiliary::GetMachU);
|
|
|
|
PropertyManager->Tie("velocities/tat-r", this, &FGAuxiliary::GetTotalTemperature);
|
|
|
|
PropertyManager->Tie("velocities/tat-c", this, &FGAuxiliary::GetTAT_C);
|
|
|
|
PropertyManager->Tie("velocities/pt-lbs_sqft", this, &FGAuxiliary::GetTotalPressure);
|
|
|
|
PropertyManager->Tie("velocities/p-aero-rad_sec", this, eX, (PMF)&FGAuxiliary::GetAeroPQR);
|
|
|
|
PropertyManager->Tie("velocities/q-aero-rad_sec", this, eY, (PMF)&FGAuxiliary::GetAeroPQR);
|
|
|
|
PropertyManager->Tie("velocities/r-aero-rad_sec", this, eZ, (PMF)&FGAuxiliary::GetAeroPQR);
|
|
|
|
PropertyManager->Tie("velocities/phidot-rad_sec", this, ePhi, (PMF)&FGAuxiliary::GetEulerRates);
|
|
|
|
PropertyManager->Tie("velocities/thetadot-rad_sec", this, eTht, (PMF)&FGAuxiliary::GetEulerRates);
|
|
|
|
PropertyManager->Tie("velocities/psidot-rad_sec", this, ePsi, (PMF)&FGAuxiliary::GetEulerRates);
|
|
|
|
PropertyManager->Tie("velocities/u-aero-fps", this, eU, (PMF)&FGAuxiliary::GetAeroUVW);
|
|
|
|
PropertyManager->Tie("velocities/v-aero-fps", this, eV, (PMF)&FGAuxiliary::GetAeroUVW);
|
|
|
|
PropertyManager->Tie("velocities/w-aero-fps", this, eW, (PMF)&FGAuxiliary::GetAeroUVW);
|
|
|
|
PropertyManager->Tie("velocities/vt-fps", this, &FGAuxiliary::GetVt, &FGAuxiliary::SetVt, true);
|
|
|
|
PropertyManager->Tie("velocities/mach-norm", this, &FGAuxiliary::GetMach, &FGAuxiliary::SetMach, true);
|
|
|
|
PropertyManager->Tie("velocities/vg-fps", this, &FGAuxiliary::GetVground);
|
|
|
|
PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this, eX, (PMF)&FGAuxiliary::GetPilotAccel);
|
|
|
|
PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this, eY, (PMF)&FGAuxiliary::GetPilotAccel);
|
|
|
|
PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this, eZ, (PMF)&FGAuxiliary::GetPilotAccel);
|
|
|
|
PropertyManager->Tie("accelerations/n-pilot-x-norm", this, eX, (PMF)&FGAuxiliary::GetNpilot);
|
|
|
|
PropertyManager->Tie("accelerations/n-pilot-y-norm", this, eY, (PMF)&FGAuxiliary::GetNpilot);
|
|
|
|
PropertyManager->Tie("accelerations/n-pilot-z-norm", this, eZ, (PMF)&FGAuxiliary::GetNpilot);
|
|
|
|
PropertyManager->Tie("position/epa-rad", this, &FGAuxiliary::GetEarthPositionAngle);
|
|
|
|
/* PropertyManager->Tie("atmosphere/headwind-fps", this, &FGAuxiliary::GetHeadWind, true);
|
|
|
|
PropertyManager->Tie("atmosphere/crosswind-fps", this, &FGAuxiliary::GetCrossWind, true); */
|
|
|
|
PropertyManager->Tie("aero/alpha-rad", this, (PF)&FGAuxiliary::Getalpha, &FGAuxiliary::Setalpha, true);
|
|
|
|
PropertyManager->Tie("aero/beta-rad", this, (PF)&FGAuxiliary::Getbeta, &FGAuxiliary::Setbeta, true);
|
|
|
|
PropertyManager->Tie("aero/mag-beta-rad", this, (PF)&FGAuxiliary::GetMagBeta);
|
|
|
|
PropertyManager->Tie("aero/alpha-deg", this, inDegrees, (PMF)&FGAuxiliary::Getalpha);
|
|
|
|
PropertyManager->Tie("aero/beta-deg", this, inDegrees, (PMF)&FGAuxiliary::Getbeta);
|
|
|
|
PropertyManager->Tie("aero/mag-beta-deg", this, inDegrees, (PMF)&FGAuxiliary::GetMagBeta);
|
|
|
|
PropertyManager->Tie("aero/qbar-psf", this, &FGAuxiliary::Getqbar, &FGAuxiliary::Setqbar, true);
|
|
|
|
PropertyManager->Tie("aero/qbarUW-psf", this, &FGAuxiliary::GetqbarUW, &FGAuxiliary::SetqbarUW, true);
|
|
|
|
PropertyManager->Tie("aero/qbarUV-psf", this, &FGAuxiliary::GetqbarUV, &FGAuxiliary::SetqbarUV, true);
|
|
|
|
PropertyManager->Tie("aero/alphadot-rad_sec", this, (PF)&FGAuxiliary::Getadot, &FGAuxiliary::Setadot, true);
|
|
|
|
PropertyManager->Tie("aero/betadot-rad_sec", this, (PF)&FGAuxiliary::Getbdot, &FGAuxiliary::Setbdot, true);
|
|
|
|
PropertyManager->Tie("aero/alphadot-deg_sec", this, inDegrees, (PMF)&FGAuxiliary::Getadot);
|
|
|
|
PropertyManager->Tie("aero/betadot-deg_sec", this, inDegrees, (PMF)&FGAuxiliary::Getbdot);
|
|
|
|
PropertyManager->Tie("aero/h_b-cg-ft", this, &FGAuxiliary::GetHOverBCG);
|
|
|
|
PropertyManager->Tie("aero/h_b-mac-ft", this, &FGAuxiliary::GetHOverBMAC);
|
|
|
|
PropertyManager->Tie("flight-path/gamma-rad", this, &FGAuxiliary::GetGamma, &FGAuxiliary::SetGamma);
|
|
|
|
PropertyManager->Tie("flight-path/psi-gt-rad", this, &FGAuxiliary::GetGroundTrack);
|
2002-04-16 13:15:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
void FGAuxiliary::unbind(void)
|
|
|
|
{
|
|
|
|
PropertyManager->Untie("velocities/vc-fps");
|
|
|
|
PropertyManager->Untie("velocities/vc-kts");
|
|
|
|
PropertyManager->Untie("velocities/ve-fps");
|
|
|
|
PropertyManager->Untie("velocities/ve-kts");
|
2004-01-14 22:09:39 +00:00
|
|
|
PropertyManager->Untie("velocities/machU");
|
|
|
|
PropertyManager->Untie("velocities/tat-r");
|
|
|
|
PropertyManager->Untie("velocities/tat-c");
|
2004-06-14 11:40:45 +00:00
|
|
|
PropertyManager->Untie("velocities/p-aero-rad_sec");
|
|
|
|
PropertyManager->Untie("velocities/q-aero-rad_sec");
|
|
|
|
PropertyManager->Untie("velocities/r-aero-rad_sec");
|
|
|
|
PropertyManager->Untie("velocities/pt-lbs_sqft");
|
|
|
|
PropertyManager->Untie("velocities/phidot-rad_sec");
|
|
|
|
PropertyManager->Untie("velocities/thetadot-rad_sec");
|
|
|
|
PropertyManager->Untie("velocities/psidot-rad_sec");
|
|
|
|
PropertyManager->Untie("velocities/u-aero-fps");
|
|
|
|
PropertyManager->Untie("velocities/v-aero-fps");
|
|
|
|
PropertyManager->Untie("velocities/w-aero-fps");
|
|
|
|
PropertyManager->Untie("velocities/vt-fps");
|
|
|
|
PropertyManager->Untie("velocities/mach-norm");
|
|
|
|
PropertyManager->Untie("velocities/vg-fps");
|
2002-04-16 13:15:29 +00:00
|
|
|
PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
|
|
|
|
PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
|
|
|
|
PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
|
|
|
|
PropertyManager->Untie("accelerations/n-pilot-x-norm");
|
|
|
|
PropertyManager->Untie("accelerations/n-pilot-y-norm");
|
|
|
|
PropertyManager->Untie("accelerations/n-pilot-z-norm");
|
|
|
|
PropertyManager->Untie("position/epa-rad");
|
|
|
|
/* PropertyManager->Untie("atmosphere/headwind-fps");
|
|
|
|
PropertyManager->Untie("atmosphere/crosswind-fps"); */
|
2004-06-14 11:40:45 +00:00
|
|
|
PropertyManager->Untie("aero/qbar-psf");
|
|
|
|
PropertyManager->Untie("aero/qbarUW-psf");
|
|
|
|
PropertyManager->Untie("aero/qbarUV-psf");
|
|
|
|
PropertyManager->Untie("aero/alpha-rad");
|
|
|
|
PropertyManager->Untie("aero/beta-rad");
|
|
|
|
PropertyManager->Untie("aero/alpha-deg");
|
|
|
|
PropertyManager->Untie("aero/beta-deg");
|
|
|
|
PropertyManager->Untie("aero/alphadot-rad_sec");
|
|
|
|
PropertyManager->Untie("aero/betadot-rad_sec");
|
|
|
|
PropertyManager->Untie("aero/mag-beta-rad");
|
|
|
|
PropertyManager->Untie("aero/alphadot-deg_sec");
|
|
|
|
PropertyManager->Untie("aero/betadot-deg_sec");
|
|
|
|
PropertyManager->Untie("aero/mag-beta-deg");
|
|
|
|
PropertyManager->Untie("aero/h_b-cg-ft");
|
|
|
|
PropertyManager->Untie("aero/h_b-mac-ft");
|
|
|
|
PropertyManager->Untie("flight-path/gamma-rad");
|
|
|
|
PropertyManager->Untie("flight-path/psi-gt-rad");
|
2000-04-24 23:49:06 +00:00
|
|
|
}
|
2000-01-10 21:07:00 +00:00
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2001-12-24 13:54:55 +00:00
|
|
|
// The bitmasked value choices are as follows:
|
|
|
|
// unset: In this case (the default) JSBSim would only print
|
|
|
|
// out the normally expected messages, essentially echoing
|
|
|
|
// the config files as they are read. If the environment
|
|
|
|
// variable is not set, debug_lvl is set to 1 internally
|
|
|
|
// 0: This requests JSBSim not to output any messages
|
|
|
|
// whatsoever.
|
|
|
|
// 1: This value explicity requests the normal JSBSim
|
|
|
|
// startup messages
|
|
|
|
// 2: This value asks for a message to be printed out when
|
|
|
|
// a class is instantiated
|
|
|
|
// 4: When this value is set, a message is displayed when a
|
|
|
|
// FGModel object executes its Run() method
|
|
|
|
// 8: When this value is set, various runtime state variables
|
|
|
|
// are printed out periodically
|
|
|
|
// 16: When set various parameters are sanity checked and
|
|
|
|
// a message is printed out when they go out of bounds
|
2001-03-30 01:04:50 +00:00
|
|
|
|
2001-12-13 04:48:34 +00:00
|
|
|
void FGAuxiliary::Debug(int from)
|
2001-03-30 01:04:50 +00:00
|
|
|
{
|
2001-12-24 13:54:55 +00:00
|
|
|
if (debug_lvl <= 0) return;
|
|
|
|
|
|
|
|
if (debug_lvl & 1) { // Standard console startup message output
|
|
|
|
if (from == 0) { // Constructor
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (debug_lvl & 2 ) { // Instantiation/Destruction notification
|
|
|
|
if (from == 0) cout << "Instantiated: FGAuxiliary" << endl;
|
|
|
|
if (from == 1) cout << "Destroyed: FGAuxiliary" << endl;
|
|
|
|
}
|
|
|
|
if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
|
|
|
|
}
|
|
|
|
if (debug_lvl & 8 ) { // Runtime state variables
|
|
|
|
}
|
|
|
|
if (debug_lvl & 16) { // Sanity checking
|
2004-06-14 11:40:45 +00:00
|
|
|
if (Mach > 100 || Mach < 0.00)
|
|
|
|
cout << "FGPropagate::Mach is out of bounds: " << Mach << endl;
|
|
|
|
if (qbar > 1e6 || qbar < 0.00)
|
|
|
|
cout << "FGPropagate::qbar is out of bounds: " << qbar << endl;
|
2001-12-24 13:54:55 +00:00
|
|
|
}
|
|
|
|
if (debug_lvl & 64) {
|
|
|
|
if (from == 0) { // Constructor
|
|
|
|
cout << IdSrc << endl;
|
|
|
|
cout << IdHdr << endl;
|
|
|
|
}
|
|
|
|
}
|
2001-03-30 01:04:50 +00:00
|
|
|
}
|
|
|
|
|
2003-01-24 12:55:28 +00:00
|
|
|
} // namespace JSBSim
|