Curt Olson:
Sync with most current JSBSim CVS.
This commit is contained in:
parent
8e5a884428
commit
95440173ca
82 changed files with 1502 additions and 1085 deletions
|
@ -107,7 +107,7 @@ bool FGAerodynamics::Run(void)
|
||||||
if (!FGModel::Run()) {
|
if (!FGModel::Run()) {
|
||||||
|
|
||||||
twovel = 2*Translation->GetVt();
|
twovel = 2*Translation->GetVt();
|
||||||
if (twovel > 0) {
|
if (twovel != 0) {
|
||||||
bi2vel = Aircraft->GetWingSpan() / twovel;
|
bi2vel = Aircraft->GetWingSpan() / twovel;
|
||||||
ci2vel = Aircraft->Getcbar() / twovel;
|
ci2vel = Aircraft->Getcbar() / twovel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,9 +80,17 @@ CLASS DOCUMENTATION
|
||||||
This class owns and contains the list of coefficients that define the
|
This class owns and contains the list of coefficients that define the
|
||||||
aerodynamic properties of this aircraft. Here also, such unique phenomena
|
aerodynamic properties of this aircraft. Here also, such unique phenomena
|
||||||
as ground effect and maximum lift curve tailoff are handled.
|
as ground effect and maximum lift curve tailoff are handled.
|
||||||
@author Jon S. Berndt
|
@config
|
||||||
@author Tony Peden
|
<pre>
|
||||||
@version $Id$
|
\<AERODYNAMICS>
|
||||||
|
\<AXIS NAME="{LIFT|DRAG|SIDE|ROLL|PITCH|YAW}">
|
||||||
|
{Coefficient definitions}
|
||||||
|
\</AXIS>
|
||||||
|
{Additional axis definitions}
|
||||||
|
\</AERODYNAMICS> </pre>
|
||||||
|
|
||||||
|
@author Jon S. Berndt, Tony Peden
|
||||||
|
$Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -232,6 +232,10 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
|
||||||
} else if (parameter == "AC_AERORP") {
|
} else if (parameter == "AC_AERORP") {
|
||||||
*AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
|
*AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
|
||||||
if (debug_lvl > 0) cout << " Ref Pt (x, y, z): " << vXYZrp << endl;
|
if (debug_lvl > 0) cout << " Ref Pt (x, y, z): " << vXYZrp << endl;
|
||||||
|
} else if (parameter == "AC_VRP") {
|
||||||
|
*AC_cfg >> vXYZvrp(eX) >> vXYZvrp(eY) >> vXYZvrp(eZ);
|
||||||
|
if (debug_lvl > 0) cout << " Visual Ref Pt (x, y, z): " << vXYZvrp << endl;
|
||||||
|
Position->SetVRP(vXYZvrp);
|
||||||
} else if (parameter == "AC_POINTMASS") {
|
} else if (parameter == "AC_POINTMASS") {
|
||||||
*AC_cfg >> pmWt >> pmX >> pmY >> pmZ;
|
*AC_cfg >> pmWt >> pmX >> pmY >> pmZ;
|
||||||
MassBalance->AddPointMass(pmWt, pmX, pmY, pmZ);
|
MassBalance->AddPointMass(pmWt, pmX, pmY, pmZ);
|
||||||
|
@ -306,6 +310,12 @@ void FGAircraft::bind(void)
|
||||||
(PMF)&FGAircraft::GetXYZep);
|
(PMF)&FGAircraft::GetXYZep);
|
||||||
PropertyManager->Tie("metrics/eyepoint-z-ft", this,3,
|
PropertyManager->Tie("metrics/eyepoint-z-ft", this,3,
|
||||||
(PMF)&FGAircraft::GetXYZep);
|
(PMF)&FGAircraft::GetXYZep);
|
||||||
|
PropertyManager->Tie("metrics/visualrefpoint-x-in", this,1,
|
||||||
|
(PMF)&FGAircraft::GetXYZvrp);
|
||||||
|
PropertyManager->Tie("metrics/visualrefpoint-y-in", this,2,
|
||||||
|
(PMF)&FGAircraft::GetXYZvrp);
|
||||||
|
PropertyManager->Tie("metrics/visualrefpoint-z-in", this,3,
|
||||||
|
(PMF)&FGAircraft::GetXYZvrp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -336,6 +346,9 @@ void FGAircraft::unbind(void)
|
||||||
PropertyManager->Untie("metrics/eyepoint-x-ft");
|
PropertyManager->Untie("metrics/eyepoint-x-ft");
|
||||||
PropertyManager->Untie("metrics/eyepoint-y-ft");
|
PropertyManager->Untie("metrics/eyepoint-y-ft");
|
||||||
PropertyManager->Untie("metrics/eyepoint-z-ft");
|
PropertyManager->Untie("metrics/eyepoint-z-ft");
|
||||||
|
PropertyManager->Untie("metrics/visualrefpoint-x-in");
|
||||||
|
PropertyManager->Untie("metrics/visualrefpoint-y-in");
|
||||||
|
PropertyManager->Untie("metrics/visualrefpoint-z-in");
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -73,10 +73,6 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
@ -85,26 +81,20 @@ CLASS DOCUMENTATION
|
||||||
the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties,
|
the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties,
|
||||||
landing gear, etc. These constituent parts may actually run as separate
|
landing gear, etc. These constituent parts may actually run as separate
|
||||||
JSBSim models themselves, but the responsibility for initializing them and
|
JSBSim models themselves, but the responsibility for initializing them and
|
||||||
for retrieving their force and moment contributions falls to FGAircraft.<br>
|
for retrieving their force and moment contributions falls to FGAircraft.
|
||||||
|
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see
|
@see Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||||
<ol><li>Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
|
||||||
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
||||||
School, January 1994</li>
|
School, January 1994
|
||||||
<li>D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
@see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||||
JSC 12960, July 1977</li>
|
JSC 12960, July 1977
|
||||||
<li>Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||||
NASA-Ames", NASA CR-2497, January 1975</li>
|
NASA-Ames", NASA CR-2497, January 1975
|
||||||
<li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||||
Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
|
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||||
<li>Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
@see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||||
1982 ISBN 0-471-08936-2</li></ol>
|
1982 ISBN 0-471-08936-2
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAircraft.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAircraft.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -155,10 +145,14 @@ public:
|
||||||
inline FGColumnVector3& GetForces(void) { return vForces; }
|
inline FGColumnVector3& GetForces(void) { return vForces; }
|
||||||
inline double GetForces(int idx) const { return vForces(idx); }
|
inline double GetForces(int idx) const { return vForces(idx); }
|
||||||
inline FGColumnVector3& GetBodyAccel(void) { return vBodyAccel; }
|
inline FGColumnVector3& GetBodyAccel(void) { return vBodyAccel; }
|
||||||
|
inline double GetBodyAccel(int idx) { return vBodyAccel(idx); }
|
||||||
inline FGColumnVector3& GetNcg (void) { return vNcg; }
|
inline FGColumnVector3& GetNcg (void) { return vNcg; }
|
||||||
|
inline double GetNcg(int idx) { return vNcg(idx); }
|
||||||
inline FGColumnVector3& GetXYZrp(void) { return vXYZrp; }
|
inline FGColumnVector3& GetXYZrp(void) { return vXYZrp; }
|
||||||
|
inline FGColumnVector3& GetXYZvrp(void) { return vXYZvrp; }
|
||||||
inline FGColumnVector3& GetXYZep(void) { return vXYZep; }
|
inline FGColumnVector3& GetXYZep(void) { return vXYZep; }
|
||||||
inline double GetXYZrp(int idx) const { return vXYZrp(idx); }
|
inline double GetXYZrp(int idx) const { return vXYZrp(idx); }
|
||||||
|
inline double GetXYZvrp(int idx) const { return vXYZvrp(idx); }
|
||||||
inline double GetXYZep(int idx) const { return vXYZep(idx); }
|
inline double GetXYZep(int idx) const { return vXYZep(idx); }
|
||||||
inline void SetAircraftName(string name) {AircraftName = name;}
|
inline void SetAircraftName(string name) {AircraftName = name;}
|
||||||
|
|
||||||
|
@ -173,6 +167,7 @@ private:
|
||||||
FGColumnVector3 vMoments;
|
FGColumnVector3 vMoments;
|
||||||
FGColumnVector3 vForces;
|
FGColumnVector3 vForces;
|
||||||
FGColumnVector3 vXYZrp;
|
FGColumnVector3 vXYZrp;
|
||||||
|
FGColumnVector3 vXYZvrp;
|
||||||
FGColumnVector3 vXYZep;
|
FGColumnVector3 vXYZep;
|
||||||
FGColumnVector3 vEuler;
|
FGColumnVector3 vEuler;
|
||||||
FGColumnVector3 vDXYZcg;
|
FGColumnVector3 vDXYZcg;
|
||||||
|
|
|
@ -156,9 +156,9 @@ bool FGAtmosphere::Run(void)
|
||||||
|
|
||||||
Debug(2);
|
Debug(2);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else { // skip Run() execution this time
|
} else { // skip Run() execution this time
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*******************************************************************************
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
Header: FGAtmosphere.h
|
Header: FGAtmosphere.h
|
||||||
Author: Jon Berndt
|
Author: Jon Berndt
|
||||||
|
@ -27,21 +27,20 @@
|
||||||
HISTORY
|
HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
11/24/98 JSB Created
|
11/24/98 JSB Created
|
||||||
07/23/99 TP Added implementation of 1959 Standard Atmosphere
|
07/23/99 TP Added implementation of 1959 Standard Atmosphere
|
||||||
Moved calculation of Mach number to FGTranslation
|
Moved calculation of Mach number to FGTranslation
|
||||||
Updated to '76 model
|
Updated to '76 model
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
********************************************************************************
|
|
||||||
SENTRY
|
SENTRY
|
||||||
*******************************************************************************/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#ifndef FGAtmosphere_H
|
#ifndef FGAtmosphere_H
|
||||||
#define FGAtmosphere_H
|
#define FGAtmosphere_H
|
||||||
|
|
||||||
/*******************************************************************************
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
INCLUDES
|
INCLUDES
|
||||||
*******************************************************************************/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include "FGModel.h"
|
#include "FGModel.h"
|
||||||
#include "FGMatrix33.h"
|
#include "FGMatrix33.h"
|
||||||
|
@ -61,28 +60,19 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
[1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
|
|
||||||
1989, ISBN 0-07-001641-0
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Models the standard atmosphere.
|
/** Models the standard atmosphere.
|
||||||
@author Tony Peden, Jon Berndt
|
@author Tony Peden, Jon Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAtmosphere.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
@see Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
|
||||||
Header File </a>
|
1989, ISBN 0-07-001641-0
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAtmosphere.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/******************************************************************************
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
*******************************************************************************/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
class FGAtmosphere : public FGModel {
|
class FGAtmosphere : public FGModel {
|
||||||
public:
|
public:
|
||||||
|
@ -159,7 +149,7 @@ public:
|
||||||
void unbind(void);
|
void unbind(void);
|
||||||
|
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
double rho;
|
double rho;
|
||||||
|
|
||||||
enum tType {ttStandard, ttBerndt, ttNone} turbType;
|
enum tType {ttStandard, ttBerndt, ttNone} turbType;
|
||||||
|
@ -196,6 +186,6 @@ private:
|
||||||
|
|
||||||
} // namespace JSBSim
|
} // namespace JSBSim
|
||||||
|
|
||||||
/******************************************************************************/
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -98,28 +98,33 @@ bool FGAuxiliary::Run()
|
||||||
if (!FGModel::Run()) {
|
if (!FGModel::Run()) {
|
||||||
GetState();
|
GetState();
|
||||||
|
|
||||||
//caculate total temperature assuming isentropic flow
|
//calculate total temperature assuming isentropic flow
|
||||||
tat=sat*(1 + 0.2*mach*mach);
|
tat=sat*(1 + 0.2*mach*mach);
|
||||||
|
tatc=RankineToCelsius(tat);
|
||||||
|
|
||||||
if (mach < 1) { //calculate total pressure assuming isentropic flow
|
if (mach < 1) { //calculate total pressure assuming isentropic flow
|
||||||
pt=p*pow((1 + 0.2*mach*mach),3.5);
|
pt=p*pow((1 + 0.2*machU*machU),3.5);
|
||||||
} else {
|
} else {
|
||||||
// shock in front of pitot tube, we'll assume its normal and use
|
// shock in front of pitot tube, we'll assume its normal and use
|
||||||
// the Rayleigh Pitot Tube Formula, i.e. the ratio of total
|
// the Rayleigh Pitot Tube Formula, i.e. the ratio of total
|
||||||
// pressure behind the shock to the static pressure in front
|
// pressure behind the shock to the static pressure in front
|
||||||
|
|
||||||
B = 5.76*mach*mach/(5.6*mach*mach - 0.8);
|
B = 5.76*machU*machU/(5.6*machU*machU - 0.8);
|
||||||
|
|
||||||
// The denominator above is zero for Mach ~ 0.38, for which
|
// The denominator above is zero for Mach ~ 0.38, for which
|
||||||
// we'll never be here, so we're safe
|
// we'll never be here, so we're safe
|
||||||
|
|
||||||
D = (2.8*mach*mach-0.4)*0.4167;
|
D = (2.8*machU*machU-0.4)*0.4167;
|
||||||
pt = p*pow(B,3.5)*D;
|
pt = p*pow(B,3.5)*D;
|
||||||
}
|
}
|
||||||
|
|
||||||
A = pow(((pt-p)/psl+1),0.28571);
|
A = pow(((pt-p)/psl+1),0.28571);
|
||||||
vcas = sqrt(7*psl/rhosl*(A-1));
|
if (machU > 0.0) {
|
||||||
veas = sqrt(2*qbar/rhosl);
|
vcas = sqrt(7*psl/rhosl*(A-1));
|
||||||
|
veas = sqrt(2*qbar/rhosl);
|
||||||
|
} else {
|
||||||
|
vcas = veas = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
// Pilot sensed accelerations are calculated here. This is used
|
// Pilot sensed accelerations are calculated here. This is used
|
||||||
// for the coordinated turn ball instrument. Motion base platforms sometimes
|
// for the coordinated turn ball instrument. Motion base platforms sometimes
|
||||||
|
@ -222,8 +227,12 @@ void FGAuxiliary::bind(void)
|
||||||
&FGAuxiliary::GetVequivalentFPS);
|
&FGAuxiliary::GetVequivalentFPS);
|
||||||
PropertyManager->Tie("velocities/ve-kts", this,
|
PropertyManager->Tie("velocities/ve-kts", this,
|
||||||
&FGAuxiliary::GetVequivalentKTS);
|
&FGAuxiliary::GetVequivalentKTS);
|
||||||
|
PropertyManager->Tie("velocities/machU", this,
|
||||||
|
&FGAuxiliary::GetMachU);
|
||||||
PropertyManager->Tie("velocities/tat-r", this,
|
PropertyManager->Tie("velocities/tat-r", this,
|
||||||
&FGAuxiliary::GetTotalTemperature);
|
&FGAuxiliary::GetTotalTemperature);
|
||||||
|
PropertyManager->Tie("velocities/tat-c", this,
|
||||||
|
&FGAuxiliary::GetTAT_C);
|
||||||
PropertyManager->Tie("velocities/pt-lbs_sqft", this,
|
PropertyManager->Tie("velocities/pt-lbs_sqft", this,
|
||||||
&FGAuxiliary::GetTotalPressure);
|
&FGAuxiliary::GetTotalPressure);
|
||||||
|
|
||||||
|
@ -257,6 +266,9 @@ void FGAuxiliary::unbind(void)
|
||||||
PropertyManager->Untie("velocities/vc-kts");
|
PropertyManager->Untie("velocities/vc-kts");
|
||||||
PropertyManager->Untie("velocities/ve-fps");
|
PropertyManager->Untie("velocities/ve-fps");
|
||||||
PropertyManager->Untie("velocities/ve-kts");
|
PropertyManager->Untie("velocities/ve-kts");
|
||||||
|
PropertyManager->Untie("velocities/machU");
|
||||||
|
PropertyManager->Untie("velocities/tat-r");
|
||||||
|
PropertyManager->Untie("velocities/tat-c");
|
||||||
PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
|
PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
|
||||||
PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
|
PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
|
||||||
PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
|
PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
|
||||||
|
@ -275,6 +287,7 @@ void FGAuxiliary::GetState(void)
|
||||||
{
|
{
|
||||||
qbar = Translation->Getqbar();
|
qbar = Translation->Getqbar();
|
||||||
mach = Translation->GetMach();
|
mach = Translation->GetMach();
|
||||||
|
machU= Translation->GetMachU();
|
||||||
p = Atmosphere->GetPressure();
|
p = Atmosphere->GetPressure();
|
||||||
rhosl = Atmosphere->GetDensitySL();
|
rhosl = Atmosphere->GetDensitySL();
|
||||||
psl = Atmosphere->GetPressureSL();
|
psl = Atmosphere->GetPressureSL();
|
||||||
|
|
|
@ -56,10 +56,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -67,10 +63,6 @@ CLASS DOCUMENTATION
|
||||||
/** Encapsulates various uncategorized scheduled functions.
|
/** Encapsulates various uncategorized scheduled functions.
|
||||||
@author Tony Peden, Jon Berndt
|
@author Tony Peden, Jon Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAuxiliary.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAuxiliary.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -81,7 +73,7 @@ class FGAuxiliary : public FGModel {
|
||||||
public:
|
public:
|
||||||
/** Constructor
|
/** Constructor
|
||||||
@param Executive a pointer to the parent executive object */
|
@param Executive a pointer to the parent executive object */
|
||||||
FGAuxiliary(FGFDMExec*);
|
FGAuxiliary(FGFDMExec* Executive);
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~FGAuxiliary();
|
~FGAuxiliary();
|
||||||
|
|
||||||
|
@ -94,8 +86,10 @@ public:
|
||||||
inline double GetVcalibratedKTS(void) const { return vcas*fpstokts; }
|
inline double GetVcalibratedKTS(void) const { return vcas*fpstokts; }
|
||||||
inline double GetVequivalentFPS(void) const { return veas; }
|
inline double GetVequivalentFPS(void) const { return veas; }
|
||||||
inline double GetVequivalentKTS(void) const { return veas*fpstokts; }
|
inline double GetVequivalentKTS(void) const { return veas*fpstokts; }
|
||||||
|
inline double GetMachU(void) const { return machU; }
|
||||||
|
|
||||||
inline double GetTotalTemperature(void) const { return tat; }
|
inline double GetTotalTemperature(void) const { return tat; }
|
||||||
|
inline double GetTAT_C(void) const { return tatc; }
|
||||||
|
|
||||||
// total pressure above is freestream total pressure for subsonic only
|
// total pressure above is freestream total pressure for subsonic only
|
||||||
// for supersonic it is the 1D total pressure behind a normal shock
|
// for supersonic it is the 1D total pressure behind a normal shock
|
||||||
|
@ -118,7 +112,8 @@ private:
|
||||||
double vcas;
|
double vcas;
|
||||||
double veas;
|
double veas;
|
||||||
double mach;
|
double mach;
|
||||||
double qbar,rhosl,rho,p,psl,pt,tat,sat;
|
double machU;
|
||||||
|
double qbar,rhosl,rho,p,psl,pt,tat,sat,tatc;
|
||||||
|
|
||||||
// Don't add a getter for pt!
|
// Don't add a getter for pt!
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ INCLUDES
|
||||||
#include "FGPropertyManager.h"
|
#include "FGPropertyManager.h"
|
||||||
|
|
||||||
#ifndef FGFS
|
#ifndef FGFS
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iomanip.h>
|
# include <iomanip.h>
|
||||||
# else
|
# else
|
||||||
# include <iomanip>
|
# include <iomanip>
|
||||||
|
|
|
@ -75,13 +75,6 @@ class FGAuxiliary;
|
||||||
class FGOutput;
|
class FGOutput;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
Note that the coefficients need not be calculated each delta-t. This is
|
|
||||||
something that may be fixed someday.
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
@ -92,10 +85,6 @@ CLASS DOCUMENTATION
|
||||||
is called and the coefficient values are calculated.
|
is called and the coefficient values are calculated.
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGCoefficient.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGCoefficient.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -148,8 +137,7 @@ public:
|
||||||
|
|
||||||
/** Outputs coefficient information.
|
/** Outputs coefficient information.
|
||||||
Non-dimensionalizing parameter descriptions are output
|
Non-dimensionalizing parameter descriptions are output
|
||||||
for each aero coefficient defined.
|
for each aero coefficient defined. */
|
||||||
@param multipliers the list of multipliers for this coefficient.*/
|
|
||||||
virtual void DisplayCoeffFactors(void);
|
virtual void DisplayCoeffFactors(void);
|
||||||
|
|
||||||
/// Returns the name of the coefficient.
|
/// Returns the name of the coefficient.
|
||||||
|
|
|
@ -33,14 +33,18 @@ INCLUDES
|
||||||
SG_USING_STD(endl);
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# include <math.h>
|
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
|
# include <math.h>
|
||||||
# else
|
# else
|
||||||
# include <fstream>
|
# include <fstream>
|
||||||
# include <cmath>
|
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
|
# if defined(sgi) && !defined(__GNUC__)
|
||||||
|
# include <math.h>
|
||||||
|
# else
|
||||||
|
# include <cmath>
|
||||||
|
# endif
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
using std::istream;
|
using std::istream;
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
@ -65,7 +69,16 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DECLARATION: FGColumnVector3
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** This class implements a 3 dimensional vector.
|
||||||
|
@author Jon S. Berndt, Tony Peden, et. al.
|
||||||
|
@version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
class FGColumnVector3 : public FGJSBBase
|
class FGColumnVector3 : public FGJSBBase
|
||||||
|
|
|
@ -33,13 +33,17 @@ INCLUDES
|
||||||
SG_USING_STD(endl);
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined (sgi) && !defined(__GNUC__)
|
# if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# include <math.h>
|
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
|
# include <math.h>
|
||||||
# else
|
# else
|
||||||
# include <fstream>
|
# include <fstream>
|
||||||
|
# if defined (sgi) && !defined(__GNUC__)
|
||||||
|
# include <math.h>
|
||||||
|
# else
|
||||||
# include <cmath>
|
# include <cmath>
|
||||||
|
# endif
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
using std::istream;
|
using std::istream;
|
||||||
|
@ -65,7 +69,16 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DECLARATION: FGColumnVector4
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** This class implements a 4 dimensional vector.
|
||||||
|
@author Jon S. Berndt, Tony Peden, et. al.
|
||||||
|
@version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
class FGColumnVector4 : public FGJSBBase
|
class FGColumnVector4 : public FGJSBBase
|
||||||
|
|
|
@ -32,7 +32,7 @@ CLASS IMPLEMENTATION
|
||||||
|
|
||||||
FGConfigFile::FGConfigFile(string cfgFileName)
|
FGConfigFile::FGConfigFile(string cfgFileName)
|
||||||
{
|
{
|
||||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||||
cfgfile.open(cfgFileName.c_str(), ios::in );
|
cfgfile.open(cfgFileName.c_str(), ios::in );
|
||||||
#else
|
#else
|
||||||
cfgfile.open(cfgFileName.c_str(), ios::in | ios::binary );
|
cfgfile.open(cfgFileName.c_str(), ios::in | ios::binary );
|
||||||
|
@ -40,7 +40,7 @@ FGConfigFile::FGConfigFile(string cfgFileName)
|
||||||
CommentsOn = false;
|
CommentsOn = false;
|
||||||
CurrentIndex = 0;
|
CurrentIndex = 0;
|
||||||
Opened = true;
|
Opened = true;
|
||||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||||
if (!cfgfile.fail() && !cfgfile.eof()) GetNextConfigLine();
|
if (!cfgfile.fail() && !cfgfile.eof()) GetNextConfigLine();
|
||||||
#else
|
#else
|
||||||
if (cfgfile.is_open()) GetNextConfigLine();
|
if (cfgfile.is_open()) GetNextConfigLine();
|
||||||
|
@ -214,7 +214,7 @@ string FGConfigFile::GetLine(void)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((test = cfgfile.get()) != EOF) { // get *next* character
|
if ((test = cfgfile.get()) != EOF) { // get *next* character
|
||||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||||
if (test >= 0x20 || test == 0x09) cfgfile.putback(test);
|
if (test >= 0x20 || test == 0x09) cfgfile.putback(test);
|
||||||
#else
|
#else
|
||||||
if (test >= 0x20 || test == 0x09) cfgfile.unget();
|
if (test >= 0x20 || test == 0x09) cfgfile.unget();
|
||||||
|
|
|
@ -53,7 +53,7 @@ INCLUDES
|
||||||
SG_USING_STD(cout);
|
SG_USING_STD(cout);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# else
|
# else
|
||||||
|
@ -61,11 +61,11 @@ INCLUDES
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
using std::istream;
|
using std::istream;
|
||||||
using std::ifstream;
|
|
||||||
using std::ios;
|
using std::ios;
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
|
||||||
using std::cout;
|
using std::cout;
|
||||||
|
using std::ifstream;
|
||||||
|
using std::endl;
|
||||||
# endif
|
# endif
|
||||||
using std::string;
|
using std::string;
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,10 +84,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -96,10 +92,6 @@ CLASS DOCUMENTATION
|
||||||
JSBSim config files are in XML format.
|
JSBSim config files are in XML format.
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGConfigFile.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGConfigFile.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -124,9 +116,10 @@ public:
|
||||||
string GetCurrentLine(void) { return CurrentLine; }
|
string GetCurrentLine(void) { return CurrentLine; }
|
||||||
|
|
||||||
/** Returns the value of the tag supplied.
|
/** Returns the value of the tag supplied.
|
||||||
@param
|
@param tag the tag for the value that is desired.
|
||||||
@return */
|
@return tthe value of the tag supplied.*/
|
||||||
string GetValue(string);
|
string GetValue(string tag);
|
||||||
|
|
||||||
string GetValue(void);
|
string GetValue(void);
|
||||||
string GetCommentString(void) {return CommentString;}
|
string GetCommentString(void) {return CommentString;}
|
||||||
string GetLineComment(void) {return LineComment;}
|
string GetLineComment(void) {return LineComment;}
|
||||||
|
|
|
@ -46,7 +46,7 @@ INCLUDES
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# else
|
# else
|
||||||
# include <fstream>
|
# include <fstream>
|
||||||
|
@ -67,45 +67,40 @@ CLASS IMPLEMENTATION
|
||||||
|
|
||||||
|
|
||||||
FGEngine::FGEngine(FGFDMExec* exec)
|
FGEngine::FGEngine(FGFDMExec* exec)
|
||||||
: Name(""),
|
|
||||||
Type(etUnknown),
|
|
||||||
X(0), Y(0), Z(0),
|
|
||||||
EnginePitch(0), EngineYaw(0),
|
|
||||||
SLFuelFlowMax(0), SLOxiFlowMax(0),
|
|
||||||
MaxThrottle(1.0), MinThrottle(0.0),
|
|
||||||
Thrust(0.0),
|
|
||||||
Throttle(0.0),
|
|
||||||
Mixture(1.0),
|
|
||||||
Magnetos(0),
|
|
||||||
Starter(false),
|
|
||||||
FuelNeed(0.0), OxidizerNeed(0.0),
|
|
||||||
Starved(false), Flameout(false), Running(false), Cranking(false),
|
|
||||||
Augmentation(false), Injection(false), Ignition(false),
|
|
||||||
Reversed(false), Cutoff(true), Nitrous(false),
|
|
||||||
PctPower(0.0),
|
|
||||||
EngineNumber(-1),
|
|
||||||
TrimMode(false),
|
|
||||||
FuelFlow_gph(0.0),
|
|
||||||
ManifoldPressure_inHg(0.0),
|
|
||||||
ExhaustGasTemp_degK(0.0),
|
|
||||||
CylinderHeadTemp_degK(0.0),
|
|
||||||
OilPressure_psi(0.0),
|
|
||||||
OilTemp_degK(0.0),
|
|
||||||
FuelFlow_pph(0.0),
|
|
||||||
N1(0.0), N2(0.0), EGT_degC(0.0),
|
|
||||||
InletPosition(0.0), NozzlePosition(0.0),
|
|
||||||
FDMExec(exec),
|
|
||||||
State(FDMExec->GetState()),
|
|
||||||
Atmosphere(FDMExec->GetAtmosphere()),
|
|
||||||
FCS(FDMExec->GetFCS()),
|
|
||||||
Propulsion(FDMExec->GetPropulsion()),
|
|
||||||
Aircraft(FDMExec->GetAircraft()),
|
|
||||||
Translation(FDMExec->GetTranslation()),
|
|
||||||
Rotation(FDMExec->GetRotation()),
|
|
||||||
Position(FDMExec->GetPosition()),
|
|
||||||
Auxiliary(FDMExec->GetAuxiliary()),
|
|
||||||
Output(FDMExec->GetOutput())
|
|
||||||
{
|
{
|
||||||
|
Name.clear();
|
||||||
|
Type = etUnknown;
|
||||||
|
X = Y = Z = 0.0;
|
||||||
|
EnginePitch = EngineYaw = 0.0;
|
||||||
|
SLFuelFlowMax = SLOxiFlowMax = 0.0;
|
||||||
|
MaxThrottle = 1.0;
|
||||||
|
MinThrottle = 0.0;
|
||||||
|
Thrust = 0.0;
|
||||||
|
Throttle = 0.0;
|
||||||
|
Mixture = 1.0;
|
||||||
|
Starter = false;
|
||||||
|
FuelNeed = OxidizerNeed = 0.0;
|
||||||
|
Starved = Running = Cranking = false;
|
||||||
|
PctPower = 0.0;
|
||||||
|
EngineNumber = -1;
|
||||||
|
TrimMode = false;
|
||||||
|
FuelFlow_gph = 0.0;
|
||||||
|
FuelFlow_pph = 0.0;
|
||||||
|
|
||||||
|
FDMExec = exec;
|
||||||
|
State = FDMExec->GetState();
|
||||||
|
Atmosphere = FDMExec->GetAtmosphere();
|
||||||
|
FCS = FDMExec->GetFCS();
|
||||||
|
Propulsion = FDMExec->GetPropulsion();
|
||||||
|
Aircraft = FDMExec->GetAircraft();
|
||||||
|
Translation = FDMExec->GetTranslation();
|
||||||
|
Rotation = FDMExec->GetRotation();
|
||||||
|
Position = FDMExec->GetPosition();
|
||||||
|
Auxiliary = FDMExec->GetAuxiliary();
|
||||||
|
Output = FDMExec->GetOutput();
|
||||||
|
|
||||||
|
PropertyManager = FDMExec->GetPropertyManager();
|
||||||
|
|
||||||
Debug(0);
|
Debug(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,21 +139,24 @@ void FGEngine::ConsumeFuel(void)
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
double FGEngine::CalcFuelNeed(void) {
|
double FGEngine::CalcFuelNeed(void)
|
||||||
|
{
|
||||||
FuelNeed = SLFuelFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
|
FuelNeed = SLFuelFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
|
||||||
return FuelNeed;
|
return FuelNeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
double FGEngine::CalcOxidizerNeed(void) {
|
double FGEngine::CalcOxidizerNeed(void)
|
||||||
|
{
|
||||||
OxidizerNeed = SLOxiFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
|
OxidizerNeed = SLOxiFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
|
||||||
return OxidizerNeed;
|
return OxidizerNeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
void FGEngine::SetPlacement(double x, double y, double z, double pitch, double yaw) {
|
void FGEngine::SetPlacement(double x, double y, double z, double pitch, double yaw)
|
||||||
|
{
|
||||||
X = x;
|
X = x;
|
||||||
Y = y;
|
Y = y;
|
||||||
Z = z;
|
Z = z;
|
||||||
|
|
|
@ -59,6 +59,7 @@ INCLUDES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
|
#include "FGPropertyManager.h"
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINITIONS
|
DEFINITIONS
|
||||||
|
@ -87,10 +88,6 @@ class FGPosition;
|
||||||
class FGAuxiliary;
|
class FGAuxiliary;
|
||||||
class FGOutput;
|
class FGOutput;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -114,55 +111,22 @@ public:
|
||||||
|
|
||||||
enum EngineType {etUnknown, etRocket, etPiston, etTurbine, etSimTurbine};
|
enum EngineType {etUnknown, etRocket, etPiston, etTurbine, etSimTurbine};
|
||||||
|
|
||||||
|
EngineType GetType(void) { return Type; }
|
||||||
|
virtual string GetName(void) { return Name; }
|
||||||
|
|
||||||
|
// Engine controls
|
||||||
virtual double GetThrottleMin(void) { return MinThrottle; }
|
virtual double GetThrottleMin(void) { return MinThrottle; }
|
||||||
virtual double GetThrottleMax(void) { return MaxThrottle; }
|
virtual double GetThrottleMax(void) { return MaxThrottle; }
|
||||||
virtual double GetThrottle(void) { return Throttle; }
|
virtual double GetThrottle(void) { return Throttle; }
|
||||||
virtual double GetMixture(void) { return Mixture; }
|
virtual double GetMixture(void) { return Mixture; }
|
||||||
virtual int GetMagnetos(void) { return Magnetos; }
|
|
||||||
virtual bool GetStarter(void) { return Starter; }
|
virtual bool GetStarter(void) { return Starter; }
|
||||||
virtual double GetThrust(void) { return Thrust; }
|
|
||||||
virtual bool GetStarved(void) { return Starved; }
|
|
||||||
virtual bool GetFlameout(void) { return Flameout; }
|
|
||||||
virtual bool GetRunning(void) { return Running; }
|
|
||||||
virtual bool GetCranking(void) { return Cranking; }
|
|
||||||
virtual int GetType(void) { return Type; }
|
|
||||||
virtual string GetName(void) { return Name; }
|
|
||||||
virtual double GetN1(void) { return N1; }
|
|
||||||
virtual double GetN2(void) { return N2; }
|
|
||||||
virtual double GetEGT(void) { return EGT_degC; }
|
|
||||||
virtual double GetEPR(void) { return EPR; }
|
|
||||||
virtual double GetInlet(void) { return InletPosition; }
|
|
||||||
virtual double GetNozzle(void) { return NozzlePosition; }
|
|
||||||
virtual bool GetAugmentation(void) { return Augmentation; }
|
|
||||||
virtual bool GetInjection(void) { return Injection; }
|
|
||||||
virtual int GetIgnition(void) { return Ignition; }
|
|
||||||
virtual bool GetReversed(void) { return Reversed; }
|
|
||||||
virtual bool GetCutoff(void) { return Cutoff; }
|
|
||||||
virtual bool GetNitrous(void) { return Nitrous; }
|
|
||||||
|
|
||||||
virtual double getFuelFlow_gph () const {
|
virtual double getFuelFlow_gph () const {return FuelFlow_gph;}
|
||||||
return FuelFlow_gph;
|
virtual double getFuelFlow_pph () const {return FuelFlow_pph;}
|
||||||
}
|
virtual double GetThrust(void) { return Thrust; }
|
||||||
|
virtual bool GetStarved(void) { return Starved; }
|
||||||
virtual double getManifoldPressure_inHg () const {
|
virtual bool GetRunning(void) { return Running; }
|
||||||
return ManifoldPressure_inHg;
|
virtual bool GetCranking(void) { return Cranking; }
|
||||||
}
|
|
||||||
virtual double getExhaustGasTemp_degF () const {
|
|
||||||
return (ExhaustGasTemp_degK - 273) * (9.0 / 5.0) + 32.0;
|
|
||||||
}
|
|
||||||
virtual double getCylinderHeadTemp_degF () const {
|
|
||||||
return (CylinderHeadTemp_degK - 273) * (9.0 / 5.0) + 32.0;
|
|
||||||
}
|
|
||||||
virtual double getOilPressure_psi () const {
|
|
||||||
return OilPressure_psi;
|
|
||||||
}
|
|
||||||
virtual double getOilTemp_degF () const {
|
|
||||||
return (OilTemp_degK - 273.0) * (9.0 / 5.0) + 32.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual double getFuelFlow_pph () const {
|
|
||||||
return FuelFlow_pph;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void SetStarved(bool tt) { Starved = tt; }
|
virtual void SetStarved(bool tt) { Starved = tt; }
|
||||||
virtual void SetStarved(void) { Starved = true; }
|
virtual void SetStarved(void) { Starved = true; }
|
||||||
|
@ -171,14 +135,7 @@ public:
|
||||||
virtual void SetName(string name) { Name = name; }
|
virtual void SetName(string name) { Name = name; }
|
||||||
virtual void AddFeedTank(int tkID);
|
virtual void AddFeedTank(int tkID);
|
||||||
|
|
||||||
virtual void SetMagnetos(int m) { Magnetos = m; }
|
|
||||||
virtual void SetStarter(bool s) { Starter = s; }
|
virtual void SetStarter(bool s) { Starter = s; }
|
||||||
virtual void SetAugmentation(bool a) { Augmentation = a; }
|
|
||||||
virtual void SetInjection(bool i) { Injection = i; }
|
|
||||||
virtual void SetIgnition(int ig) { Ignition = ig; }
|
|
||||||
virtual void SetReverse(bool r) { Reversed = r; }
|
|
||||||
virtual void SetCutoff(bool c) { Cutoff = c; }
|
|
||||||
virtual void SetNitrous(bool n) { Nitrous = n; }
|
|
||||||
|
|
||||||
/** Calculates the thrust of the engine, and other engine functions.
|
/** Calculates the thrust of the engine, and other engine functions.
|
||||||
@param PowerRequired this is the power required to run the thrusting device
|
@param PowerRequired this is the power required to run the thrusting device
|
||||||
|
@ -218,6 +175,7 @@ public:
|
||||||
virtual void SetTrimMode(bool state) {TrimMode = state;}
|
virtual void SetTrimMode(bool state) {TrimMode = state;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
FGPropertyManager* PropertyManager;
|
||||||
string Name;
|
string Name;
|
||||||
EngineType Type;
|
EngineType Type;
|
||||||
double X, Y, Z;
|
double X, Y, Z;
|
||||||
|
@ -231,38 +189,18 @@ protected:
|
||||||
double Thrust;
|
double Thrust;
|
||||||
double Throttle;
|
double Throttle;
|
||||||
double Mixture;
|
double Mixture;
|
||||||
int Magnetos;
|
double FuelNeed;
|
||||||
bool Starter;
|
double OxidizerNeed;
|
||||||
double FuelNeed, OxidizerNeed;
|
|
||||||
bool Starved;
|
|
||||||
bool Flameout;
|
|
||||||
bool Running;
|
|
||||||
bool Cranking;
|
|
||||||
double PctPower;
|
double PctPower;
|
||||||
int EngineNumber;
|
int EngineNumber;
|
||||||
|
bool Starter;
|
||||||
|
bool Starved;
|
||||||
|
bool Running;
|
||||||
|
bool Cranking;
|
||||||
bool TrimMode;
|
bool TrimMode;
|
||||||
|
|
||||||
double FuelFlow_gph;
|
double FuelFlow_gph;
|
||||||
double ManifoldPressure_inHg;
|
|
||||||
double ExhaustGasTemp_degK;
|
|
||||||
double CylinderHeadTemp_degK;
|
|
||||||
double OilPressure_psi;
|
|
||||||
double OilTemp_degK;
|
|
||||||
|
|
||||||
double FuelFlow_pph;
|
double FuelFlow_pph;
|
||||||
double N1;
|
|
||||||
double N2;
|
|
||||||
double EGT_degC;
|
|
||||||
double EPR;
|
|
||||||
double BleedDemand;
|
|
||||||
double InletPosition;
|
|
||||||
double NozzlePosition;
|
|
||||||
bool Augmentation;
|
|
||||||
bool Injection;
|
|
||||||
int Ignition;
|
|
||||||
bool Reversed;
|
|
||||||
bool Cutoff;
|
|
||||||
bool Nitrous;
|
|
||||||
|
|
||||||
FGFDMExec* FDMExec;
|
FGFDMExec* FDMExec;
|
||||||
FGState* State;
|
FGState* State;
|
||||||
|
@ -277,7 +215,7 @@ protected:
|
||||||
FGOutput* Output;
|
FGOutput* Output;
|
||||||
|
|
||||||
vector <int> SourceTanks;
|
vector <int> SourceTanks;
|
||||||
virtual void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#include "FGState.h"
|
#include "FGState.h"
|
||||||
|
|
|
@ -70,18 +70,12 @@ namespace JSBSim {
|
||||||
typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf, NNorm } FcIdx;
|
typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf, NNorm } FcIdx;
|
||||||
typedef enum { ofRad=0, ofNorm, ofMag , NForms} OutputForm;
|
typedef enum { ofRad=0, ofNorm, ofMag , NForms} OutputForm;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Encapsulates the Flight Control System (FCS) functionality.
|
/** Encapsulates the Flight Control System (FCS) functionality.
|
||||||
<ul><li>\URL[Source Code]{FGFCS.cpp.html}</li>
|
This class owns and contains the list of FGFCSComponents
|
||||||
<li>\URL[Header File]{FGFCS.h.html}</li></ul>
|
|
||||||
This class owns and contains the list of \URL[components]{FGFCSComponent.html}
|
|
||||||
that define the control system for this aircraft. The config file for the
|
that define the control system for this aircraft. The config file for the
|
||||||
aircraft contains a description of the control path that starts at an input
|
aircraft contains a description of the control path that starts at an input
|
||||||
or command and ends at an effector, e.g. an aerosurface. The FCS components
|
or command and ends at an effector, e.g. an aerosurface. The FCS components
|
||||||
|
@ -152,10 +146,6 @@ CLASS DOCUMENTATION
|
||||||
@see FGGradient
|
@see FGGradient
|
||||||
@see FGFilter
|
@see FGFilter
|
||||||
@see FGDeadBand
|
@see FGDeadBand
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFCS.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFCS.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -46,7 +46,7 @@ INCLUDES
|
||||||
# include STL_IOSTREAM
|
# include STL_IOSTREAM
|
||||||
# include STL_ITERATOR
|
# include STL_ITERATOR
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# else
|
# else
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
|
@ -500,6 +500,7 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
|
||||||
scratch = AC_cfg->GetValue("VERSION").c_str();
|
scratch = AC_cfg->GetValue("VERSION").c_str();
|
||||||
|
|
||||||
CFGVersion = AC_cfg->GetValue("VERSION");
|
CFGVersion = AC_cfg->GetValue("VERSION");
|
||||||
|
Release = AC_cfg->GetValue("RELEASE");
|
||||||
|
|
||||||
if (debug_lvl > 0)
|
if (debug_lvl > 0)
|
||||||
cout << " Version: " << highint << CFGVersion
|
cout << " Version: " << highint << CFGVersion
|
||||||
|
@ -511,6 +512,25 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
|
||||||
cerr << " You have version: " << CFGVersion << endl << fgdef << endl;
|
cerr << " You have version: " << CFGVersion << endl << fgdef << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Release == "ALPHA") {
|
||||||
|
system("banner ALPHA");
|
||||||
|
cout << endl << endl
|
||||||
|
<< highint << "This aircraft model is an " << fgred << Release
|
||||||
|
<< reset << highint << " release!!!" << endl << endl << reset
|
||||||
|
<< "This aircraft model may not even properly load, and probably"
|
||||||
|
<< " will not fly as expected." << endl << endl
|
||||||
|
<< fgred << highint << "Use this model for development purposes ONLY!!!"
|
||||||
|
<< normint << endl << endl;
|
||||||
|
} else if (Release == "BETA") {
|
||||||
|
system("banner BETA");
|
||||||
|
cout << endl << endl
|
||||||
|
<< highint << "This aircraft model is a " << fgred << Release
|
||||||
|
<< reset << highint << " release!!!" << endl << endl << reset
|
||||||
|
<< "This aircraft model probably will not fly as expected." << endl << endl
|
||||||
|
<< fgblue << highint << "Use this model for development purposes ONLY!!!"
|
||||||
|
<< normint << reset << endl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ INCLUDES
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
#include "FGPropertyManager.h"
|
#include "FGPropertyManager.h"
|
||||||
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINITIONS
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -60,23 +60,12 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Encapsulates the JSBSim simulation executive.
|
/** Encapsulates the JSBSim simulation executive.
|
||||||
@author Jon S. Berndt
|
This class is the interface class through which all other simulation classes
|
||||||
@version $Id$
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
|
|
||||||
@doc This class is the interface class through which all other simulation classes
|
|
||||||
are instantiated, initialized, and run. When integrated with FlightGear (or
|
are instantiated, initialized, and run. When integrated with FlightGear (or
|
||||||
other flight simulator) this class is typically instantiated by an interface
|
other flight simulator) this class is typically instantiated by an interface
|
||||||
class on the simulator side.
|
class on the simulator side.
|
||||||
|
@ -109,6 +98,8 @@ CLASS DOCUMENTATION
|
||||||
a message is printed out when they go out of bounds</li>
|
a message is printed out when they go out of bounds</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
@author Jon S. Berndt
|
||||||
|
@version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -178,20 +169,20 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/** Sets the path to the engine config file directories.
|
/** Sets the path to the engine config file directories.
|
||||||
@param EnginePath path to the directory under which engine config
|
@param path path to the directory under which engine config
|
||||||
files are kept, for instance "engine"
|
files are kept, for instance "engine"
|
||||||
*/
|
*/
|
||||||
bool SetEnginePath(string path) { EnginePath = path; return true; }
|
bool SetEnginePath(string path) { EnginePath = path; return true; }
|
||||||
|
|
||||||
/** Sets the path to the aircraft config file directories.
|
/** Sets the path to the aircraft config file directories.
|
||||||
@param AircraftPath path to the aircraft directory. For instance:
|
@param path path to the aircraft directory. For instance:
|
||||||
"aircraft". Under aircraft, then, would be directories for various
|
"aircraft". Under aircraft, then, would be directories for various
|
||||||
modeled aircraft such as C172/, x15/, etc.
|
modeled aircraft such as C172/, x15/, etc.
|
||||||
*/
|
*/
|
||||||
bool SetAircraftPath(string path) { AircraftPath = path; return true; }
|
bool SetAircraftPath(string path) { AircraftPath = path; return true; }
|
||||||
|
|
||||||
/** Sets the path to the autopilot config file directories.
|
/** Sets the path to the autopilot config file directories.
|
||||||
@param ControlPath path to the control directory. For instance:
|
@param path path to the control directory. For instance:
|
||||||
"control".
|
"control".
|
||||||
*/
|
*/
|
||||||
bool SetControlPath(string path) { ControlPath = path; return true; }
|
bool SetControlPath(string path) { ControlPath = path; return true; }
|
||||||
|
@ -285,6 +276,7 @@ private:
|
||||||
string ControlPath;
|
string ControlPath;
|
||||||
|
|
||||||
string CFGVersion;
|
string CFGVersion;
|
||||||
|
string Release;
|
||||||
|
|
||||||
FGState* State;
|
FGState* State;
|
||||||
FGAtmosphere* Atmosphere;
|
FGAtmosphere* Atmosphere;
|
||||||
|
|
|
@ -51,7 +51,7 @@ INCLUDES
|
||||||
#include "FGFDMExec.h"
|
#include "FGFDMExec.h"
|
||||||
|
|
||||||
#ifndef FGFS
|
#ifndef FGFS
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iomanip.h>
|
# include <iomanip.h>
|
||||||
# else
|
# else
|
||||||
# include <iomanip>
|
# include <iomanip>
|
||||||
|
|
|
@ -76,21 +76,12 @@ class FGAuxiliary;
|
||||||
class FGOutput;
|
class FGOutput;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** This class encapsulates the functionality needed to manage a factor group
|
/** This class encapsulates the functionality needed to manage a factor group
|
||||||
i.e. factor*(coeff1 + coeff2 + coeff3)
|
i.e. factor*(coeff1 + coeff2 + coeff3)
|
||||||
@author Tony Peden
|
@author Tony Peden
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFactorGroup.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFactorGroup.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -57,24 +57,24 @@ SENTRY
|
||||||
INCLUDES
|
INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_FORCE "$Id$"
|
|
||||||
|
|
||||||
#include "FGFDMExec.h"
|
#include "FGFDMExec.h"
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
#include "FGMatrix33.h"
|
#include "FGMatrix33.h"
|
||||||
#include "FGColumnVector3.h"
|
#include "FGColumnVector3.h"
|
||||||
#include "FGColumnVector4.h"
|
#include "FGColumnVector4.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
#define ID_FORCE "$Id$"
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
FORWARD DECLARATIONS
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
09/13/00 JSB Created
|
09/13/00 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -61,8 +57,19 @@ INCLUDES
|
||||||
|
|
||||||
#define ID_GROUNDREACTIONS "$Id$"
|
#define ID_GROUNDREACTIONS "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Manages ground reactions modeling.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -83,11 +90,10 @@ public:
|
||||||
string GetGroundReactionValues(void);
|
string GetGroundReactionValues(void);
|
||||||
|
|
||||||
inline int GetNumGearUnits(void) const { return lGear.size(); }
|
inline int GetNumGearUnits(void) const { return lGear.size(); }
|
||||||
|
|
||||||
/** Gets a gear instance
|
/** Gets a gear instance
|
||||||
@param gear index of gear instance
|
@param gear index of gear instance
|
||||||
@return a pointer to the FGLGear instance of the gear unit requested */
|
@return a pointer to the FGLGear instance of the gear unit requested */
|
||||||
|
|
||||||
|
|
||||||
inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); }
|
inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); }
|
||||||
|
|
||||||
void bind(void);
|
void bind(void);
|
||||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
09/13/00 JSB Created
|
09/13/00 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -59,10 +55,25 @@ INCLUDES
|
||||||
#include "FGColumnVector3.h"
|
#include "FGColumnVector3.h"
|
||||||
#include "FGColumnVector4.h"
|
#include "FGColumnVector4.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_INERTIAL "$Id$"
|
#define ID_INERTIAL "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models inertial forces (e.g. centripetal and coriolis accelerations).
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*******************************************************************************
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
Header: FGInitialCondition.h
|
Header: FGInitialCondition.h
|
||||||
Author: Tony Peden
|
Author: Tony Peden
|
||||||
|
@ -36,16 +36,16 @@ angles, and altitude. This class does not attempt to trim the model i.e.
|
||||||
the sim will most likely start in a very dynamic state (unless, of course,
|
the sim will most likely start in a very dynamic state (unless, of course,
|
||||||
you have chosen your IC's wisely) even after setting it up with this class.
|
you have chosen your IC's wisely) even after setting it up with this class.
|
||||||
|
|
||||||
********************************************************************************
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
*******************************************************************************/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#ifndef FGINITIALCONDITION_H
|
#ifndef FGINITIALCONDITION_H
|
||||||
#define FGINITIALCONDITION_H
|
#define FGINITIALCONDITION_H
|
||||||
|
|
||||||
/*******************************************************************************
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
INCLUDES
|
INCLUDES
|
||||||
*******************************************************************************/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include "FGFDMExec.h"
|
#include "FGFDMExec.h"
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
|
@ -60,18 +60,14 @@ DEFINITIONS
|
||||||
|
|
||||||
#define ID_INITIALCONDITION "$Id$"
|
#define ID_INITIALCONDITION "$Id$"
|
||||||
|
|
||||||
namespace JSBSim {
|
|
||||||
|
|
||||||
typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
|
|
||||||
typedef enum { setwned, setwmd, setwhc } windset;
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
FORWARD DECLARATIONS
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
namespace JSBSim {
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
|
||||||
|
typedef enum { setwned, setwmd, setwhc } windset;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
|
@ -89,9 +85,7 @@ CLASS DOCUMENTATION
|
||||||
FGInitialCondition fgic=new FGInitialCondition(FDMExec);
|
FGInitialCondition fgic=new FGInitialCondition(FDMExec);
|
||||||
fgic->SetVcalibratedKtsIC()
|
fgic->SetVcalibratedKtsIC()
|
||||||
fgic->SetAltitudeFtIC();
|
fgic->SetAltitudeFtIC();
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
//to directly into Run
|
//to directly into Run
|
||||||
FDMExec->GetState()->Initialize(fgic)
|
FDMExec->GetState()->Initialize(fgic)
|
||||||
delete fgic;
|
delete fgic;
|
||||||
|
@ -102,36 +96,32 @@ CLASS DOCUMENTATION
|
||||||
|
|
||||||
Speed:
|
Speed:
|
||||||
|
|
||||||
Since vc, ve, vt, and mach all represent speed, the remaining
|
Since vc, ve, vt, and mach all represent speed, the remaining
|
||||||
three are recalculated each time one of them is set (using the
|
three are recalculated each time one of them is set (using the
|
||||||
current altitude). The most recent speed set is remembered so
|
current altitude). The most recent speed set is remembered so
|
||||||
that if and when altitude is reset, the last set speed is used
|
that if and when altitude is reset, the last set speed is used
|
||||||
to recalculate the remaining three. Setting any of the body
|
to recalculate the remaining three. Setting any of the body
|
||||||
components forces a recalculation of vt and vt then becomes the
|
components forces a recalculation of vt and vt then becomes the
|
||||||
most recent speed set.
|
most recent speed set.
|
||||||
|
|
||||||
Alpha,Gamma, and Theta:
|
Alpha,Gamma, and Theta:
|
||||||
|
|
||||||
This class assumes that it will be used to set up the sim for a
|
This class assumes that it will be used to set up the sim for a
|
||||||
steady, zero pitch rate condition. Since any two of those angles
|
steady, zero pitch rate condition. Since any two of those angles
|
||||||
specifies the third gamma (flight path angle) is favored when setting
|
specifies the third gamma (flight path angle) is favored when setting
|
||||||
alpha and theta and alpha is favored when setting gamma. i.e.
|
alpha and theta and alpha is favored when setting gamma. i.e.
|
||||||
|
|
||||||
set alpha : recalculate theta using gamma as currently set
|
- set alpha : recalculate theta using gamma as currently set
|
||||||
set theta : recalculate alpha using gamma as currently set
|
- set theta : recalculate alpha using gamma as currently set
|
||||||
set gamma : recalculate theta using alpha as currently set
|
- set gamma : recalculate theta using alpha as currently set
|
||||||
|
|
||||||
The idea being that gamma is most interesting to pilots (since it
|
The idea being that gamma is most interesting to pilots (since it
|
||||||
is indicative of climb rate).
|
is indicative of climb rate).
|
||||||
|
|
||||||
Setting climb rate is, for the purpose of this discussion,
|
Setting climb rate is, for the purpose of this discussion,
|
||||||
considered equivalent to setting gamma.
|
considered equivalent to setting gamma.
|
||||||
@author Anthony K. Peden
|
@author Tony Peden
|
||||||
@version $Id$
|
@version "$Id$"
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGInitialCondition.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGInitialCondition.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -69,7 +69,7 @@ const double FGJSBBase::in3tom3 = 1.638706E-5;
|
||||||
const double FGJSBBase::Reng = 1716.0;
|
const double FGJSBBase::Reng = 1716.0;
|
||||||
const double FGJSBBase::SHRatio = 1.40;
|
const double FGJSBBase::SHRatio = 1.40;
|
||||||
const string FGJSBBase::needed_cfg_version = "1.60";
|
const string FGJSBBase::needed_cfg_version = "1.60";
|
||||||
const string FGJSBBase::JSBSim_version = "0.9.4";
|
const string FGJSBBase::JSBSim_version = "0.9.5";
|
||||||
|
|
||||||
std::queue <FGJSBBase::Message*> FGJSBBase::Messages;
|
std::queue <FGJSBBase::Message*> FGJSBBase::Messages;
|
||||||
FGJSBBase::Message FGJSBBase::localMsg;
|
FGJSBBase::Message FGJSBBase::localMsg;
|
||||||
|
|
|
@ -79,8 +79,8 @@ using std::max;
|
||||||
|
|
||||||
static char *gcvt(double number, size_t ndigit, char *buf)
|
static char *gcvt(double number, size_t ndigit, char *buf)
|
||||||
{
|
{
|
||||||
sprintf(buf, "%f", number);
|
sprintf(buf, "%f", number);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -96,10 +96,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -216,6 +212,13 @@ public:
|
||||||
void disableHighLighting(void);
|
void disableHighLighting(void);
|
||||||
|
|
||||||
static short debug_lvl;
|
static short debug_lvl;
|
||||||
|
double KelvinToFahrenheit (double kelvin) {
|
||||||
|
return 1.8*kelvin - 459.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
double RankineToCelsius (double rankine) {
|
||||||
|
return (rankine - 491.67)/1.8;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static Message localMsg;
|
static Message localMsg;
|
||||||
|
|
|
@ -39,7 +39,7 @@ INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#include "FGLGear.h"
|
#include "FGLGear.h"
|
||||||
#include <algorithm>
|
//#include <algorithm>
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
@ -208,7 +208,9 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
{
|
{
|
||||||
double SteerGain = 0;
|
double SteerGain = 0;
|
||||||
double SinWheel, CosWheel;
|
double SinWheel, CosWheel;
|
||||||
double deltaT;
|
double deltaSlip;
|
||||||
|
double deltaT = State->Getdt()*Aircraft->GetRate();
|
||||||
|
double maxdeltaSlip = 0.5*deltaT;
|
||||||
|
|
||||||
vForce.InitMatrix();
|
vForce.InitMatrix();
|
||||||
vMoment.InitMatrix();
|
vMoment.InitMatrix();
|
||||||
|
@ -250,7 +252,7 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
|
|
||||||
if (compressLength > 0.00) {
|
if (compressLength > 0.00) {
|
||||||
|
|
||||||
WOW = true;// Weight-On-Wheels is true
|
WOW = true; // Weight-On-Wheels is true
|
||||||
|
|
||||||
// The next equation should really use the vector to the contact patch of the tire
|
// The next equation should really use the vector to the contact patch of the tire
|
||||||
// including the strut compression and not vWhlBodyVec. Will fix this later.
|
// including the strut compression and not vWhlBodyVec. Will fix this later.
|
||||||
|
@ -300,30 +302,26 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
|
|
||||||
switch (eBrakeGrp) {
|
switch (eBrakeGrp) {
|
||||||
case bgLeft:
|
case bgLeft:
|
||||||
SteerGain = 0.10;
|
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) +
|
||||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) +
|
|
||||||
staticFCoeff*FCS->GetBrake(bgLeft) );
|
staticFCoeff*FCS->GetBrake(bgLeft) );
|
||||||
break;
|
break;
|
||||||
case bgRight:
|
case bgRight:
|
||||||
SteerGain = 0.10;
|
|
||||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgRight)) +
|
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgRight)) +
|
||||||
staticFCoeff*FCS->GetBrake(bgRight) );
|
staticFCoeff*FCS->GetBrake(bgRight) );
|
||||||
break;
|
break;
|
||||||
case bgCenter:
|
case bgCenter:
|
||||||
SteerGain = 0.10;
|
|
||||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
||||||
staticFCoeff*FCS->GetBrake(bgCenter) );
|
staticFCoeff*FCS->GetBrake(bgCenter) );
|
||||||
break;
|
break;
|
||||||
case bgNose:
|
case bgNose:
|
||||||
SteerGain = -0.50;
|
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
||||||
BrakeFCoeff = rollingFCoeff;
|
staticFCoeff*FCS->GetBrake(bgCenter) );
|
||||||
break;
|
break;
|
||||||
case bgTail:
|
case bgTail:
|
||||||
SteerGain = -0.10;
|
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
||||||
BrakeFCoeff = rollingFCoeff;
|
staticFCoeff*FCS->GetBrake(bgCenter) );
|
||||||
break;
|
break;
|
||||||
case bgNone:
|
case bgNone:
|
||||||
SteerGain = 0.0;
|
|
||||||
BrakeFCoeff = rollingFCoeff;
|
BrakeFCoeff = rollingFCoeff;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -333,7 +331,7 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
|
|
||||||
switch (eSteerType) {
|
switch (eSteerType) {
|
||||||
case stSteer:
|
case stSteer:
|
||||||
SteerAngle = SteerGain*FCS->GetDrCmd()*0.349; // 20 deg
|
SteerAngle = -maxSteerAngle * FCS->GetDrCmd() * 0.01745;
|
||||||
break;
|
break;
|
||||||
case stFixed:
|
case stFixed:
|
||||||
SteerAngle = 0.0;
|
SteerAngle = 0.0;
|
||||||
|
@ -360,18 +358,34 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
|
|
||||||
if (RollingWhlVel == 0.0 && SideWhlVel == 0.0) {
|
if (RollingWhlVel == 0.0 && SideWhlVel == 0.0) {
|
||||||
WheelSlip = 0.0;
|
WheelSlip = 0.0;
|
||||||
} else if (fabs(RollingWhlVel) < 0.10) {
|
} else if (fabs(RollingWhlVel) < 1.0) {
|
||||||
WheelSlip = 0.05*radtodeg*atan2(SideWhlVel, RollingWhlVel) + 0.95*WheelSlip;
|
WheelSlip = 0.05*radtodeg*atan2(SideWhlVel, RollingWhlVel) + 0.95*WheelSlip;
|
||||||
} else {
|
} else {
|
||||||
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
if (RollingWhlVel == 0.0 && SideWhlVel == 0.0) {
|
||||||
|
WheelSlip = 0.0;
|
||||||
|
} else if (RollingWhlVel < 1.0) {
|
||||||
|
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
||||||
|
deltaSlip = WheelSlip - lastWheelSlip;
|
||||||
|
if (fabs(deltaSlip) > maxdeltaSlip) {
|
||||||
|
if (WheelSlip > lastWheelSlip) {
|
||||||
|
WheelSlip = lastWheelSlip + maxdeltaSlip;
|
||||||
|
} else if (WheelSlip < lastWheelSlip) {
|
||||||
|
WheelSlip = lastWheelSlip - maxdeltaSlip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
||||||
|
}
|
||||||
|
|
||||||
if ((WheelSlip < 0.0 && lastWheelSlip > 0.0) ||
|
if ((WheelSlip < 0.0 && lastWheelSlip > 0.0) ||
|
||||||
(WheelSlip > 0.0 && lastWheelSlip < 0.0))
|
(WheelSlip > 0.0 && lastWheelSlip < 0.0))
|
||||||
{
|
{
|
||||||
WheelSlip = 0.0;
|
WheelSlip = 0.0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
lastWheelSlip = WheelSlip;
|
lastWheelSlip = WheelSlip;
|
||||||
|
|
||||||
// Compute the sideforce coefficients using similar assumptions to LaRCSim for now.
|
// Compute the sideforce coefficients using similar assumptions to LaRCSim for now.
|
||||||
|
@ -433,7 +447,7 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
vForce = State->GetTl2b() * vLocalForce;
|
vForce = State->GetTl2b() * vLocalForce;
|
||||||
vMoment = vWhlBodyVec * vForce;
|
vMoment = vWhlBodyVec * vForce;
|
||||||
|
|
||||||
} else {
|
} else { // Gear is NOT compressed
|
||||||
|
|
||||||
WOW = false;
|
WOW = false;
|
||||||
|
|
||||||
|
@ -448,8 +462,6 @@ FGColumnVector3& FGLGear::Force(void)
|
||||||
compressLength = 0.0; // reset compressLength to zero for data output validity
|
compressLength = 0.0; // reset compressLength to zero for data output validity
|
||||||
}
|
}
|
||||||
|
|
||||||
deltaT = State->Getdt()*Aircraft->GetRate();
|
|
||||||
|
|
||||||
if (FirstContact) LandingDistanceTraveled += Position->GetVground()*deltaT;
|
if (FirstContact) LandingDistanceTraveled += Position->GetVground()*deltaT;
|
||||||
|
|
||||||
if (StartedGroundRun) {
|
if (StartedGroundRun) {
|
||||||
|
|
|
@ -70,10 +70,6 @@ class FGState;
|
||||||
class FGMassBalance;
|
class FGMassBalance;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
@ -171,10 +167,6 @@ CLASS DOCUMENTATION
|
||||||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||||
@see W. A. Ragsdale, "A Generic Landing Gear Dynamics Model for LASRS++",
|
@see W. A. Ragsdale, "A Generic Landing Gear Dynamics Model for LASRS++",
|
||||||
AIAA-2000-4303
|
AIAA-2000-4303
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGLGear.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGLGear.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
09/12/2000 JSB Created
|
09/12/2000 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -46,10 +42,25 @@ INCLUDES
|
||||||
#include "FGPropulsion.h"
|
#include "FGPropulsion.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_MASSBALANCE "$Id$"
|
#define ID_MASSBALANCE "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONSS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models weight and balance information.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -35,13 +35,18 @@ INCLUDES
|
||||||
SG_USING_STD(endl);
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <fstream.h>
|
include <fstream.h>
|
||||||
|
include <iostream.h>
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# include <iostream.h>
|
|
||||||
# else
|
# else
|
||||||
# include <fstream>
|
# include <fstream>
|
||||||
# include <cmath>
|
# include <iostream>
|
||||||
|
# if defined(sgi) && !defined(__GNUC__)
|
||||||
|
# include <math.h>
|
||||||
|
# else
|
||||||
|
# include <cmath>
|
||||||
|
# endif
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
using std::istream;
|
using std::istream;
|
||||||
|
@ -69,6 +74,13 @@ namespace JSBSim {
|
||||||
|
|
||||||
class FGColumnVector3;
|
class FGColumnVector3;
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Exception convenience class.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DECLARATION: MatrixException
|
DECLARATION: MatrixException
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -79,6 +91,13 @@ public:
|
||||||
string Message;
|
string Message;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Handles matrix math operations.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DECLARATION: FGMatrix33
|
DECLARATION: FGMatrix33
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -49,7 +49,7 @@ INCLUDES
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# else
|
# else
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
|
@ -58,12 +58,12 @@ INCLUDES
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define ID_MODEL "$Id$"
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINITIONS
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
#define ID_MODEL "$Id$"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -89,20 +89,12 @@ class FGAuxiliary;
|
||||||
class FGOutput;
|
class FGOutput;
|
||||||
class FGConfigFile;
|
class FGConfigFile;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Base class for all scheduled JSBSim models
|
/** Base class for all scheduled JSBSim models
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -70,6 +70,7 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMEx
|
||||||
}
|
}
|
||||||
|
|
||||||
Thrust = 0;
|
Thrust = 0;
|
||||||
|
ReverserAngle = 0.0;
|
||||||
Type = ttNozzle;
|
Type = ttNozzle;
|
||||||
Area2 = (Diameter*Diameter/4.0)*M_PI;
|
Area2 = (Diameter*Diameter/4.0)*M_PI;
|
||||||
AreaT = Area2/ExpR;
|
AreaT = Area2/ExpR;
|
||||||
|
@ -90,7 +91,7 @@ double FGNozzle::Calculate(double CfPc)
|
||||||
{
|
{
|
||||||
double pAtm = fdmex->GetAtmosphere()->GetPressure();
|
double pAtm = fdmex->GetAtmosphere()->GetPressure();
|
||||||
Thrust = max((double)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
|
Thrust = max((double)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
|
||||||
vFn(1) = Thrust;
|
vFn(1) = Thrust * cos(ReverserAngle);
|
||||||
|
|
||||||
return Thrust;
|
return Thrust;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,19 +52,13 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Models a rocket nozzle.
|
/** Models a rocket nozzle.
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGNozzle.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
@author Jon S. Berndt
|
||||||
Header File </a>
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGNozzle.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -83,6 +77,7 @@ public:
|
||||||
double GetPowerRequired(void);
|
double GetPowerRequired(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
double ReverserAngle;
|
||||||
double PE;
|
double PE;
|
||||||
double ExpR;
|
double ExpR;
|
||||||
double nzlEff;
|
double nzlEff;
|
||||||
|
|
|
@ -45,7 +45,7 @@ INCLUDES
|
||||||
# include STL_IOSTREAM
|
# include STL_IOSTREAM
|
||||||
# include STL_FSTREAM
|
# include STL_FSTREAM
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# else
|
# else
|
||||||
|
@ -56,10 +56,25 @@ INCLUDES
|
||||||
|
|
||||||
#include "FGfdmSocket.h"
|
#include "FGfdmSocket.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_OUTPUT "$Id$"
|
#define ID_OUTPUT "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Handles simulation output.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -60,13 +60,6 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
||||||
{
|
{
|
||||||
string token;
|
string token;
|
||||||
|
|
||||||
MinManifoldPressure_inHg = 6.5;
|
|
||||||
MaxManifoldPressure_inHg = 28.5;
|
|
||||||
Displacement = 360;
|
|
||||||
MaxHP = 200;
|
|
||||||
Cycles = 2;
|
|
||||||
IdleRPM = 600;
|
|
||||||
|
|
||||||
Name = Eng_cfg->GetValue("NAME");
|
Name = Eng_cfg->GetValue("NAME");
|
||||||
Eng_cfg->GetNextConfigLine();
|
Eng_cfg->GetNextConfigLine();
|
||||||
while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
|
while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
|
||||||
|
@ -86,7 +79,17 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
||||||
crank_counter = 0;
|
crank_counter = 0;
|
||||||
EngineNumber = 0;
|
EngineNumber = 0;
|
||||||
OilTemp_degK = 298;
|
OilTemp_degK = 298;
|
||||||
|
MinManifoldPressure_inHg = 6.5;
|
||||||
|
MaxManifoldPressure_inHg = 28.5;
|
||||||
ManifoldPressure_inHg = Atmosphere->GetPressure() * psftoinhg; // psf to in Hg
|
ManifoldPressure_inHg = Atmosphere->GetPressure() * psftoinhg; // psf to in Hg
|
||||||
|
CylinderHeadTemp_degK = 0.0;
|
||||||
|
Displacement = 360;
|
||||||
|
MaxHP = 200;
|
||||||
|
Cycles = 2;
|
||||||
|
IdleRPM = 600;
|
||||||
|
Magnetos = 0;
|
||||||
|
ExhaustGasTemp_degK = 0.0;
|
||||||
|
EGT_degC = 0.0;
|
||||||
|
|
||||||
dt = State->Getdt();
|
dt = State->Getdt();
|
||||||
|
|
||||||
|
@ -150,7 +153,8 @@ double FGPiston::Calculate(double PowerRequired)
|
||||||
p_amb_sea_level = Atmosphere->GetPressureSL() * 48;
|
p_amb_sea_level = Atmosphere->GetPressureSL() * 48;
|
||||||
T_amb = Atmosphere->GetTemperature() * (5.0 / 9.0); // convert from Rankine to Kelvin
|
T_amb = Atmosphere->GetTemperature() * (5.0 / 9.0); // convert from Rankine to Kelvin
|
||||||
|
|
||||||
RPM = Propulsion->GetThruster(EngineNumber)->GetRPM();
|
RPM = Propulsion->GetThruster(EngineNumber)->GetRPM() *
|
||||||
|
Propulsion->GetThruster(EngineNumber)->GetGearRatio();
|
||||||
|
|
||||||
IAS = Auxiliary->GetVcalibratedKTS();
|
IAS = Auxiliary->GetVcalibratedKTS();
|
||||||
|
|
||||||
|
@ -334,29 +338,34 @@ void FGPiston::doFuelFlow(void)
|
||||||
void FGPiston::doEnginePower(void)
|
void FGPiston::doEnginePower(void)
|
||||||
{
|
{
|
||||||
ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
|
ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
|
||||||
|
|
||||||
if (Running) {
|
if (Running) {
|
||||||
double ManXRPM = ManifoldPressure_inHg * RPM;
|
double ManXRPM = ManifoldPressure_inHg * RPM;
|
||||||
// FIXME: this needs to be generalized
|
double T_amb_degF = KelvinToFahrenheit(T_amb);
|
||||||
|
double T_amb_sea_lev_degF = KelvinToFahrenheit(288);
|
||||||
|
|
||||||
|
// FIXME: this needs to be generalized
|
||||||
Percentage_Power = (6e-9 * ManXRPM * ManXRPM) + (8e-4 * ManXRPM) - 1.0;
|
Percentage_Power = (6e-9 * ManXRPM * ManXRPM) + (8e-4 * ManXRPM) - 1.0;
|
||||||
double T_amb_degF = (T_amb * 1.8) - 459.67;
|
Percentage_Power += ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
|
||||||
double T_amb_sea_lev_degF = (288 * 1.8) - 459.67;
|
|
||||||
Percentage_Power =
|
|
||||||
Percentage_Power + ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
|
|
||||||
double Percentage_of_best_power_mixture_power =
|
double Percentage_of_best_power_mixture_power =
|
||||||
Power_Mixture_Correlation->GetValue(14.7 / equivalence_ratio);
|
Power_Mixture_Correlation->GetValue(14.7 / equivalence_ratio);
|
||||||
Percentage_Power =
|
|
||||||
Percentage_Power * Percentage_of_best_power_mixture_power / 100.0;
|
Percentage_Power *= Percentage_of_best_power_mixture_power / 100.0;
|
||||||
if (Percentage_Power < 0.0)
|
|
||||||
Percentage_Power = 0.0;
|
if (Percentage_Power < 0.0) Percentage_Power = 0.0;
|
||||||
else if (Percentage_Power > 100.0)
|
else if (Percentage_Power > 100.0) Percentage_Power = 100.0;
|
||||||
Percentage_Power = 100.0;
|
|
||||||
HP = Percentage_Power * MaxHP / 100.0;
|
HP = Percentage_Power * MaxHP / 100.0;
|
||||||
} else {
|
|
||||||
|
} else {
|
||||||
|
|
||||||
// Power output when the engine is not running
|
// Power output when the engine is not running
|
||||||
if (Cranking) {
|
if (Cranking) {
|
||||||
if (RPM < 10) {
|
if (RPM < 10) {
|
||||||
HP = 3.0; // This is a hack to prevent overshooting the idle rpm in the first time step
|
HP = 3.0; // This is a hack to prevent overshooting the idle rpm in
|
||||||
// It may possibly need to be changed if the prop model is changed.
|
// the first time step. It may possibly need to be changed
|
||||||
|
// if the prop model is changed.
|
||||||
} else if (RPM < 480) {
|
} else if (RPM < 480) {
|
||||||
HP = 3.0 + ((480 - RPM) / 10.0);
|
HP = 3.0 + ((480 - RPM) / 10.0);
|
||||||
// This is a guess - would be nice to find a proper starter moter torque curve
|
// This is a guess - would be nice to find a proper starter moter torque curve
|
||||||
|
|
|
@ -28,10 +28,6 @@ HISTORY
|
||||||
09/12/2000 JSB Created
|
09/12/2000 JSB Created
|
||||||
10/01/2001 DPM Modified to use equations from Dave Luff's piston model.
|
10/01/2001 DPM Modified to use equations from Dave Luff's piston model.
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -60,22 +56,14 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
DOCUMENTATION
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Models Dave Luff's engine model as ported into JSBSim by David Megginson.
|
/** Models Dave Luff's engine model as ported into JSBSim by David Megginson.
|
||||||
@author Jon S. Berndt (Engine framework code and framework-related mods)
|
@author Jon S. Berndt (Engine framework code and framework-related mods)
|
||||||
@author Dave Luff (engine operational code)
|
@author Dave Luff (engine operational code)
|
||||||
@author David Megginson (porting and additional code)
|
@author David Megginson (porting and additional code)
|
||||||
@version $Id$
|
@version "$Id$"
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPiston.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPiston.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -94,6 +82,18 @@ public:
|
||||||
double GetPowerAvailable(void) {return PowerAvailable;}
|
double GetPowerAvailable(void) {return PowerAvailable;}
|
||||||
double CalcFuelNeed(void);
|
double CalcFuelNeed(void);
|
||||||
|
|
||||||
|
void SetMagnetos(int magnetos) {Magnetos = magnetos;}
|
||||||
|
|
||||||
|
double GetEGT(void) { return EGT_degC; }
|
||||||
|
int GetMagnetos(void) {return Magnetos;}
|
||||||
|
|
||||||
|
double getExhaustGasTemp_degF(void) {return KelvinToFahrenheit(ExhaustGasTemp_degK);}
|
||||||
|
double getManifoldPressure_inHg(void) const {return ManifoldPressure_inHg;}
|
||||||
|
double getCylinderHeadTemp_degF(void) {return KelvinToFahrenheit(CylinderHeadTemp_degK);}
|
||||||
|
double getOilPressure_psi(void) const {return OilPressure_psi;}
|
||||||
|
double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
|
||||||
|
double getRPM(void) {return RPM;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int crank_counter;
|
int crank_counter;
|
||||||
|
|
||||||
|
@ -147,12 +147,13 @@ private:
|
||||||
double T_amb; // degrees Kelvin
|
double T_amb; // degrees Kelvin
|
||||||
double RPM; // revolutions per minute
|
double RPM; // revolutions per minute
|
||||||
double IAS; // knots
|
double IAS; // knots
|
||||||
|
bool Magneto_Left;
|
||||||
|
bool Magneto_Right;
|
||||||
|
int Magnetos;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Outputs (in addition to those in FGEngine).
|
// Outputs (in addition to those in FGEngine).
|
||||||
//
|
//
|
||||||
bool Magneto_Left;
|
|
||||||
bool Magneto_Right;
|
|
||||||
double rho_air;
|
double rho_air;
|
||||||
double volumetric_efficiency;
|
double volumetric_efficiency;
|
||||||
double m_dot_air;
|
double m_dot_air;
|
||||||
|
@ -161,6 +162,12 @@ private:
|
||||||
double Percentage_Power;
|
double Percentage_Power;
|
||||||
double HP;
|
double HP;
|
||||||
double combustion_efficiency;
|
double combustion_efficiency;
|
||||||
|
double ExhaustGasTemp_degK;
|
||||||
|
double EGT_degC;
|
||||||
|
double ManifoldPressure_inHg;
|
||||||
|
double CylinderHeadTemp_degK;
|
||||||
|
double OilPressure_psi;
|
||||||
|
double OilTemp_degK;
|
||||||
|
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
|
|
|
@ -65,7 +65,11 @@ INCLUDES
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__)
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# include <iomanip.h>
|
# if (_COMPILER_VERSION < 740)
|
||||||
|
# include <iomanip.h>
|
||||||
|
# else
|
||||||
|
# include <iomanip>
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
# include <cmath>
|
# include <cmath>
|
||||||
# include <iomanip>
|
# include <iomanip>
|
||||||
|
@ -104,13 +108,16 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex)
|
||||||
Name = "FGPosition";
|
Name = "FGPosition";
|
||||||
LongitudeDot = LatitudeDot = RadiusDot = 0.0;
|
LongitudeDot = LatitudeDot = RadiusDot = 0.0;
|
||||||
|
|
||||||
for (int i=0;i<3;i++) {
|
for (int i=0;i<4;i++) {
|
||||||
LatitudeDot_prev[i] = 0.0;
|
LatitudeDot_prev[i] = 0.0;
|
||||||
LongitudeDot_prev[i] = 0.0;
|
LongitudeDot_prev[i] = 0.0;
|
||||||
RadiusDot_prev[i] = 0.0;
|
RadiusDot_prev[i] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vVRPoffset.InitMatrix();
|
||||||
|
|
||||||
Longitude = Latitude = 0.0;
|
Longitude = Latitude = 0.0;
|
||||||
|
LongitudeVRP = LatitudeVRP = 0.0;
|
||||||
gamma = Vt = Vground = 0.0;
|
gamma = Vt = Vground = 0.0;
|
||||||
hoverbmac = hoverbcg = 0.0;
|
hoverbmac = hoverbcg = 0.0;
|
||||||
psigt = 0.0;
|
psigt = 0.0;
|
||||||
|
@ -155,7 +162,6 @@ bool FGPosition::Run(void)
|
||||||
{
|
{
|
||||||
double cosLat;
|
double cosLat;
|
||||||
double hdot_Vt;
|
double hdot_Vt;
|
||||||
FGColumnVector3 vMac;
|
|
||||||
|
|
||||||
if (!FGModel::Run()) {
|
if (!FGModel::Run()) {
|
||||||
GetState();
|
GetState();
|
||||||
|
@ -178,6 +184,23 @@ bool FGPosition::Run(void)
|
||||||
|
|
||||||
h = Radius - SeaLevelRadius; // Geocentric
|
h = Radius - SeaLevelRadius; // Geocentric
|
||||||
|
|
||||||
|
vVRPoffset = State->GetTb2l() * (vVRP - MassBalance->GetXYZcg());
|
||||||
|
vVRPoffset /= 12.0; // converted to feet
|
||||||
|
|
||||||
|
// vVRP - the vector to the Visual Reference Point - now contains the
|
||||||
|
// offset from the CG to the VRP, in units of feet, in the Local coordinate
|
||||||
|
// frame, where X points north, Y points East, and Z points down. This needs
|
||||||
|
// to be converted to Lat/Lon/Alt, now.
|
||||||
|
|
||||||
|
if (cosLat != 0)
|
||||||
|
LongitudeVRP = vVRPoffset(eEast) / (Radius * cosLat) + Longitude;
|
||||||
|
|
||||||
|
LatitudeVRP = vVRPoffset(eNorth) / Radius + Latitude;
|
||||||
|
hVRP = vVRPoffset(eDown) + h;
|
||||||
|
/*
|
||||||
|
cout << "Lat/Lon/Alt : " << Latitude << " / " << Longitude << " / " << h << endl;
|
||||||
|
cout << "Lat/Lon/Alt VRP: " << LatitudeVRP << " / " << LongitudeVRP << " / " << hVRP << endl << endl;
|
||||||
|
*/
|
||||||
DistanceAGL = Radius - RunwayRadius; // Geocentric
|
DistanceAGL = Radius - RunwayRadius; // Geocentric
|
||||||
|
|
||||||
hoverbcg = DistanceAGL/b;
|
hoverbcg = DistanceAGL/b;
|
||||||
|
|
|
@ -56,20 +56,12 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
DOCUMENTATION
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Models the lateral and longitudinal translational EOM.
|
/** Models the lateral and longitudinal translational EOM.
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPosition.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPosition.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -80,7 +72,7 @@ class FGPosition : public FGModel {
|
||||||
public:
|
public:
|
||||||
/** Constructor
|
/** Constructor
|
||||||
@param Executive a pointer to the parent executive object */
|
@param Executive a pointer to the parent executive object */
|
||||||
FGPosition(FGFDMExec*);
|
FGPosition(FGFDMExec* Executive);
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~FGPosition();
|
~FGPosition();
|
||||||
|
@ -100,10 +92,13 @@ public:
|
||||||
inline double GetVground(void) const { return Vground; }
|
inline double GetVground(void) const { return Vground; }
|
||||||
inline double GetGroundTrack(void) const { return psigt; }
|
inline double GetGroundTrack(void) const { return psigt; }
|
||||||
inline double Geth(void) const { return h; }
|
inline double Geth(void) const { return h; }
|
||||||
|
inline double GethVRP(void) const { return hVRP; }
|
||||||
inline double Gethdot(void) const { return RadiusDot; }
|
inline double Gethdot(void) const { return RadiusDot; }
|
||||||
inline double GetLatitude(void) const { return Latitude; }
|
inline double GetLatitude(void) const { return Latitude; }
|
||||||
|
inline double GetLatitudeVRP(void) const { return LatitudeVRP; }
|
||||||
inline double GetLatitudeDot(void) const { return LatitudeDot; }
|
inline double GetLatitudeDot(void) const { return LatitudeDot; }
|
||||||
inline double GetLongitude(void) const { return Longitude; }
|
inline double GetLongitude(void) const { return Longitude; }
|
||||||
|
inline double GetLongitudeVRP(void) const { return LongitudeVRP; }
|
||||||
inline double GetLongitudeDot(void) const { return LongitudeDot; }
|
inline double GetLongitudeDot(void) const { return LongitudeDot; }
|
||||||
inline double GetRunwayRadius(void) const { return RunwayRadius; }
|
inline double GetRunwayRadius(void) const { return RunwayRadius; }
|
||||||
inline double GetDistanceAGL(void) const { return DistanceAGL; }
|
inline double GetDistanceAGL(void) const { return DistanceAGL; }
|
||||||
|
@ -124,6 +119,7 @@ public:
|
||||||
inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
|
inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
|
||||||
vRunwayNormal << fgx << fgy << fgz;
|
vRunwayNormal << fgx << fgy << fgz;
|
||||||
}
|
}
|
||||||
|
void SetVRP(FGColumnVector3& vrp) {vVRP = vrp;}
|
||||||
|
|
||||||
void bind(void);
|
void bind(void);
|
||||||
void unbind(void);
|
void unbind(void);
|
||||||
|
@ -132,11 +128,15 @@ private:
|
||||||
FGColumnVector3 vVel;
|
FGColumnVector3 vVel;
|
||||||
FGColumnVector3 vVelDot;
|
FGColumnVector3 vVelDot;
|
||||||
FGColumnVector3 vRunwayNormal;
|
FGColumnVector3 vRunwayNormal;
|
||||||
|
FGColumnVector3 vVRP;
|
||||||
|
FGColumnVector3 vVRPoffset;
|
||||||
|
FGColumnVector3 vMac;
|
||||||
|
|
||||||
double Radius, h;
|
double Radius, h, hVRP;
|
||||||
double LatitudeDot, LongitudeDot, RadiusDot;
|
double LatitudeDot, LongitudeDot, RadiusDot;
|
||||||
double LatitudeDot_prev[3], LongitudeDot_prev[3], RadiusDot_prev[3];
|
double LatitudeDot_prev[4], LongitudeDot_prev[4], RadiusDot_prev[4];
|
||||||
double Longitude, Latitude;
|
double Longitude, Latitude;
|
||||||
|
double LongitudeVRP, LatitudeVRP;
|
||||||
double dt;
|
double dt;
|
||||||
double RunwayRadius;
|
double RunwayRadius;
|
||||||
double DistanceAGL;
|
double DistanceAGL;
|
||||||
|
|
|
@ -58,6 +58,7 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
|
||||||
int rows, cols;
|
int rows, cols;
|
||||||
|
|
||||||
MaxPitch = MinPitch = P_Factor = Sense = Pitch = 0.0;
|
MaxPitch = MinPitch = P_Factor = Sense = Pitch = 0.0;
|
||||||
|
GearRatio = 1.0;
|
||||||
|
|
||||||
Name = Prop_cfg->GetValue("NAME");
|
Name = Prop_cfg->GetValue("NAME");
|
||||||
Prop_cfg->GetNextConfigLine();
|
Prop_cfg->GetNextConfigLine();
|
||||||
|
@ -70,6 +71,8 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
|
||||||
Diameter /= 12.0;
|
Diameter /= 12.0;
|
||||||
} else if (token == "NUMBLADES") {
|
} else if (token == "NUMBLADES") {
|
||||||
*Prop_cfg >> numBlades;
|
*Prop_cfg >> numBlades;
|
||||||
|
} else if (token == "GEARRATIO") {
|
||||||
|
*Prop_cfg >> GearRatio;
|
||||||
} else if (token == "MINPITCH") {
|
} else if (token == "MINPITCH") {
|
||||||
*Prop_cfg >> MinPitch;
|
*Prop_cfg >> MinPitch;
|
||||||
} else if (token == "MAXPITCH") {
|
} else if (token == "MAXPITCH") {
|
||||||
|
@ -176,7 +179,7 @@ double FGPropeller::Calculate(double PowerAvailable)
|
||||||
|
|
||||||
if (omega <= 5) omega = 1.0;
|
if (omega <= 5) omega = 1.0;
|
||||||
|
|
||||||
ExcessTorque = PowerAvailable / omega;
|
ExcessTorque = PowerAvailable / omega * GearRatio;
|
||||||
RPM = (RPS + ((ExcessTorque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
|
RPM = (RPS + ((ExcessTorque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
|
||||||
|
|
||||||
// The friction from the engine should
|
// The friction from the engine should
|
||||||
|
@ -217,7 +220,7 @@ double FGPropeller::GetPowerRequired(void)
|
||||||
else if (Pitch > MaxPitch) Pitch = MaxPitch;
|
else if (Pitch > MaxPitch) Pitch = MaxPitch;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Pitch = MaxPitch - (MaxPitch - MinPitch) * advance;
|
Pitch = MinPitch + (MaxPitch - MinPitch) * advance;
|
||||||
}
|
}
|
||||||
cPReq = cPower->GetValue(J, Pitch);
|
cPReq = cPower->GetValue(J, Pitch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,10 +55,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -83,10 +79,6 @@ CLASS DOCUMENTATION
|
||||||
@see FGEngine
|
@see FGEngine
|
||||||
@see FGThruster
|
@see FGThruster
|
||||||
@see FGTable
|
@see FGTable
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropeller.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropeller.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -126,7 +126,7 @@ string FGPropertyManager::GetFullyQualifiedName(void) {
|
||||||
}
|
}
|
||||||
fqname+= stack[0];
|
fqname+= stack[0];
|
||||||
return fqname;
|
return fqname;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,19 +53,11 @@ using namespace std;
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Class wrapper for property handling.
|
/** Class wrapper for property handling.
|
||||||
@author David Megginson, Tony Peden
|
@author David Megginson, Tony Peden
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -382,7 +374,7 @@ class FGPropertyManager : public SGPropertyNode {
|
||||||
void Untie (const string &name);
|
void Untie (const string &name);
|
||||||
|
|
||||||
|
|
||||||
// Templates cause ambiguity here
|
// Templates cause ambiguity here
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tie a property to an external bool variable.
|
* Tie a property to an external bool variable.
|
||||||
|
@ -508,9 +500,11 @@ class FGPropertyManager : public SGPropertyNode {
|
||||||
bool useDefault = true)
|
bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
|
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
|
||||||
useDefault))
|
useDefault))
|
||||||
|
{
|
||||||
cout <<
|
cout <<
|
||||||
"Failed to tie property " << name << " to functions" << endl;
|
"Failed to tie property " << name << " to functions" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -537,12 +531,11 @@ class FGPropertyManager : public SGPropertyNode {
|
||||||
void (*setter)(int, V) = 0, bool useDefault = true)
|
void (*setter)(int, V) = 0, bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(),
|
if (!tie(name.c_str(),
|
||||||
SGRawValueFunctionsIndexed<V>(index,
|
SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
|
||||||
getter,
|
{
|
||||||
setter),
|
|
||||||
useDefault))
|
|
||||||
cout <<
|
cout <<
|
||||||
"Failed to tie property " << name << " to indexed functions" << endl;
|
"Failed to tie property " << name << " to indexed functions" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -570,10 +563,11 @@ class FGPropertyManager : public SGPropertyNode {
|
||||||
void (T::*setter)(V) = 0, bool useDefault = true)
|
void (T::*setter)(V) = 0, bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(),
|
if (!tie(name.c_str(),
|
||||||
SGRawValueMethods<T,V>(*obj, getter, setter),
|
SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
|
||||||
useDefault))
|
{
|
||||||
cout <<
|
cout <<
|
||||||
"Failed to tie property " << name << " to object methods" << endl;
|
"Failed to tie property " << name << " to object methods" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -601,13 +595,11 @@ class FGPropertyManager : public SGPropertyNode {
|
||||||
bool useDefault = true)
|
bool useDefault = true)
|
||||||
{
|
{
|
||||||
if (!tie(name.c_str(),
|
if (!tie(name.c_str(),
|
||||||
SGRawValueMethodsIndexed<T,V>(*obj,
|
SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
|
||||||
index,
|
{
|
||||||
getter,
|
|
||||||
setter),
|
|
||||||
useDefault))
|
|
||||||
cout <<
|
cout <<
|
||||||
"Failed to tie property " << name << " to indexed object methods" << endl;
|
"Failed to tie property " << name << " to indexed object methods" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,12 +79,15 @@ CLASS IMPLEMENTATION
|
||||||
FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec)
|
FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec)
|
||||||
{
|
{
|
||||||
Name = "FGPropulsion";
|
Name = "FGPropulsion";
|
||||||
|
|
||||||
numSelectedFuelTanks = numSelectedOxiTanks = 0;
|
numSelectedFuelTanks = numSelectedOxiTanks = 0;
|
||||||
numTanks = numEngines = numThrusters = 0;
|
numTanks = numEngines = numThrusters = 0;
|
||||||
numOxiTanks = numFuelTanks = 0;
|
numOxiTanks = numFuelTanks = 0;
|
||||||
dt = 0.0;
|
dt = 0.0;
|
||||||
ActiveEngine = -1; // -1: ALL, 0: Engine 1, 1: Engine 2 ...
|
ActiveEngine = -1; // -1: ALL, 0: Engine 1, 1: Engine 2 ...
|
||||||
|
|
||||||
bind();
|
bind();
|
||||||
|
|
||||||
Debug(0);
|
Debug(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,6 +384,8 @@ string FGPropulsion::GetPropulsionStrings(void)
|
||||||
case FGEngine::etTurbine:
|
case FGEngine::etTurbine:
|
||||||
break;
|
break;
|
||||||
case FGEngine::etSimTurbine:
|
case FGEngine::etSimTurbine:
|
||||||
|
PropulsionStrings += (Engines[i]->GetName() + "_N1[" + buffer + "], ");
|
||||||
|
PropulsionStrings += (Engines[i]->GetName() + "_N2[" + buffer + "]");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PropulsionStrings += "INVALID ENGINE TYPE";
|
PropulsionStrings += "INVALID ENGINE TYPE";
|
||||||
|
@ -406,6 +411,9 @@ string FGPropulsion::GetPropulsionStrings(void)
|
||||||
PropulsionStrings += (Thrusters[i]->GetName() + "_Pitch[" + buffer + "], ");
|
PropulsionStrings += (Thrusters[i]->GetName() + "_Pitch[" + buffer + "], ");
|
||||||
PropulsionStrings += (Thrusters[i]->GetName() + "_RPM[" + buffer + "]");
|
PropulsionStrings += (Thrusters[i]->GetName() + "_RPM[" + buffer + "]");
|
||||||
break;
|
break;
|
||||||
|
case FGThruster::ttDirect:
|
||||||
|
PropulsionStrings += (Thrusters[i]->GetName() + "_Thrust[" + buffer + "]");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
PropulsionStrings += "INVALID THRUSTER TYPE";
|
PropulsionStrings += "INVALID THRUSTER TYPE";
|
||||||
break;
|
break;
|
||||||
|
@ -437,6 +445,8 @@ string FGPropulsion::GetPropulsionValues(void)
|
||||||
case FGEngine::etTurbine:
|
case FGEngine::etTurbine:
|
||||||
break;
|
break;
|
||||||
case FGEngine::etSimTurbine:
|
case FGEngine::etSimTurbine:
|
||||||
|
PropulsionValues += (string(gcvt(((FGSimTurbine*)Engines[i])->GetN1(), 10, buff))) + ", ";
|
||||||
|
PropulsionValues += (string(gcvt(((FGSimTurbine*)Engines[i])->GetN2(), 10, buff)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,6 +458,9 @@ string FGPropulsion::GetPropulsionValues(void)
|
||||||
break;
|
break;
|
||||||
case FGThruster::ttRotor:
|
case FGThruster::ttRotor:
|
||||||
break;
|
break;
|
||||||
|
case FGThruster::ttDirect:
|
||||||
|
PropulsionValues += (string(gcvt(((FGThruster*)Thrusters[i])->GetThrust(), 10, buff)));
|
||||||
|
break;
|
||||||
case FGThruster::ttPropeller:
|
case FGThruster::ttPropeller:
|
||||||
FGPropeller* Propeller = (FGPropeller*)Thrusters[i];
|
FGPropeller* Propeller = (FGPropeller*)Thrusters[i];
|
||||||
FGColumnVector3 vPFactor = Propeller->GetPFactor();
|
FGColumnVector3 vPFactor = Propeller->GetPFactor();
|
||||||
|
@ -564,12 +577,12 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
|
||||||
|
|
||||||
void FGPropulsion::SetMagnetos(int setting)
|
void FGPropulsion::SetMagnetos(int setting)
|
||||||
{
|
{
|
||||||
if (ActiveEngine == -1) {
|
if (ActiveEngine < 0) {
|
||||||
for (unsigned i=0; i<Engines.size(); i++) {
|
for (unsigned i=0; i<Engines.size(); i++) {
|
||||||
Engines[i]->SetMagnetos(setting);
|
((FGPiston*)Engines[i])->SetMagnetos(setting);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Engines[ActiveEngine]->SetMagnetos(setting);
|
((FGPiston*)Engines[ActiveEngine])->SetMagnetos(setting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,9 +590,12 @@ void FGPropulsion::SetMagnetos(int setting)
|
||||||
|
|
||||||
void FGPropulsion::SetStarter(int setting)
|
void FGPropulsion::SetStarter(int setting)
|
||||||
{
|
{
|
||||||
if (ActiveEngine == -1) {
|
if (ActiveEngine < 0) {
|
||||||
for (unsigned i=0; i<Engines.size(); i++) {
|
for (unsigned i=0; i<Engines.size(); i++) {
|
||||||
Engines[i]->SetStarter(setting);
|
if (setting == 0)
|
||||||
|
Engines[i]->SetStarter(false);
|
||||||
|
else
|
||||||
|
Engines[i]->SetStarter(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (setting == 0)
|
if (setting == 0)
|
||||||
|
@ -591,9 +607,28 @@ void FGPropulsion::SetStarter(int setting)
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
void FGPropulsion::SetCutoff(int setting)
|
||||||
|
{
|
||||||
|
if (ActiveEngine < 0) {
|
||||||
|
for (unsigned i=0; i<Engines.size(); i++) {
|
||||||
|
if (setting == 0)
|
||||||
|
((FGSimTurbine*)Engines[i])->SetCutoff(false);
|
||||||
|
else
|
||||||
|
((FGSimTurbine*)Engines[i])->SetCutoff(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (setting == 0)
|
||||||
|
((FGSimTurbine*)Engines[ActiveEngine])->SetCutoff(false);
|
||||||
|
else
|
||||||
|
((FGSimTurbine*)Engines[ActiveEngine])->SetCutoff(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
void FGPropulsion::SetActiveEngine(int engine)
|
void FGPropulsion::SetActiveEngine(int engine)
|
||||||
{
|
{
|
||||||
if ( unsigned(engine) > Engines.size())
|
if (engine >= Engines.size() || engine < 0)
|
||||||
ActiveEngine = -1;
|
ActiveEngine = -1;
|
||||||
else
|
else
|
||||||
ActiveEngine = engine;
|
ActiveEngine = engine;
|
||||||
|
@ -605,28 +640,14 @@ void FGPropulsion::bind(void)
|
||||||
{
|
{
|
||||||
typedef double (FGPropulsion::*PMF)(int) const;
|
typedef double (FGPropulsion::*PMF)(int) const;
|
||||||
typedef int (FGPropulsion::*iPMF)(void) const;
|
typedef int (FGPropulsion::*iPMF)(void) const;
|
||||||
/* PropertyManager->Tie("propulsion/num-engines", this,
|
|
||||||
&FGPropulsion::GetNumEngines);
|
|
||||||
PropertyManager->Tie("propulsion/num-tanks", this,
|
|
||||||
&FGPropulsion::GetNumTanks); */
|
|
||||||
|
|
||||||
PropertyManager->Tie("propulsion/magneto_cmd", this,
|
PropertyManager->Tie("propulsion/magneto_cmd", this,
|
||||||
(iPMF)0,
|
(iPMF)0, &FGPropulsion::SetMagnetos, true);
|
||||||
&FGPropulsion::SetMagnetos,
|
|
||||||
true);
|
|
||||||
PropertyManager->Tie("propulsion/starter_cmd", this,
|
PropertyManager->Tie("propulsion/starter_cmd", this,
|
||||||
(iPMF)0,
|
(iPMF)0, &FGPropulsion::SetStarter, true);
|
||||||
&FGPropulsion::SetStarter,
|
PropertyManager->Tie("propulsion/cutoff_cmd", this,
|
||||||
true);
|
(iPMF)0, &FGPropulsion::SetCutoff, true);
|
||||||
PropertyManager->Tie("propulsion/active_engine", this,
|
|
||||||
(iPMF)0,
|
|
||||||
&FGPropulsion::SetActiveEngine,
|
|
||||||
true);
|
|
||||||
|
|
||||||
PropertyManager->Tie("propulsion/num-sel-fuel-tanks", this,
|
|
||||||
&FGPropulsion::GetnumSelectedFuelTanks);
|
|
||||||
PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
|
|
||||||
&FGPropulsion::GetnumSelectedOxiTanks);
|
|
||||||
PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
|
PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
|
||||||
(PMF)&FGPropulsion::GetForces);
|
(PMF)&FGPropulsion::GetForces);
|
||||||
PropertyManager->Tie("forces/fby-prop-lbs", this,2,
|
PropertyManager->Tie("forces/fby-prop-lbs", this,2,
|
||||||
|
@ -639,20 +660,18 @@ void FGPropulsion::bind(void)
|
||||||
(PMF)&FGPropulsion::GetMoments);
|
(PMF)&FGPropulsion::GetMoments);
|
||||||
PropertyManager->Tie("moments/n-prop-lbsft", this,3,
|
PropertyManager->Tie("moments/n-prop-lbsft", this,3,
|
||||||
(PMF)&FGPropulsion::GetMoments);
|
(PMF)&FGPropulsion::GetMoments);
|
||||||
//PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
|
|
||||||
// &FGPropulsion::GetTanksWeight);
|
PropertyManager->Tie("propulsion/active_engine", this,
|
||||||
|
&FGPropulsion::GetActiveEngine, &FGPropulsion::SetActiveEngine, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
void FGPropulsion::unbind(void)
|
void FGPropulsion::unbind(void)
|
||||||
{
|
{
|
||||||
/* PropertyManager->Untie("propulsion/num-engines");
|
|
||||||
PropertyManager->Untie("propulsion/num-tanks"); */
|
|
||||||
PropertyManager->Untie("propulsion/num-sel-fuel-tanks");
|
|
||||||
PropertyManager->Untie("propulsion/num-sel-ox-tanks");
|
|
||||||
PropertyManager->Untie("propulsion/magneto_cmd");
|
PropertyManager->Untie("propulsion/magneto_cmd");
|
||||||
PropertyManager->Untie("propulsion/starter_cmd");
|
PropertyManager->Untie("propulsion/starter_cmd");
|
||||||
|
PropertyManager->Untie("propulsion/cutoff_cmd");
|
||||||
PropertyManager->Untie("propulsion/active_engine");
|
PropertyManager->Untie("propulsion/active_engine");
|
||||||
PropertyManager->Untie("forces/fbx-prop-lbs");
|
PropertyManager->Untie("forces/fbx-prop-lbs");
|
||||||
PropertyManager->Untie("forces/fby-prop-lbs");
|
PropertyManager->Untie("forces/fby-prop-lbs");
|
||||||
|
@ -660,7 +679,6 @@ void FGPropulsion::unbind(void)
|
||||||
PropertyManager->Untie("moments/l-prop-lbsft");
|
PropertyManager->Untie("moments/l-prop-lbsft");
|
||||||
PropertyManager->Untie("moments/m-prop-lbsft");
|
PropertyManager->Untie("moments/m-prop-lbsft");
|
||||||
PropertyManager->Untie("moments/n-prop-lbsft");
|
PropertyManager->Untie("moments/n-prop-lbsft");
|
||||||
//PropertyManager->Untie("propulsion/tanks-weight-lbs");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -74,27 +74,33 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Propulsion management class.
|
/** Propulsion management class.
|
||||||
FGPropulsion manages all aspects of propulsive force generation, including
|
The Propulsion class is the container for the entire propulsion system, which is
|
||||||
containment of engines, tanks, and thruster class instances in STL vectors,
|
comprised of engines, tanks, and "thrusters" (the device that transforms the
|
||||||
and the interaction and communication between them.
|
engine power into a force that acts on the aircraft, such as a nozzle or
|
||||||
|
propeller). Once the Propulsion class gets the config file, it reads in
|
||||||
|
information which is specific to a type of engine. Then:
|
||||||
|
|
||||||
|
-# The appropriate engine type instance is created
|
||||||
|
-# A thruster object is instantiated, and is linked to the engine
|
||||||
|
-# At least one tank object is created, and is linked to an engine.
|
||||||
|
|
||||||
|
At Run time each engines Calculate() method is called to return the excess power
|
||||||
|
generated during that iteration. The drag from the previous iteration is sub-
|
||||||
|
tracted to give the excess power available for thrust this pass. That quantity
|
||||||
|
is passed to the thrusters associated with a particular engine - perhaps with a
|
||||||
|
scaling mechanism (gearing?) to allow the engine to give its associated thrust-
|
||||||
|
ers specific distributed portions of the excess power.
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see FGEngine
|
@see
|
||||||
@see FGTank
|
FGEngine
|
||||||
@see FGThruster
|
FGTank
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
FGThruster
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -144,7 +150,7 @@ public:
|
||||||
if (index <= Engines.size()-1) return Engines[index];
|
if (index <= Engines.size()-1) return Engines[index];
|
||||||
else return 0L; }
|
else return 0L; }
|
||||||
|
|
||||||
// Retrieves the number of tanks defined for the aircraft.
|
/// Retrieves the number of tanks defined for the aircraft.
|
||||||
inline unsigned int GetNumTanks(void) const {return Tanks.size();}
|
inline unsigned int GetNumTanks(void) const {return Tanks.size();}
|
||||||
|
|
||||||
/** Retrieves a tank object pointer from the list of tanks.
|
/** Retrieves a tank object pointer from the list of tanks.
|
||||||
|
@ -192,9 +198,17 @@ public:
|
||||||
double GetTanksIzz(const FGColumnVector3& vXYZcg);
|
double GetTanksIzz(const FGColumnVector3& vXYZcg);
|
||||||
double GetTanksIxz(const FGColumnVector3& vXYZcg);
|
double GetTanksIxz(const FGColumnVector3& vXYZcg);
|
||||||
double GetTanksIxy(const FGColumnVector3& vXYZcg);
|
double GetTanksIxy(const FGColumnVector3& vXYZcg);
|
||||||
|
|
||||||
|
inline int GetActiveEngine(void) const
|
||||||
|
{
|
||||||
|
return ActiveEngine;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int GetActiveEngine(void);
|
||||||
|
|
||||||
void SetMagnetos(int setting);
|
void SetMagnetos(int setting);
|
||||||
void SetStarter(int setting);
|
void SetStarter(int setting);
|
||||||
|
void SetCutoff(int setting=0);
|
||||||
void SetActiveEngine(int engine);
|
void SetActiveEngine(int engine);
|
||||||
|
|
||||||
void bind();
|
void bind();
|
||||||
|
|
|
@ -73,6 +73,7 @@ FGRocket::FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec)
|
||||||
|
|
||||||
EngineNumber = 0;
|
EngineNumber = 0;
|
||||||
Type = etRocket;
|
Type = etRocket;
|
||||||
|
Flameout = false;
|
||||||
|
|
||||||
PC = 0.0;
|
PC = 0.0;
|
||||||
kFactor = (2.0*SHR*SHR/(SHR-1.0))*pow(2.0/(SHR+1), (SHR+1)/(SHR-1));
|
kFactor = (2.0*SHR*SHR/(SHR-1.0))*pow(2.0/(SHR+1), (SHR+1)/(SHR-1));
|
||||||
|
@ -80,7 +81,7 @@ FGRocket::FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec)
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
FGRocket::~FGRocket()
|
FGRocket::~FGRocket(void)
|
||||||
{
|
{
|
||||||
Debug(1);
|
Debug(1);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +92,7 @@ double FGRocket::Calculate(double pe)
|
||||||
{
|
{
|
||||||
double Cf=0;
|
double Cf=0;
|
||||||
|
|
||||||
ConsumeFuel();
|
if (!Flameout && !Starved) ConsumeFuel();
|
||||||
|
|
||||||
Throttle = FCS->GetThrottlePos(EngineNumber);
|
Throttle = FCS->GetThrottlePos(EngineNumber);
|
||||||
|
|
||||||
|
|
|
@ -53,10 +53,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -70,9 +66,9 @@ CLASS DOCUMENTATION
|
||||||
<li>Variance (in percent, from 0 to 1.0, nominally 0.05)</li>
|
<li>Variance (in percent, from 0 to 1.0, nominally 0.05)</li>
|
||||||
</ul>
|
</ul>
|
||||||
Additionally, the following control inputs, operating characteristics, and
|
Additionally, the following control inputs, operating characteristics, and
|
||||||
location are required, as with all other engine types:</font>
|
location are required, as with all other engine types:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Throttle setting (in percent, from 0 to 1.0)</font></li>
|
<li>Throttle setting (in percent, from 0 to 1.0)</li>
|
||||||
<li>Maximum allowable throttle setting</li>
|
<li>Maximum allowable throttle setting</li>
|
||||||
<li>Minimum working throttle setting</li>
|
<li>Minimum working throttle setting</li>
|
||||||
<li>Sea level fuel flow at maximum thrust</li>
|
<li>Sea level fuel flow at maximum thrust</li>
|
||||||
|
@ -89,17 +85,13 @@ CLASS DOCUMENTATION
|
||||||
determined.
|
determined.
|
||||||
|
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
$Id$
|
||||||
@see FGNozzle
|
@see FGNozzle,
|
||||||
@see FGThruster
|
FGThruster,
|
||||||
@see FGForce
|
FGForce,
|
||||||
@see FGEngine
|
FGEngine,
|
||||||
@see FGPropulsion
|
FGPropulsion,
|
||||||
@see FGTank
|
FGTank
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGRocket.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGRocket.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -115,7 +107,7 @@ public:
|
||||||
FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg);
|
FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg);
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
~FGRocket();
|
~FGRocket(void);
|
||||||
|
|
||||||
/** Determines the thrust coefficient.
|
/** Determines the thrust coefficient.
|
||||||
This routine takes the nozzle exit pressure and calculates the thrust
|
This routine takes the nozzle exit pressure and calculates the thrust
|
||||||
|
@ -128,6 +120,12 @@ public:
|
||||||
@return chamber pressure in psf. */
|
@return chamber pressure in psf. */
|
||||||
double GetChamberPressure(void) {return PC;}
|
double GetChamberPressure(void) {return PC;}
|
||||||
|
|
||||||
|
/** Gets the flame-out status.
|
||||||
|
The engine will "flame out" if the throttle is set below the minimum
|
||||||
|
sustainable setting.
|
||||||
|
@return true if engine has flamed out. */
|
||||||
|
bool GetFlameout(void) {return Flameout;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double SHR;
|
double SHR;
|
||||||
double maxPC;
|
double maxPC;
|
||||||
|
@ -135,6 +133,8 @@ private:
|
||||||
double kFactor;
|
double kFactor;
|
||||||
double Variance;
|
double Variance;
|
||||||
double PC;
|
double PC;
|
||||||
|
bool Flameout;
|
||||||
|
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex)
|
||||||
vPQRdot_prev[0].InitMatrix();
|
vPQRdot_prev[0].InitMatrix();
|
||||||
vPQRdot_prev[1].InitMatrix();
|
vPQRdot_prev[1].InitMatrix();
|
||||||
vPQRdot_prev[2].InitMatrix();
|
vPQRdot_prev[2].InitMatrix();
|
||||||
|
vPQRdot_prev[3].InitMatrix();
|
||||||
|
|
||||||
bind();
|
bind();
|
||||||
|
|
||||||
|
|
|
@ -27,24 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
12/02/98 JSB Created
|
12/02/98 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
[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
|
|
||||||
|
|
||||||
The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
|
||||||
or Y-P-R, or Z-Y-X, if you prefer.
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -72,10 +54,38 @@ INCLUDES
|
||||||
#include "FGColumnVector3.h"
|
#include "FGColumnVector3.h"
|
||||||
#include "FGColumnVector4.h"
|
#include "FGColumnVector4.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_ROTATION "$Id$"
|
#define ID_ROTATION "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models the rotational portion of the Equations of Motion.
|
||||||
|
Note: The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
||||||
|
or Y-P-R, or Z-Y-X, if you prefer.
|
||||||
|
@see 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
|
||||||
|
@see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||||
|
JSC 12960, July 1977
|
||||||
|
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||||
|
NASA-Ames", NASA CR-2497, January 1975
|
||||||
|
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||||
|
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||||
|
@see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||||
|
1982 ISBN 0-471-08936-2
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -127,7 +137,7 @@ private:
|
||||||
FGColumnVector3 vPQR;
|
FGColumnVector3 vPQR;
|
||||||
FGColumnVector3 vAeroPQR;
|
FGColumnVector3 vAeroPQR;
|
||||||
FGColumnVector3 vPQRdot;
|
FGColumnVector3 vPQRdot;
|
||||||
FGColumnVector3 vPQRdot_prev[3];
|
FGColumnVector3 vPQRdot_prev[4];
|
||||||
FGColumnVector3 vMoments;
|
FGColumnVector3 vMoments;
|
||||||
FGColumnVector3 vEuler;
|
FGColumnVector3 vEuler;
|
||||||
FGColumnVector3 vEulerRates;
|
FGColumnVector3 vEulerRates;
|
||||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
08/24/00 JSB Created
|
08/24/00 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -44,10 +40,25 @@ INCLUDES
|
||||||
|
|
||||||
#include "FGThruster.h"
|
#include "FGThruster.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_ROTOR "$Id$"
|
#define ID_ROTOR "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models a rotor (such as for a helicopter); NOT YET IMPLEMENTED.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -46,7 +46,7 @@ INCLUDES
|
||||||
# include STL_IOSTREAM
|
# include STL_IOSTREAM
|
||||||
# include STL_ITERATOR
|
# include STL_ITERATOR
|
||||||
#else
|
#else
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# else
|
# else
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
|
|
|
@ -54,27 +54,16 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Encapsulates the JSBSim scripting capability.
|
/** Encapsulates the JSBSim scripting capability.
|
||||||
@author Jon S. Berndt
|
|
||||||
@version $Id$
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGScript.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGScript.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
|
|
||||||
<h4>Scripting support provided via FGScript.</h4>
|
<h4>Scripting support provided via FGScript.</h4>
|
||||||
|
|
||||||
<p>There is simple scripting support provided in the FGScript
|
<p>There is simple scripting support provided in the FGScript
|
||||||
class. Commands are specified using the <u>Simple Scripting
|
class. Commands are specified using the <em>Simple Scripting
|
||||||
Directives for JSBSim</u> (SSDJ). The script file is in XML
|
Directives for JSBSim</em> (SSDJ). The script file is in XML
|
||||||
format. A test condition (or conditions) can be set up in the
|
format. A test condition (or conditions) can be set up in the
|
||||||
script and when the condition evaluates to true, the specified
|
script and when the condition evaluates to true, the specified
|
||||||
action[s] is/are taken. A test condition can be <em>persistent</em>,
|
action[s] is/are taken. A test condition can be <em>persistent</em>,
|
||||||
|
@ -128,6 +117,8 @@ CLASS DOCUMENTATION
|
||||||
to be used are specified in the "use" lines. Next,
|
to be used are specified in the "use" lines. Next,
|
||||||
comes the "run" section, where the conditions are
|
comes the "run" section, where the conditions are
|
||||||
described in "when" clauses.</p>
|
described in "when" clauses.</p>
|
||||||
|
@author Jon S. Berndt
|
||||||
|
@version "$Id$"
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ CLASS IMPLEMENTATION
|
||||||
FGSimTurbine::FGSimTurbine(FGFDMExec* exec, FGConfigFile* cfg) : FGEngine(exec)
|
FGSimTurbine::FGSimTurbine(FGFDMExec* exec, FGConfigFile* cfg) : FGEngine(exec)
|
||||||
{
|
{
|
||||||
SetDefaults();
|
SetDefaults();
|
||||||
FGEngine::Type=etSimTurbine;
|
|
||||||
Load(cfg);
|
Load(cfg);
|
||||||
Debug(0);
|
Debug(0);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ double FGSimTurbine::Calculate(double dummy)
|
||||||
phase = tpRun;
|
phase = tpRun;
|
||||||
N2 = IdleN2;
|
N2 = IdleN2;
|
||||||
N1 = IdleN1;
|
N1 = IdleN1;
|
||||||
OilTemp_degK = TAT + 10;
|
OilTemp_degK = 366.0;
|
||||||
Cutoff = false;
|
Cutoff = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -121,121 +121,125 @@ double FGSimTurbine::Calculate(double dummy)
|
||||||
|
|
||||||
double FGSimTurbine::Off(void)
|
double FGSimTurbine::Off(void)
|
||||||
{
|
{
|
||||||
double qbar = Translation->Getqbar();
|
double qbar = Translation->Getqbar();
|
||||||
Running = false;
|
Running = false;
|
||||||
FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.0);
|
FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.0);
|
||||||
N1 = Seek(&N1, qbar/10.0, N1/2.0, N1/2.0);
|
N1 = Seek(&N1, qbar/10.0, N1/2.0, N1/2.0);
|
||||||
N2 = Seek(&N2, qbar/15.0, N2/2.0, N2/2.0);
|
N2 = Seek(&N2, qbar/15.0, N2/2.0, N2/2.0);
|
||||||
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
||||||
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
||||||
OilPressure_psi = N2 * 0.62;
|
OilPressure_psi = N2 * 0.62;
|
||||||
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
||||||
EPR = Seek(&EPR, 1.0, 0.2, 0.2);
|
EPR = Seek(&EPR, 1.0, 0.2, 0.2);
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
double FGSimTurbine::Run(void)
|
double FGSimTurbine::Run(void)
|
||||||
{
|
{
|
||||||
double idlethrust, milthrust, thrust;
|
double idlethrust, milthrust, thrust;
|
||||||
double N2norm; // 0.0 = idle N2, 1.0 = maximum N2
|
double N2norm; // 0.0 = idle N2, 1.0 = maximum N2
|
||||||
idlethrust = MilThrust * ThrustTables[0]->TotalValue();
|
idlethrust = MilThrust * ThrustTables[0]->TotalValue();
|
||||||
milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
|
milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
|
||||||
|
|
||||||
|
Running = true;
|
||||||
|
Starter = false;
|
||||||
|
|
||||||
Running = true;
|
N2 = Seek(&N2, IdleN2 + ThrottleCmd * N2_factor, delay, delay * 3.0);
|
||||||
Starter = false;
|
N1 = Seek(&N1, IdleN1 + ThrottleCmd * N1_factor, delay, delay * 2.4);
|
||||||
|
N2norm = (N2 - IdleN2) / N2_factor;
|
||||||
N2 = Seek(&N2, IdleN2 + ThrottleCmd * N2_factor, delay, delay * 3.0);
|
thrust = idlethrust + (milthrust * N2norm * N2norm);
|
||||||
N1 = Seek(&N1, IdleN1 + ThrottleCmd * N1_factor, delay, delay * 2.4);
|
thrust = thrust * (1.0 - BleedDemand);
|
||||||
N2norm = (N2 - IdleN2) / N2_factor;
|
EGT_degC = TAT + 363.1 + ThrottleCmd * 357.1;
|
||||||
thrust = idlethrust + (milthrust * N2norm * N2norm);
|
OilPressure_psi = N2 * 0.62;
|
||||||
thrust = thrust * (1.0 - BleedDemand);
|
OilTemp_degK = Seek(&OilTemp_degK, 366.0, 1.2, 0.1);
|
||||||
EGT_degC = TAT + 363.1 + ThrottleCmd * 357.1;
|
EPR = 1.0 + thrust/MilThrust;
|
||||||
OilPressure_psi = N2 * 0.62;
|
|
||||||
OilTemp_degK = Seek(&OilTemp_degK, 366.0, 1.2, 0.1);
|
|
||||||
EPR = 1.0 + thrust/MilThrust;
|
|
||||||
if (!Augmentation) {
|
|
||||||
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * TSFC, 1000.0, 100000);
|
|
||||||
if (FuelFlow_pph < IdleFF) FuelFlow_pph = IdleFF;
|
|
||||||
NozzlePosition = Seek(&NozzlePosition, 1.0 - N2norm, 0.8, 0.8);
|
|
||||||
}
|
|
||||||
if (Reversed) thrust = thrust * -0.2;
|
|
||||||
|
|
||||||
if (AugMethod == 1) {
|
if (!Augmentation) {
|
||||||
if ((ThrottleCmd > 0.99) && (N2 > 97.0)) {Augmentation = true;}
|
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * TSFC, 1000.0, 100000);
|
||||||
else {Augmentation = false;}
|
if (FuelFlow_pph < IdleFF) FuelFlow_pph = IdleFF;
|
||||||
}
|
NozzlePosition = Seek(&NozzlePosition, 1.0 - N2norm, 0.8, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
if ((Augmented == 1) && Augmentation) {
|
if (AugMethod == 1) {
|
||||||
thrust = MaxThrust * ThrustTables[2]->TotalValue();
|
if ((ThrottleCmd > 0.99) && (N2 > 97.0)) {Augmentation = true;}
|
||||||
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * ATSFC, 5000.0, 10000.0);
|
else {Augmentation = false;}
|
||||||
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((Injected == 1) && Injection)
|
if ((Augmented == 1) && Augmentation) {
|
||||||
thrust = thrust * ThrustTables[3]->TotalValue();
|
thrust = MaxThrust * ThrustTables[2]->TotalValue();
|
||||||
|
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * ATSFC, 5000.0, 10000.0);
|
||||||
|
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
ConsumeFuel();
|
if ((Injected == 1) && Injection)
|
||||||
if (Cutoff) phase = tpOff;
|
thrust = thrust * ThrustTables[3]->TotalValue();
|
||||||
if (Starved) phase = tpOff;
|
|
||||||
return thrust;
|
ConsumeFuel();
|
||||||
|
if (Cutoff) phase = tpOff;
|
||||||
|
if (Starved) phase = tpOff;
|
||||||
|
|
||||||
|
return thrust;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
double FGSimTurbine::SpinUp(void)
|
double FGSimTurbine::SpinUp(void)
|
||||||
{
|
{
|
||||||
Running = false;
|
Running = false;
|
||||||
FuelFlow_pph = 0.0;
|
FuelFlow_pph = 0.0;
|
||||||
N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
|
N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
|
||||||
N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
|
N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
|
||||||
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
||||||
OilPressure_psi = N2 * 0.62;
|
OilPressure_psi = N2 * 0.62;
|
||||||
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
||||||
EPR = 1.0;
|
EPR = 1.0;
|
||||||
NozzlePosition = 1.0;
|
NozzlePosition = 1.0;
|
||||||
return 0.0;
|
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
double FGSimTurbine::Start(void)
|
double FGSimTurbine::Start(void)
|
||||||
{
|
{
|
||||||
if ((N2 > 15.0) && !Starved) { // minimum 15% N2 needed for start
|
if ((N2 > 15.0) && !Starved) { // minimum 15% N2 needed for start
|
||||||
Cranking = true; // provided for sound effects signal
|
Cranking = true; // provided for sound effects signal
|
||||||
if (N2 < IdleN2) {
|
if (N2 < IdleN2) {
|
||||||
N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
|
N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
|
||||||
N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
|
N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
|
||||||
EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
|
EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
|
||||||
FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
|
FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
|
||||||
OilPressure_psi = N2 * 0.62;
|
OilPressure_psi = N2 * 0.62;
|
||||||
}
|
|
||||||
else {
|
|
||||||
phase = tpRun;
|
|
||||||
Running = true;
|
|
||||||
Starter = false;
|
|
||||||
Cranking = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else { // no start if N2 < 15%
|
else {
|
||||||
phase = tpOff;
|
phase = tpRun;
|
||||||
|
Running = true;
|
||||||
Starter = false;
|
Starter = false;
|
||||||
}
|
Cranking = false;
|
||||||
return 0.0;
|
}
|
||||||
|
}
|
||||||
|
else { // no start if N2 < 15%
|
||||||
|
phase = tpOff;
|
||||||
|
Starter = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
double FGSimTurbine::Stall(void)
|
double FGSimTurbine::Stall(void)
|
||||||
{
|
{
|
||||||
double qbar = Translation->Getqbar();
|
double qbar = Translation->Getqbar();
|
||||||
EGT_degC = TAT + 903.14;
|
EGT_degC = TAT + 903.14;
|
||||||
FuelFlow_pph = IdleFF;
|
FuelFlow_pph = IdleFF;
|
||||||
N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
|
N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
|
||||||
N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
|
N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
|
||||||
if (ThrottleCmd == 0) phase = tpRun; // clear the stall with throttle
|
if (ThrottleCmd == 0) phase = tpRun; // clear the stall with throttle
|
||||||
return 0.0;
|
|
||||||
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -297,7 +301,8 @@ double FGSimTurbine::Seek(double *var, double target, double accel, double decel
|
||||||
|
|
||||||
void FGSimTurbine::SetDefaults(void)
|
void FGSimTurbine::SetDefaults(void)
|
||||||
{
|
{
|
||||||
Name = "None_Defined";
|
Name = "Not defined";
|
||||||
|
Type = etSimTurbine;
|
||||||
MilThrust = 10000.0;
|
MilThrust = 10000.0;
|
||||||
MaxThrust = 10000.0;
|
MaxThrust = 10000.0;
|
||||||
BypassRatio = 0.0;
|
BypassRatio = 0.0;
|
||||||
|
@ -317,47 +322,59 @@ void FGSimTurbine::SetDefaults(void)
|
||||||
Augmentation = false;
|
Augmentation = false;
|
||||||
Injection = false;
|
Injection = false;
|
||||||
Reversed = false;
|
Reversed = false;
|
||||||
|
Cutoff = true;
|
||||||
phase = tpOff;
|
phase = tpOff;
|
||||||
Stalled = false;
|
Stalled = false;
|
||||||
Seized = false;
|
Seized = false;
|
||||||
Overtemp = false;
|
Overtemp = false;
|
||||||
Fire = false;
|
Fire = false;
|
||||||
|
EGT_degC = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
bool FGSimTurbine::Load(FGConfigFile *Eng_cfg)
|
bool FGSimTurbine::Load(FGConfigFile *Eng_cfg)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
string token;
|
string token;
|
||||||
|
|
||||||
Name = Eng_cfg->GetValue("NAME");
|
Name = Eng_cfg->GetValue("NAME");
|
||||||
cout << Name << endl;
|
|
||||||
Eng_cfg->GetNextConfigLine();
|
Eng_cfg->GetNextConfigLine();
|
||||||
*Eng_cfg >> token >> MilThrust;
|
int counter=0;
|
||||||
*Eng_cfg >> token >> MaxThrust;
|
|
||||||
*Eng_cfg >> token >> BypassRatio;
|
while (Eng_cfg->GetValue() != string("/FG_SIMTURBINE")) {
|
||||||
*Eng_cfg >> token >> TSFC;
|
*Eng_cfg >> token;
|
||||||
*Eng_cfg >> token >> ATSFC;
|
|
||||||
*Eng_cfg >> token >> IdleN1;
|
if (token[0] == '<') token.erase(0,1); // Tables are read "<TABLE"
|
||||||
*Eng_cfg >> token >> IdleN2;
|
|
||||||
*Eng_cfg >> token >> MaxN1;
|
if (token == "MILTHRUST") *Eng_cfg >> MilThrust;
|
||||||
*Eng_cfg >> token >> MaxN2;
|
else if (token == "MAXTHRUST") *Eng_cfg >> MaxThrust;
|
||||||
*Eng_cfg >> token >> Augmented;
|
else if (token == "BYPASSRATIO") *Eng_cfg >> BypassRatio;
|
||||||
*Eng_cfg >> token >> AugMethod;
|
else if (token == "TSFC") *Eng_cfg >> TSFC;
|
||||||
*Eng_cfg >> token >> Injected;
|
else if (token == "ATSFC") *Eng_cfg >> ATSFC;
|
||||||
i=0;
|
else if (token == "IDLEN1") *Eng_cfg >> IdleN1;
|
||||||
while( Eng_cfg->GetValue() != string("/FG_SIMTURBINE") && i < 10){
|
else if (token == "IDLEN2") *Eng_cfg >> IdleN2;
|
||||||
ThrustTables.push_back( new FGCoefficient(FDMExec) );
|
else if (token == "MAXN1") *Eng_cfg >> MaxN1;
|
||||||
ThrustTables.back()->Load(Eng_cfg);
|
else if (token == "MAXN2") *Eng_cfg >> MaxN2;
|
||||||
i++;
|
else if (token == "AUGMENTED") *Eng_cfg >> Augmented;
|
||||||
|
else if (token == "AUGMETHOD") *Eng_cfg >> AugMethod;
|
||||||
|
else if (token == "INJECTED") *Eng_cfg >> Injected;
|
||||||
|
else if (token == "MINTHROTTLE") *Eng_cfg >> MinThrottle;
|
||||||
|
else if (token == "TABLE") {
|
||||||
|
if (counter++ == 0) Debug(2); // print engine specs prior to table read
|
||||||
|
ThrustTables.push_back( new FGCoefficient(FDMExec) );
|
||||||
|
ThrustTables.back()->Load(Eng_cfg);
|
||||||
|
}
|
||||||
|
else cerr << "Unhandled token in Engine config file: " << token << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pre-calculations and initializations
|
// Pre-calculations and initializations
|
||||||
delay= 60.0 / (BypassRatio + 3.0);
|
|
||||||
|
delay = 60.0 / (BypassRatio + 3.0);
|
||||||
N1_factor = MaxN1 - IdleN1;
|
N1_factor = MaxN1 - IdleN1;
|
||||||
N2_factor = MaxN2 - IdleN2;
|
N2_factor = MaxN2 - IdleN2;
|
||||||
OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
|
OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
|
||||||
IdleFF = pow(MilThrust, 0.2) * 107.0; // just an estimate
|
IdleFF = pow(MilThrust, 0.2) * 107.0; // just an estimate
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,6 +406,24 @@ void FGSimTurbine::Debug(int from)
|
||||||
if (from == 0) { // Constructor
|
if (from == 0) { // Constructor
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (from == 2) { // called from Load()
|
||||||
|
cout << "\n Engine Name: " << Name << endl;
|
||||||
|
cout << " MilThrust: " << MilThrust << endl;
|
||||||
|
cout << " MaxThrust: " << MaxThrust << endl;
|
||||||
|
cout << " BypassRatio: " << BypassRatio << endl;
|
||||||
|
cout << " TSFC: " << TSFC << endl;
|
||||||
|
cout << " ATSFC: " << ATSFC << endl;
|
||||||
|
cout << " IdleN1: " << IdleN1 << endl;
|
||||||
|
cout << " IdleN2: " << IdleN2 << endl;
|
||||||
|
cout << " MaxN1: " << MaxN1 << endl;
|
||||||
|
cout << " MaxN2: " << MaxN2 << endl;
|
||||||
|
cout << " Augmented: " << Augmented << endl;
|
||||||
|
cout << " AugMethod: " << AugMethod << endl;
|
||||||
|
cout << " Injected: " << Injected << endl;
|
||||||
|
cout << " MinThrottle: " << MinThrottle << endl;
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (debug_lvl & 2 ) { // Instantiation/Destruction notification
|
if (debug_lvl & 2 ) { // Instantiation/Destruction notification
|
||||||
if (from == 0) cout << "Instantiated: FGSimTurbine" << endl;
|
if (from == 0) cout << "Instantiated: FGSimTurbine" << endl;
|
||||||
|
|
|
@ -29,10 +29,6 @@ HISTORY
|
||||||
09/22/2003 DPC Added starting, stopping, new framework
|
09/22/2003 DPC Added starting, stopping, new framework
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
@ -69,24 +65,67 @@ CLASS DOCUMENTATION
|
||||||
case the engine will go to the Run phase. Once an engine is in the Off phase
|
case the engine will go to the Run phase. Once an engine is in the Off phase
|
||||||
the full starting procedure (or airstart) must be used to get it running.
|
the full starting procedure (or airstart) must be used to get it running.
|
||||||
<P>
|
<P>
|
||||||
-STARTING (on ground):
|
- STARTING (on ground):
|
||||||
-# Set the control FGEngine::Starter to true. The engine will spin up to
|
-# Set the control FGEngine::Starter to true. The engine will spin up to
|
||||||
a maximum of about %25 N2 (%5.2 N1). This simulates the action of a
|
a maximum of about %25 N2 (%5.2 N1). This simulates the action of a
|
||||||
pneumatic starter.
|
pneumatic starter.
|
||||||
-# After reaching %15 N2 set the control FGEngine::Cutoff to false. If fuel
|
-# After reaching %15 N2 set the control FGEngine::Cutoff to false. If fuel
|
||||||
is available the engine will now accelerate to idle. The starter will
|
is available the engine will now accelerate to idle. The starter will
|
||||||
automatically be set to false after the start cycle.
|
automatically be set to false after the start cycle.
|
||||||
<P>
|
<P>
|
||||||
-STARTING (in air):
|
- STARTING (in air):
|
||||||
-# Increase speed to obtain a minimum of %15 N2. If this is not possible,
|
-# Increase speed to obtain a minimum of %15 N2. If this is not possible,
|
||||||
the starter may be used to assist.
|
the starter may be used to assist.
|
||||||
-# Place the control FGEngine::Cutoff to false.
|
-# Place the control FGEngine::Cutoff to false.
|
||||||
<P>
|
<P>
|
||||||
Ignition is assumed to be on anytime the Cutoff control is set to false,
|
Ignition is assumed to be on anytime the Cutoff control is set to false,
|
||||||
therefore a seperate ignition system is not modeled.
|
therefore a seperate ignition system is not modeled.
|
||||||
|
|
||||||
|
Configuration File Format
|
||||||
|
<pre>
|
||||||
|
\<FG_SIMTURBINE NAME="<name>">
|
||||||
|
MILTHRUST \<thrust>
|
||||||
|
MAXTHRUST \<thrust>
|
||||||
|
BYPASSRATIO \<bypass ratio>
|
||||||
|
TSFC \<thrust specific fuel consumption>
|
||||||
|
ATSFC \<afterburning thrust specific fuel consumption>
|
||||||
|
IDLEN1 \<idle N1>
|
||||||
|
IDLEN2 \<idle N2>
|
||||||
|
MAXN1 \<max N1>
|
||||||
|
MAXN2 \<max N2>
|
||||||
|
AUGMENTED \<0|1>
|
||||||
|
AUGMETHOD \<0|1>
|
||||||
|
INJECTED \<0|1>
|
||||||
|
...
|
||||||
|
\</FG_SIMTURBINE>
|
||||||
|
</pre>
|
||||||
|
Definition of the turbine engine configuration file parameters:
|
||||||
|
<pre>
|
||||||
|
<b>MILTHRUST</b> - Maximum thrust, static, at sea level, lbf.
|
||||||
|
<b>MAXTHRUST</b> - Afterburning thrust, static, at sea level, lbf
|
||||||
|
[this value will be ignored when AUGMENTED is zero (false)].
|
||||||
|
<b>BYPASSRATIO</b> - Ratio of bypass air flow to core air flow.
|
||||||
|
<b>TSFC</b> - Thrust-specific fuel consumption, lbm/hr/lbf
|
||||||
|
[i.e. fuel flow divided by thrust].
|
||||||
|
<b>ATSFC</b> - Afterburning TSFC, lbm/hr/lbf
|
||||||
|
[this value will be ignored when AUGMENTED is zero (false)]
|
||||||
|
<b>IDLEN1</b> - Fan rotor rpm (% of max) at idle
|
||||||
|
<b>IDLEN2</b> - Core rotor rpm (% of max) at idle
|
||||||
|
<b>MAXN1</b> - Fan rotor rpm (% of max) at full throttle [not always 100!]
|
||||||
|
<b>MAXN2</b> - Core rotor rpm (% of max) at full throttle [not always 100!]
|
||||||
|
<b>AUGMENTED</b>
|
||||||
|
0 == afterburner not installed
|
||||||
|
1 == afterburner installed
|
||||||
|
<b>AUGMETHOD</b>
|
||||||
|
0 == afterburner activated by property /engines/engine[n]/augmentation
|
||||||
|
1 == afterburner activated by pushing throttle above 99% position
|
||||||
|
[this item will be ignored when AUGMENTED == 0]
|
||||||
|
<b>INJECTED</b>
|
||||||
|
0 == Water injection not installed
|
||||||
|
1 == Water injection installed
|
||||||
|
</pre>
|
||||||
@author David P. Culp
|
@author David P. Culp
|
||||||
@version $Id$
|
@version "$Id$"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -97,25 +136,49 @@ class FGSimTurbine : public FGEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Constructor
|
/** Constructor
|
||||||
@param exec pointer to executive structure
|
@param Executive pointer to executive structure
|
||||||
@param Eng_Cfg pointer to engine config file instance */
|
@param Eng_cfg pointer to engine config file instance */
|
||||||
FGSimTurbine(FGFDMExec* exec, FGConfigFile* Eng_cfg);
|
FGSimTurbine(FGFDMExec* Executive, FGConfigFile* Eng_cfg);
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~FGSimTurbine();
|
~FGSimTurbine();
|
||||||
|
|
||||||
enum phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpStall, tpSeize, tpTrim };
|
enum phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpStall, tpSeize, tpTrim };
|
||||||
|
|
||||||
double Calculate(double);
|
double Calculate(double PowerRequired);
|
||||||
double CalcFuelNeed(void);
|
double CalcFuelNeed(void);
|
||||||
double GetPowerAvailable(void);
|
double GetPowerAvailable(void);
|
||||||
double Seek(double* var, double target, double accel, double decel);
|
double Seek(double* var, double target, double accel, double decel);
|
||||||
|
|
||||||
virtual phaseType GetPhase(void) { return phase; }
|
phaseType GetPhase(void) { return phase; }
|
||||||
virtual void SetPhase( phaseType p ) { phase = p; }
|
|
||||||
|
bool GetOvertemp(void) {return Overtemp; }
|
||||||
|
bool GetInjection(void) {return Injection;}
|
||||||
|
bool GetFire(void) { return Fire; }
|
||||||
|
bool GetAugmentation(void) {return Augmentation;}
|
||||||
|
bool GetReversed(void) { return Reversed; }
|
||||||
|
bool GetCutoff(void) { return Cutoff; }
|
||||||
|
int GetIgnition(void) {return Ignition;}
|
||||||
|
|
||||||
|
double GetInlet(void) { return InletPosition; }
|
||||||
|
double GetNozzle(void) { return NozzlePosition; }
|
||||||
|
double GetBleedDemand(void) {return BleedDemand;}
|
||||||
|
double GetN1(void) {return N1;}
|
||||||
|
double GetN2(void) {return N2;}
|
||||||
|
double GetEPR(void) {return EPR;}
|
||||||
|
double GetEGT(void) {return EGT_degC;}
|
||||||
|
|
||||||
|
double getOilPressure_psi () const {return OilPressure_psi;}
|
||||||
|
double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
|
||||||
|
|
||||||
|
void SetInjection(bool injection) {Injection = injection;}
|
||||||
|
void SetIgnition(int ignition) {Ignition = ignition;}
|
||||||
|
void SetAugmentation(bool augmentation) {Augmentation = augmentation;}
|
||||||
|
void SetPhase( phaseType p ) { phase = p; }
|
||||||
|
void SetEPR(double epr) {EPR = epr;}
|
||||||
|
void SetBleedDemand(double bleedDemand) {BleedDemand = bleedDemand;}
|
||||||
|
void SetReverse(bool reversed) { Reversed = reversed; }
|
||||||
|
void SetCutoff(bool cutoff) { Cutoff = cutoff; }
|
||||||
|
|
||||||
virtual bool GetOvertemp(void) { return Overtemp; }
|
|
||||||
virtual bool GetFire(void) { return Fire; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef vector<FGCoefficient*> CoeffArray;
|
typedef vector<FGCoefficient*> CoeffArray;
|
||||||
|
@ -129,6 +192,8 @@ private:
|
||||||
double ATSFC; ///< Augmented TSFC (lbm/hr/lbf)
|
double ATSFC; ///< Augmented TSFC (lbm/hr/lbf)
|
||||||
double IdleN1; ///< Idle N1
|
double IdleN1; ///< Idle N1
|
||||||
double IdleN2; ///< Idle N2
|
double IdleN2; ///< Idle N2
|
||||||
|
double N1; ///< N1
|
||||||
|
double N2; ///< N2
|
||||||
double MaxN1; ///< N1 at 100% throttle
|
double MaxN1; ///< N1 at 100% throttle
|
||||||
double MaxN2; ///< N2 at 100% throttle
|
double MaxN2; ///< N2 at 100% throttle
|
||||||
double IdleFF; ///< Idle Fuel Flow (lbm/hr)
|
double IdleFF; ///< Idle Fuel Flow (lbm/hr)
|
||||||
|
@ -142,10 +207,22 @@ private:
|
||||||
bool Seized; ///< true if inner spool is seized
|
bool Seized; ///< true if inner spool is seized
|
||||||
bool Overtemp; ///< true if EGT exceeds limits
|
bool Overtemp; ///< true if EGT exceeds limits
|
||||||
bool Fire; ///< true if engine fire detected
|
bool Fire; ///< true if engine fire detected
|
||||||
int Augmented; ///< = 1 if augmentation installed
|
bool Injection;
|
||||||
|
bool Augmentation;
|
||||||
|
bool Reversed;
|
||||||
|
bool Cutoff;
|
||||||
int Injected; ///< = 1 if water injection installed
|
int Injected; ///< = 1 if water injection installed
|
||||||
|
int Ignition;
|
||||||
|
int Augmented; ///< = 1 if augmentation installed
|
||||||
int AugMethod; ///< = 0 if using property /engine[n]/augmentation
|
int AugMethod; ///< = 0 if using property /engine[n]/augmentation
|
||||||
///< = 1 if using last 1% of throttle movement
|
///< = 1 if using last 1% of throttle movement
|
||||||
|
double EGT_degC;
|
||||||
|
double EPR;
|
||||||
|
double OilPressure_psi;
|
||||||
|
double OilTemp_degK;
|
||||||
|
double BleedDemand;
|
||||||
|
double InletPosition;
|
||||||
|
double NozzlePosition;
|
||||||
|
|
||||||
double Off(void);
|
double Off(void);
|
||||||
double Run(void);
|
double Run(void);
|
||||||
|
|
|
@ -86,7 +86,7 @@ FGState::FGState(FGFDMExec* fdex)
|
||||||
Propulsion = FDMExec->GetPropulsion();
|
Propulsion = FDMExec->GetPropulsion();
|
||||||
PropertyManager = FDMExec->GetPropertyManager();
|
PropertyManager = FDMExec->GetPropertyManager();
|
||||||
|
|
||||||
for(int i=0;i<3;i++) vQdot_prev[i].InitMatrix();
|
for(int i=0;i<4;i++) vQdot_prev[i].InitMatrix();
|
||||||
|
|
||||||
bind();
|
bind();
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,6 @@ INCLUDES
|
||||||
#include "FGGroundReactions.h"
|
#include "FGGroundReactions.h"
|
||||||
#include "FGPropulsion.h"
|
#include "FGPropulsion.h"
|
||||||
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINITIONS
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -89,10 +88,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -100,10 +95,6 @@ CLASS DOCUMENTATION
|
||||||
/** Encapsulates the calculation of aircraft state.
|
/** Encapsulates the calculation of aircraft state.
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGState.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGState.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -214,7 +205,7 @@ public:
|
||||||
|
|
||||||
// ======================================= General Purpose INTEGRATOR
|
// ======================================= General Purpose INTEGRATOR
|
||||||
|
|
||||||
enum iType {AB4, AB3, AB2, AM3, EULER, TRAPZ};
|
enum iType {AB4, AB3, AB2, AM3, AM4, EULER, TRAPZ};
|
||||||
|
|
||||||
/** Multi-method integrator.
|
/** Multi-method integrator.
|
||||||
@param type Type of intergation scheme to use. Can be one of:
|
@param type Type of intergation scheme to use. Can be one of:
|
||||||
|
@ -223,6 +214,7 @@ public:
|
||||||
<li>AB3 - Adams-Bashforth, third order</li>
|
<li>AB3 - Adams-Bashforth, third order</li>
|
||||||
<li>AB2 - Adams-Bashforth, second order</li>
|
<li>AB2 - Adams-Bashforth, second order</li>
|
||||||
<li>AM3 - Adams Moulton, third order</li>
|
<li>AM3 - Adams Moulton, third order</li>
|
||||||
|
<li>AM4 - Adams Moulton, fourth order</li>
|
||||||
<li>EULER - Euler</li>
|
<li>EULER - Euler</li>
|
||||||
<li>TRAPZ - Trapezoidal</li>
|
<li>TRAPZ - Trapezoidal</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -243,23 +235,35 @@ public:
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case AB4:
|
case AB4:
|
||||||
vResult = (delta_t/24.0)*( 55.0 * vTDeriv
|
vResult = (delta_t/24.0)*( 55.0 * vLastArray[0]
|
||||||
- 59.0 * vLastArray[0]
|
- 59.0 * vLastArray[1]
|
||||||
+ 37.0 * vLastArray[1]
|
+ 37.0 * vLastArray[2]
|
||||||
- 9.0 * vLastArray[2] );
|
- 9.0 * vLastArray[3] );
|
||||||
|
vLastArray[3] = vLastArray[2];
|
||||||
vLastArray[2] = vLastArray[1];
|
vLastArray[2] = vLastArray[1];
|
||||||
vLastArray[1] = vLastArray[0];
|
vLastArray[1] = vLastArray[0];
|
||||||
vLastArray[0] = vTDeriv;
|
vLastArray[0] = vTDeriv;
|
||||||
break;
|
break;
|
||||||
case AB3:
|
case AB3:
|
||||||
vResult = (delta_t/12.0)*( 23.0 * vTDeriv
|
vResult = (delta_t/12.0)*( 23.0 * vLastArray[0]
|
||||||
- 16.0 * vLastArray[0]
|
- 16.0 * vLastArray[1]
|
||||||
+ 5.0 * vLastArray[1] );
|
+ 5.0 * vLastArray[2] );
|
||||||
|
vLastArray[2] = vLastArray[1];
|
||||||
vLastArray[1] = vLastArray[0];
|
vLastArray[1] = vLastArray[0];
|
||||||
vLastArray[0] = vTDeriv;
|
vLastArray[0] = vTDeriv;
|
||||||
break;
|
break;
|
||||||
case AB2:
|
case AB2:
|
||||||
vResult = (delta_t/2.0)*( 3.0 * vTDeriv - vLastArray[0] );
|
vResult = (delta_t/2.0)*( 3.0 * vLastArray[0] - vLastArray[1] );
|
||||||
|
vLastArray[1] = vLastArray[0];
|
||||||
|
vLastArray[0] = vTDeriv;
|
||||||
|
break;
|
||||||
|
case AM4:
|
||||||
|
vResult = (delta_t/24.0)*( 9.0 * vTDeriv
|
||||||
|
+ 19.0 * vLastArray[0]
|
||||||
|
- 5.0 * vLastArray[1]
|
||||||
|
+ 1.0 * vLastArray[2] );
|
||||||
|
vLastArray[2] = vLastArray[1];
|
||||||
|
vLastArray[1] = vLastArray[0];
|
||||||
vLastArray[0] = vTDeriv;
|
vLastArray[0] = vTDeriv;
|
||||||
break;
|
break;
|
||||||
case AM3:
|
case AM3:
|
||||||
|
@ -341,7 +345,7 @@ private:
|
||||||
FGMatrix33 mTs2b;
|
FGMatrix33 mTs2b;
|
||||||
FGMatrix33 mTb2s;
|
FGMatrix33 mTb2s;
|
||||||
FGColumnVector4 vQtrn;
|
FGColumnVector4 vQtrn;
|
||||||
FGColumnVector4 vQdot_prev[3];
|
FGColumnVector4 vQdot_prev[4];
|
||||||
FGColumnVector4 vQdot;
|
FGColumnVector4 vQdot;
|
||||||
FGColumnVector3 vUVW;
|
FGColumnVector3 vUVW;
|
||||||
FGColumnVector3 vLocalVelNED;
|
FGColumnVector3 vLocalVelNED;
|
||||||
|
|
|
@ -38,7 +38,7 @@ INCLUDES
|
||||||
|
|
||||||
#include "FGTable.h"
|
#include "FGTable.h"
|
||||||
|
|
||||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||||
#include <iomanip.h>
|
#include <iomanip.h>
|
||||||
#else
|
#else
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
@ -249,7 +249,7 @@ void FGTable::Print(void)
|
||||||
if (Type == tt1D) startRow = 1;
|
if (Type == tt1D) startRow = 1;
|
||||||
else startRow = 0;
|
else startRow = 0;
|
||||||
|
|
||||||
#if defined (sgi) && !defined(__GNUC__)
|
#if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
unsigned long flags = cout.setf(ios::fixed);
|
unsigned long flags = cout.setf(ios::fixed);
|
||||||
#else
|
#else
|
||||||
ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream
|
ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream
|
||||||
|
|
|
@ -53,10 +53,6 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -67,10 +63,6 @@ CLASS DOCUMENTATION
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see FGCoefficient
|
@see FGCoefficient
|
||||||
@see FGPropeller
|
@see FGPropeller
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTable.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTable.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -38,7 +38,7 @@ INCLUDES
|
||||||
|
|
||||||
#include "FGTank.h"
|
#include "FGTank.h"
|
||||||
|
|
||||||
#if !defined ( sgi ) || defined( __GNUC__ )
|
#if !defined ( sgi ) || defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
|
|
|
@ -57,7 +57,7 @@ INCLUDES
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
using std::string;
|
using std::string;
|
||||||
# if !defined(sgi) || defined(__GNUC__)
|
# if !defined(sgi) || defined(__GNUC__) || (_COMPILER_VERSION >= 740)
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
|
@ -65,13 +65,24 @@ INCLUDES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINES
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_TANK "$Id$"
|
#define ID_TANK "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models a fuel tank.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -50,6 +50,7 @@ CLASS IMPLEMENTATION
|
||||||
FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
|
FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
|
||||||
ThrusterNumber(0)
|
ThrusterNumber(0)
|
||||||
{
|
{
|
||||||
|
Type = ttDirect;
|
||||||
SetTransformType(FGForce::tCustom);
|
SetTransformType(FGForce::tCustom);
|
||||||
|
|
||||||
Debug(0);
|
Debug(0);
|
||||||
|
@ -57,12 +58,15 @@ FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
FGThruster::FGThruster(FGFDMExec *FDMExec,
|
FGThruster::FGThruster(FGFDMExec *FDMExec,
|
||||||
FGConfigFile *Eng_cfg ): FGForce(FDMExec) {
|
FGConfigFile *Eng_cfg ): FGForce(FDMExec)
|
||||||
ThrusterNumber=0;
|
{
|
||||||
SetTransformType(FGForce::tCustom);
|
ThrusterNumber = 0;
|
||||||
Name=Eng_cfg->GetValue();
|
Type = ttDirect;
|
||||||
Debug(0);
|
SetTransformType(FGForce::tCustom);
|
||||||
|
Name = Eng_cfg->GetValue();
|
||||||
|
GearRatio = 1.0;
|
||||||
|
Debug(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
08/24/00 JSB Created
|
08/24/00 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -45,14 +41,18 @@ INCLUDES
|
||||||
#include "FGForce.h"
|
#include "FGForce.h"
|
||||||
#include "FGConfigFile.h"
|
#include "FGConfigFile.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_THRUSTER "$Id$"
|
#define ID_THRUSTER "$Id$"
|
||||||
|
|
||||||
namespace JSBSim {
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -75,9 +75,9 @@ public:
|
||||||
/// Destructor
|
/// Destructor
|
||||||
virtual ~FGThruster();
|
virtual ~FGThruster();
|
||||||
|
|
||||||
enum eType {ttNozzle, ttRotor, ttPropeller};
|
enum eType {ttNozzle, ttRotor, ttPropeller, ttDirect};
|
||||||
|
|
||||||
virtual double Calculate(double Thrust) { vFn(1)=Thrust; return 0.0; }
|
virtual double Calculate(double tt) { Thrust = tt; vFn(1) = Thrust; return 0.0; }
|
||||||
void SetName(string name) {Name = name;}
|
void SetName(string name) {Name = name;}
|
||||||
void SetThrusterNumber(int nn) {ThrusterNumber = nn;}
|
void SetThrusterNumber(int nn) {ThrusterNumber = nn;}
|
||||||
virtual void SetRPM(double rpm) {};
|
virtual void SetRPM(double rpm) {};
|
||||||
|
@ -88,6 +88,7 @@ public:
|
||||||
string GetName(void) {return Name;}
|
string GetName(void) {return Name;}
|
||||||
int GetThrusterNumber(void) {return ThrusterNumber;}
|
int GetThrusterNumber(void) {return ThrusterNumber;}
|
||||||
virtual double GetRPM(void) { return 0.0; };
|
virtual double GetRPM(void) { return 0.0; };
|
||||||
|
double GetGearRatio(void) {return GearRatio; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
eType Type;
|
eType Type;
|
||||||
|
@ -96,6 +97,7 @@ protected:
|
||||||
double Thrust;
|
double Thrust;
|
||||||
double PowerRequired;
|
double PowerRequired;
|
||||||
double deltaT;
|
double deltaT;
|
||||||
|
double GearRatio;
|
||||||
virtual void Debug(int from);
|
virtual void Debug(int from);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex)
|
||||||
vUVWdot_prev[0].InitMatrix();
|
vUVWdot_prev[0].InitMatrix();
|
||||||
vUVWdot_prev[1].InitMatrix();
|
vUVWdot_prev[1].InitMatrix();
|
||||||
vUVWdot_prev[2].InitMatrix();
|
vUVWdot_prev[2].InitMatrix();
|
||||||
|
vUVWdot_prev[3].InitMatrix();
|
||||||
|
|
||||||
bind();
|
bind();
|
||||||
Debug(0);
|
Debug(0);
|
||||||
|
@ -160,6 +161,9 @@ bool FGTranslation::Run(void)
|
||||||
qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
|
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));
|
qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
|
||||||
Mach = Vt / State->Geta();
|
Mach = Vt / State->Geta();
|
||||||
|
vMachUVW(eU) = vAeroUVW(eU) / State->Geta();
|
||||||
|
vMachUVW(eV) = vAeroUVW(eV) / State->Geta();
|
||||||
|
vMachUVW(eW) = vAeroUVW(eW) / State->Geta();
|
||||||
|
|
||||||
if (debug_lvl > 1) Debug(1);
|
if (debug_lvl > 1) Debug(1);
|
||||||
|
|
||||||
|
|
|
@ -27,24 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
12/02/98 JSB Created
|
12/02/98 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
[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
|
|
||||||
|
|
||||||
The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
|
||||||
or Y-P-R, or Z-Y-X, if you prefer.
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -76,10 +58,38 @@ INCLUDES
|
||||||
#include "FGColumnVector3.h"
|
#include "FGColumnVector3.h"
|
||||||
#include "FGColumnVector4.h"
|
#include "FGColumnVector4.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_TRANSLATION "$Id$"
|
#define ID_TRANSLATION "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models the translation aspects of the EOM.
|
||||||
|
Note: The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
||||||
|
or Y-P-R, or Z-Y-X, if you prefer.
|
||||||
|
@see 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
|
||||||
|
@see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||||
|
JSC 12960, July 1977
|
||||||
|
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||||
|
NASA-Ames", NASA CR-2497, January 1975
|
||||||
|
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||||
|
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||||
|
@see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||||
|
1982 ISBN 0-471-08936-2
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -104,6 +114,7 @@ public:
|
||||||
double GetqbarUV (void) const { return qbarUV; }
|
double GetqbarUV (void) const { return qbarUV; }
|
||||||
inline double GetVt (void) const { return Vt; }
|
inline double GetVt (void) const { return Vt; }
|
||||||
double GetMach (void) const { return Mach; }
|
double GetMach (void) const { return Mach; }
|
||||||
|
double GetMachU(void) const { return vMachUVW(eU); }
|
||||||
double Getadot (void) const { return adot; }
|
double Getadot (void) const { return adot; }
|
||||||
double Getbdot (void) const { return bdot; }
|
double Getbdot (void) const { return bdot; }
|
||||||
|
|
||||||
|
@ -130,9 +141,10 @@ public:
|
||||||
private:
|
private:
|
||||||
FGColumnVector3 vUVW;
|
FGColumnVector3 vUVW;
|
||||||
FGColumnVector3 vUVWdot;
|
FGColumnVector3 vUVWdot;
|
||||||
FGColumnVector3 vUVWdot_prev[3];
|
FGColumnVector3 vUVWdot_prev[4];
|
||||||
FGMatrix33 mVel;
|
FGMatrix33 mVel;
|
||||||
FGColumnVector3 vAeroUVW;
|
FGColumnVector3 vAeroUVW;
|
||||||
|
FGColumnVector3 vMachUVW;
|
||||||
|
|
||||||
double Vt, Mach;
|
double Vt, Mach;
|
||||||
double qbar, qbarUW, qbarUV;
|
double qbar, qbarUW, qbarUV;
|
||||||
|
|
|
@ -66,20 +66,16 @@ DEFINITIONS
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
typedef enum { tLongitudinal, tFull, tGround, tPullup,
|
typedef enum { tLongitudinal, tFull, tGround, tPullup,
|
||||||
tCustom, tNone, tTurn
|
tCustom, tNone, tTurn
|
||||||
} TrimMode;
|
} TrimMode;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
FORWARD DECLARATIONS
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -97,30 +93,25 @@ CLASS DOCUMENTATION
|
||||||
last three are used for on-ground trimming. The state-control pairs used in
|
last three are used for on-ground trimming. The state-control pairs used in
|
||||||
a given trim are completely user configurable and several pre-defined modes
|
a given trim are completely user configurable and several pre-defined modes
|
||||||
are provided as well. They are:
|
are provided as well. They are:
|
||||||
<ul>
|
- tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator
|
||||||
<li> tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator</li>
|
- tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder
|
||||||
<li> tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder
|
and heading minus ground track (hmgt) with beta
|
||||||
and heading minus ground track (hmgt) with beta</li>
|
- tPullup: tLongitudinal but adjust alpha to achieve load factor input
|
||||||
<li> tPullup: tLongitudinal but adjust alpha to achieve load factor input
|
with SetTargetNlf()
|
||||||
with SetTargetNlf()
|
- tGround: wdot with altitude, qdot with theta, and pdot with phi
|
||||||
|
|
||||||
<li> tGround: wdot with altitude, qdot with theta, and pdot with phi</li>
|
|
||||||
|
|
||||||
The remaining modes include <b>tCustom</b>, which is completely user defined and
|
The remaining modes include <b>tCustom</b>, which is completely user defined and
|
||||||
<b>tNone</b>.
|
<b>tNone</b>.
|
||||||
</ul>
|
|
||||||
|
|
||||||
Note that trims can (and do) fail for reasons that are completely outside
|
Note that trims can (and do) fail for reasons that are completely outside
|
||||||
the control of the trimming routine itself. The most common problem is the
|
the control of the trimming routine itself. The most common problem is the
|
||||||
initial conditions: is the model capable of steady state flight
|
initial conditions: is the model capable of steady state flight
|
||||||
at those conditions? Check the speed, altitude, configuration (flaps,
|
at those conditions? Check the speed, altitude, configuration (flaps,
|
||||||
gear, etc.), weight, cg, and anything else that may be relevant.
|
gear, etc.), weight, cg, and anything else that may be relevant.
|
||||||
|
|
||||||
Example usage:
|
Example usage:<pre>
|
||||||
FGFDMExec* FDMExec = new FGFDMExec();
|
FGFDMExec* FDMExec = new FGFDMExec();
|
||||||
.
|
|
||||||
.
|
|
||||||
.
|
|
||||||
FGInitialCondition* fgic = new FGInitialCondition(FDMExec);
|
FGInitialCondition* fgic = new FGInitialCondition(FDMExec);
|
||||||
FGTrim *fgt(FDMExec,fgic,tFull);
|
FGTrim *fgt(FDMExec,fgic,tFull);
|
||||||
fgic->SetVcaibratedKtsIC(100);
|
fgic->SetVcaibratedKtsIC(100);
|
||||||
|
@ -129,13 +120,9 @@ CLASS DOCUMENTATION
|
||||||
if( !fgt->DoTrim() ) {
|
if( !fgt->DoTrim() ) {
|
||||||
cout << "Trim Failed" << endl;
|
cout << "Trim Failed" << endl;
|
||||||
}
|
}
|
||||||
fgt->ReportState();
|
fgt->ReportState(); </pre>
|
||||||
@author Tony Peden
|
@author Tony Peden
|
||||||
@version $Id$
|
@version "$Id$"
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTrim.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTrim.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -197,11 +184,11 @@ private:
|
||||||
public:
|
public:
|
||||||
/** Initializes the trimming class
|
/** Initializes the trimming class
|
||||||
@param FDMExec pointer to a JSBSim executive object.
|
@param FDMExec pointer to a JSBSim executive object.
|
||||||
@param FGIC pointer to a FGInitialCondition object
|
@param tm trim mode
|
||||||
*/
|
*/
|
||||||
FGTrim(FGFDMExec *FDMExec, TrimMode tt=tGround );
|
FGTrim(FGFDMExec *FDMExec, TrimMode tm=tGround );
|
||||||
|
|
||||||
~FGTrim(void);
|
~FGTrim(void);
|
||||||
|
|
||||||
/** Execute the trim
|
/** Execute the trim
|
||||||
*/
|
*/
|
||||||
|
@ -219,10 +206,10 @@ public:
|
||||||
void TrimStats();
|
void TrimStats();
|
||||||
|
|
||||||
/** Clear all state-control pairs and set a predefined trim mode
|
/** Clear all state-control pairs and set a predefined trim mode
|
||||||
@param TrimMode the set of axes to trim. Can be:
|
@param tm the set of axes to trim. Can be:
|
||||||
tLongitudinal, tFull, tGround, tCustom, or tNone
|
tLongitudinal, tFull, tGround, tCustom, or tNone
|
||||||
*/
|
*/
|
||||||
void SetMode(TrimMode tt);
|
void SetMode(TrimMode tm);
|
||||||
|
|
||||||
/** Clear all state-control pairs from the current configuration.
|
/** Clear all state-control pairs from the current configuration.
|
||||||
The trimming routine must have at least one state-control pair
|
The trimming routine must have at least one state-control pair
|
||||||
|
@ -247,14 +234,14 @@ public:
|
||||||
|
|
||||||
/** Change the control used to zero a state previously configured
|
/** Change the control used to zero a state previously configured
|
||||||
@param state the accel or other condition to zero
|
@param state the accel or other condition to zero
|
||||||
@param control the control used to zero the state
|
@param new_control the control used to zero the state
|
||||||
*/
|
*/
|
||||||
bool EditState( State state, Control new_control );
|
bool EditState( State state, Control new_control );
|
||||||
|
|
||||||
/** automatically switch to trimming longitudinal acceleration with
|
/** automatically switch to trimming longitudinal acceleration with
|
||||||
flight path angle (gamma) once it becomes apparent that there
|
flight path angle (gamma) once it becomes apparent that there
|
||||||
is not enough/too much thrust.
|
is not enough/too much thrust.
|
||||||
@param gamma_fallback true to enable fallback
|
@param bb true to enable fallback
|
||||||
*/
|
*/
|
||||||
inline void SetGammaFallback(bool bb) { gamma_fallback=bb; }
|
inline void SetGammaFallback(bool bb) { gamma_fallback=bb; }
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,18 @@ INCLUDES
|
||||||
#include "FGJSBBase.h"
|
#include "FGJSBBase.h"
|
||||||
#include "FGInitialCondition.h"
|
#include "FGInitialCondition.h"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
DEFINITIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_TRIMAXIS "$Id$"
|
#define ID_TRIMAXIS "$Id$"
|
||||||
|
|
||||||
#define DEFAULT_TOLERANCE 0.001
|
#define DEFAULT_TOLERANCE 0.001
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
const string StateNames[10]= { "all","udot","vdot","wdot","qdot","pdot","rdot",
|
const string StateNames[10]= { "all","udot","vdot","wdot","qdot","pdot","rdot",
|
||||||
|
@ -63,6 +71,13 @@ const string ControlNames[14]= { "Throttle","Sideslip","Angle of Attack",
|
||||||
|
|
||||||
class FGInitialCondition;
|
class FGInitialCondition;
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Models an aircraft axis for purposes of trimming.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
08/23/2002 JSB Created
|
08/23/2002 JSB Created
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -49,6 +45,10 @@ INCLUDES
|
||||||
|
|
||||||
#define ID_TURBINE "$Id$"
|
#define ID_TURBINE "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -46,8 +46,16 @@ DEFINES
|
||||||
|
|
||||||
#define ID_UTILITY "$Id$"
|
#define ID_UTILITY "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -53,7 +53,7 @@ FGfdmSocket::FGfdmSocket(string address, int port)
|
||||||
size = 0;
|
size = 0;
|
||||||
connected = false;
|
connected = false;
|
||||||
|
|
||||||
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
|
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
int wsaReturnCode;
|
int wsaReturnCode;
|
||||||
wsaReturnCode = WSAStartup(MAKEWORD(1,1), &wsaData);
|
wsaReturnCode = WSAStartup(MAKEWORD(1,1), &wsaData);
|
||||||
|
|
|
@ -34,10 +34,6 @@ SENTRY
|
||||||
#ifndef FGfdmSocket_H
|
#ifndef FGfdmSocket_H
|
||||||
#define FGfdmSocket_H
|
#define FGfdmSocket_H
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
INCLUDES
|
INCLUDES
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -53,7 +49,7 @@ INCLUDES
|
||||||
SG_USING_STD(endl);
|
SG_USING_STD(endl);
|
||||||
#else
|
#else
|
||||||
# include <string>
|
# include <string>
|
||||||
# if defined(sgi) && !defined(__GNUC__)
|
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||||
# include <iostream.h>
|
# include <iostream.h>
|
||||||
# include <fstream.h>
|
# include <fstream.h>
|
||||||
# else
|
# else
|
||||||
|
@ -82,8 +78,19 @@ DEFINITIONS
|
||||||
|
|
||||||
#define ID_FDMSOCKET "$Id$"
|
#define ID_FDMSOCKET "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Encapsulates a socket object.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
|
||||||
|
#include <stdio.h> // size_t
|
||||||
#ifdef SG_MATH_EXCEPTION_CLASH
|
#ifdef SG_MATH_EXCEPTION_CLASH
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,6 +61,8 @@
|
||||||
#include <FDM/JSBSim/FGAerodynamics.h>
|
#include <FDM/JSBSim/FGAerodynamics.h>
|
||||||
#include <FDM/JSBSim/FGLGear.h>
|
#include <FDM/JSBSim/FGLGear.h>
|
||||||
#include <FDM/JSBSim/FGPropertyManager.h>
|
#include <FDM/JSBSim/FGPropertyManager.h>
|
||||||
|
#include <FDM/JSBSim/FGEngine.h>
|
||||||
|
#include <FDM/JSBSim/FGRotor.h>
|
||||||
#include "JSBSim.hxx"
|
#include "JSBSim.hxx"
|
||||||
|
|
||||||
static inline double
|
static inline double
|
||||||
|
@ -157,12 +160,15 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
|
|
||||||
init_gear();
|
init_gear();
|
||||||
|
|
||||||
// Set initial fuel levels if provided.
|
// Set initial fuel levels if provided.
|
||||||
for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) {
|
for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) {
|
||||||
SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
|
SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
|
||||||
if (node->getChild("level-gal_us", 0, false) != 0)
|
if (node->getChild("level-gal_us", 0, false) != 0) {
|
||||||
Propulsion->GetTank(i)
|
Propulsion->GetTank(i)->SetContents(node->getDoubleValue("level-gal_us") * 6.6);
|
||||||
->SetContents(node->getDoubleValue("level-gal_us") * 6.6);
|
} else {
|
||||||
|
node->setDoubleValue("level-lb", Propulsion->GetTank(i)->GetContents());
|
||||||
|
node->setDoubleValue("level-gal_us", Propulsion->GetTank(i)->GetContents() / 6.6);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
|
fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
|
||||||
|
@ -195,7 +201,6 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
=fgGetNode("/surface-positions/speedbrake-pos-norm",true);
|
=fgGetNode("/surface-positions/speedbrake-pos-norm",true);
|
||||||
spoilers_pos_pct=fgGetNode("/surface-positions/spoilers-pos-norm",true);
|
spoilers_pos_pct=fgGetNode("/surface-positions/spoilers-pos-norm",true);
|
||||||
|
|
||||||
|
|
||||||
elevator_pos_pct->setDoubleValue(0);
|
elevator_pos_pct->setDoubleValue(0);
|
||||||
left_aileron_pos_pct->setDoubleValue(0);
|
left_aileron_pos_pct->setDoubleValue(0);
|
||||||
right_aileron_pos_pct->setDoubleValue(0);
|
right_aileron_pos_pct->setDoubleValue(0);
|
||||||
|
@ -213,12 +218,18 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
wind_from_north= fgGetNode("/environment/wind-from-north-fps",true);
|
wind_from_north= fgGetNode("/environment/wind-from-north-fps",true);
|
||||||
wind_from_east = fgGetNode("/environment/wind-from-east-fps" ,true);
|
wind_from_east = fgGetNode("/environment/wind-from-east-fps" ,true);
|
||||||
wind_from_down = fgGetNode("/environment/wind-from-down-fps" ,true);
|
wind_from_down = fgGetNode("/environment/wind-from-down-fps" ,true);
|
||||||
|
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < Propulsion->GetNumEngines(); i++) {
|
||||||
|
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||||
|
Propulsion->GetThruster(i)->SetRPM(node->getDoubleValue("rpm") /
|
||||||
|
Propulsion->GetThruster(i)->GetGearRatio());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
FGJSBsim::~FGJSBsim(void) {
|
FGJSBsim::~FGJSBsim(void)
|
||||||
delete fdmex;
|
{
|
||||||
|
delete fdmex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -226,8 +237,8 @@ FGJSBsim::~FGJSBsim(void) {
|
||||||
// Initialize the JSBsim flight model, dt is the time increment for
|
// Initialize the JSBsim flight model, dt is the time increment for
|
||||||
// each subsequent iteration through the EOM
|
// each subsequent iteration through the EOM
|
||||||
|
|
||||||
void FGJSBsim::init() {
|
void FGJSBsim::init()
|
||||||
|
{
|
||||||
double tmp;
|
double tmp;
|
||||||
|
|
||||||
SG_LOG( SG_FLIGHT, SG_INFO, "Starting and initializing JSBsim" );
|
SG_LOG( SG_FLIGHT, SG_INFO, "Starting and initializing JSBsim" );
|
||||||
|
@ -268,10 +279,9 @@ void FGJSBsim::init() {
|
||||||
<< ", " << fdmex->GetAtmosphere()->GetDensity() );
|
<< ", " << fdmex->GetAtmosphere()->GetDensity() );
|
||||||
|
|
||||||
common_init();
|
common_init();
|
||||||
copy_to_JSBsim();
|
|
||||||
|
|
||||||
|
|
||||||
fdmex->RunIC(); //loop JSBSim once w/o integrating
|
copy_to_JSBsim();
|
||||||
|
fdmex->RunIC(); //loop JSBSim once w/o integrating
|
||||||
copy_from_JSBsim(); //update the bus
|
copy_from_JSBsim(); //update the bus
|
||||||
|
|
||||||
SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" );
|
SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" );
|
||||||
|
@ -322,18 +332,14 @@ void FGJSBsim::init() {
|
||||||
|
|
||||||
SG_LOG( SG_FLIGHT, SG_INFO, "FGControls::get_gear_down()= " <<
|
SG_LOG( SG_FLIGHT, SG_INFO, "FGControls::get_gear_down()= " <<
|
||||||
globals->get_controls()->get_gear_down() );
|
globals->get_controls()->get_gear_down() );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
// Run an iteration of the EOM (equations of motion)
|
// Run an iteration of the EOM (equations of motion)
|
||||||
|
|
||||||
void
|
void FGJSBsim::update( double dt )
|
||||||
FGJSBsim::update( double dt ) {
|
{
|
||||||
|
|
||||||
if (is_suspended())
|
if (is_suspended())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -361,7 +367,7 @@ FGJSBsim::update( double dt ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i=0; i < multiloop; i++ ) {
|
for ( i=0; i < multiloop; i++ ) {
|
||||||
fdmex->Run();
|
fdmex->Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
FGJSBBase::Message* msg;
|
FGJSBBase::Message* msg;
|
||||||
|
@ -395,7 +401,8 @@ FGJSBsim::update( double dt ) {
|
||||||
|
|
||||||
// Convert from the FGInterface struct to the JSBsim generic_ struct
|
// Convert from the FGInterface struct to the JSBsim generic_ struct
|
||||||
|
|
||||||
bool FGJSBsim::copy_to_JSBsim() {
|
bool FGJSBsim::copy_to_JSBsim()
|
||||||
|
{
|
||||||
double tmp;
|
double tmp;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -411,30 +418,52 @@ bool FGJSBsim::copy_to_JSBsim() {
|
||||||
FCS->SetDsbCmd( globals->get_controls()->get_speedbrake() );
|
FCS->SetDsbCmd( globals->get_controls()->get_speedbrake() );
|
||||||
FCS->SetDspCmd( globals->get_controls()->get_spoilers() );
|
FCS->SetDspCmd( globals->get_controls()->get_spoilers() );
|
||||||
|
|
||||||
// Parking brake sets minimum braking
|
// Parking brake sets minimum braking
|
||||||
// level for mains.
|
// level for mains.
|
||||||
double parking_brake = globals->get_controls()->get_brake_parking();
|
double parking_brake = globals->get_controls()->get_brake_parking();
|
||||||
FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
|
FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
|
||||||
FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
|
FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
|
||||||
FCS->SetCBrake( 0.0 );
|
FCS->SetCBrake( 0.0 );
|
||||||
|
// FCS->SetCBrake( globals->get_controls()->get_brake(2) );
|
||||||
|
|
||||||
FCS->SetGearCmd( globals->get_controls()->get_gear_down());
|
FCS->SetGearCmd( globals->get_controls()->get_gear_down());
|
||||||
for (i = 0; i < Propulsion->GetNumEngines(); i++) {
|
for (i = 0; i < Propulsion->GetNumEngines(); i++) {
|
||||||
FGEngine * eng = Propulsion->GetEngine(i);
|
|
||||||
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||||
|
|
||||||
FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
|
FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
|
||||||
FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
|
FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
|
||||||
FCS->SetPropAdvanceCmd(i, globals->get_controls()->get_prop_advance(i));
|
FCS->SetPropAdvanceCmd(i, globals->get_controls()->get_prop_advance(i));
|
||||||
Propulsion->GetThruster(i)->SetRPM(node->getDoubleValue("rpm"));
|
|
||||||
eng->SetMagnetos( globals->get_controls()->get_magnetos(i) );
|
switch (Propulsion->GetEngine(i)->GetType()) {
|
||||||
|
case FGEngine::etPiston:
|
||||||
|
{ // FGPiston code block
|
||||||
|
FGPiston* eng = (FGPiston*)Propulsion->GetEngine(i);
|
||||||
|
eng->SetMagnetos( globals->get_controls()->get_magnetos(i) );
|
||||||
|
break;
|
||||||
|
} // end FGPiston code block
|
||||||
|
case FGEngine::etSimTurbine:
|
||||||
|
{ // FGSimTurbine code block
|
||||||
|
FGSimTurbine* eng = (FGSimTurbine*)Propulsion->GetEngine(i);
|
||||||
|
eng->SetAugmentation( globals->get_controls()->get_augmentation(i) );
|
||||||
|
eng->SetReverse( globals->get_controls()->get_reverser(i) );
|
||||||
|
eng->SetInjection( globals->get_controls()->get_water_injection(i) );
|
||||||
|
eng->SetCutoff( globals->get_controls()->get_cutoff(i) );
|
||||||
|
eng->SetIgnition( globals->get_controls()->get_ignition(i) );
|
||||||
|
break;
|
||||||
|
} // end FGSimTurbine code block
|
||||||
|
case FGEngine::etRocket:
|
||||||
|
{ // FGRocket code block
|
||||||
|
FGRocket* eng = (FGRocket*)Propulsion->GetEngine(i);
|
||||||
|
break;
|
||||||
|
} // end FGRocket code block
|
||||||
|
}
|
||||||
|
|
||||||
|
{ // FGEngine code block
|
||||||
|
FGEngine* eng = Propulsion->GetEngine(i);
|
||||||
|
|
||||||
eng->SetStarter( globals->get_controls()->get_starter(i) );
|
eng->SetStarter( globals->get_controls()->get_starter(i) );
|
||||||
eng->SetAugmentation( globals->get_controls()->get_augmentation(i) );
|
|
||||||
eng->SetReverse( globals->get_controls()->get_reverser(i) );
|
|
||||||
eng->SetInjection( globals->get_controls()->get_water_injection(i) );
|
|
||||||
eng->SetIgnition( globals->get_controls()->get_ignition(i) );
|
|
||||||
eng->SetCutoff( globals->get_controls()->get_cutoff(i) );
|
|
||||||
eng->SetNitrous( globals->get_controls()->get_nitrous_injection(i) );
|
|
||||||
eng->SetRunning( node->getBoolValue("running") );
|
eng->SetRunning( node->getBoolValue("running") );
|
||||||
|
} // end FGEngine code block
|
||||||
}
|
}
|
||||||
|
|
||||||
_set_Runway_altitude( cur_fdm_state->get_Runway_altitude() );
|
_set_Runway_altitude( cur_fdm_state->get_Runway_altitude() );
|
||||||
|
@ -475,7 +504,8 @@ bool FGJSBsim::copy_to_JSBsim() {
|
||||||
|
|
||||||
// Convert from the JSBsim generic_ struct to the FGInterface struct
|
// Convert from the JSBsim generic_ struct to the FGInterface struct
|
||||||
|
|
||||||
bool FGJSBsim::copy_from_JSBsim() {
|
bool FGJSBsim::copy_from_JSBsim()
|
||||||
|
{
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
_set_Inertias( MassBalance->GetMass(),
|
_set_Inertias( MassBalance->GetMass(),
|
||||||
|
@ -488,25 +518,17 @@ bool FGJSBsim::copy_from_JSBsim() {
|
||||||
MassBalance->GetXYZcg(2),
|
MassBalance->GetXYZcg(2),
|
||||||
MassBalance->GetXYZcg(3) );
|
MassBalance->GetXYZcg(3) );
|
||||||
|
|
||||||
_set_Accels_Body( Aircraft->GetBodyAccel()(1),
|
_set_Accels_Body( Aircraft->GetBodyAccel(1),
|
||||||
Aircraft->GetBodyAccel()(2),
|
Aircraft->GetBodyAccel(2),
|
||||||
Aircraft->GetBodyAccel()(3) );
|
Aircraft->GetBodyAccel(3) );
|
||||||
|
|
||||||
//_set_Accels_CG_Body( Aircraft->GetBodyAccel()(1),
|
_set_Accels_CG_Body_N ( Aircraft->GetNcg(1),
|
||||||
// Aircraft->GetBodyAccel()(2),
|
Aircraft->GetNcg(2),
|
||||||
// Aircraft->GetBodyAccel()(3) );
|
Aircraft->GetNcg(3) );
|
||||||
//
|
|
||||||
_set_Accels_CG_Body_N ( Aircraft->GetNcg()(1),
|
|
||||||
Aircraft->GetNcg()(2),
|
|
||||||
Aircraft->GetNcg()(3) );
|
|
||||||
|
|
||||||
_set_Accels_Pilot_Body( Auxiliary->GetPilotAccel()(1),
|
_set_Accels_Pilot_Body( Auxiliary->GetPilotAccel(1),
|
||||||
Auxiliary->GetPilotAccel()(2),
|
Auxiliary->GetPilotAccel(2),
|
||||||
Auxiliary->GetPilotAccel()(3) );
|
Auxiliary->GetPilotAccel(3) );
|
||||||
|
|
||||||
// _set_Accels_Pilot_Body_N( Auxiliary->GetPilotAccel()(1)/32.1739,
|
|
||||||
// Auxiliary->GetNpilot(2)/32.1739,
|
|
||||||
// Auxiliary->GetNpilot(3)/32.1739 );
|
|
||||||
|
|
||||||
_set_Nlf( Aircraft->GetNlf() );
|
_set_Nlf( Aircraft->GetNlf() );
|
||||||
|
|
||||||
|
@ -524,8 +546,6 @@ bool FGJSBsim::copy_from_JSBsim() {
|
||||||
|
|
||||||
_set_V_equiv_kts( Auxiliary->GetVequivalentKTS() );
|
_set_V_equiv_kts( Auxiliary->GetVequivalentKTS() );
|
||||||
|
|
||||||
// _set_V_calibrated( Auxiliary->GetVcalibratedFPS() );
|
|
||||||
|
|
||||||
_set_V_calibrated_kts( Auxiliary->GetVcalibratedKTS() );
|
_set_V_calibrated_kts( Auxiliary->GetVcalibratedKTS() );
|
||||||
|
|
||||||
_set_V_ground_speed( Position->GetVground() );
|
_set_V_ground_speed( Position->GetVground() );
|
||||||
|
@ -546,9 +566,15 @@ bool FGJSBsim::copy_from_JSBsim() {
|
||||||
|
|
||||||
// Positions
|
// Positions
|
||||||
_updateGeocentricPosition( Position->GetLatitude(),
|
_updateGeocentricPosition( Position->GetLatitude(),
|
||||||
Position->GetLongitude(),
|
Position->GetLongitude(),
|
||||||
Position->Geth() );
|
Position->Geth() );
|
||||||
|
|
||||||
|
// Positions of Visual Reference Point
|
||||||
|
/*
|
||||||
|
_updateGeocentricPosition( Position->GetLatitudeVRP(),
|
||||||
|
Position->GetLongitudeVRP(),
|
||||||
|
Position->GethVRP() );
|
||||||
|
*/
|
||||||
_set_Altitude_AGL( Position->GetDistanceAGL() );
|
_set_Altitude_AGL( Position->GetDistanceAGL() );
|
||||||
|
|
||||||
_set_Euler_Angles( Rotation->Getphi(),
|
_set_Euler_Angles( Rotation->Getphi(),
|
||||||
|
@ -560,7 +586,6 @@ bool FGJSBsim::copy_from_JSBsim() {
|
||||||
|
|
||||||
|
|
||||||
_set_Gamma_vert_rad( Position->GetGamma() );
|
_set_Gamma_vert_rad( Position->GetGamma() );
|
||||||
// set_Gamma_horiz_rad( Gamma_horiz_rad );
|
|
||||||
|
|
||||||
_set_Earth_position_angle( Auxiliary->GetEarthPositionAngle() );
|
_set_Earth_position_angle( Auxiliary->GetEarthPositionAngle() );
|
||||||
|
|
||||||
|
@ -573,69 +598,108 @@ bool FGJSBsim::copy_from_JSBsim() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the engine values from JSBSim.
|
// Copy the engine values from JSBSim.
|
||||||
for( i=0; i < Propulsion->GetNumEngines(); i++ ) {
|
for ( i=0; i < Propulsion->GetNumEngines(); i++ ) {
|
||||||
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||||
FGEngine * eng = Propulsion->GetEngine(i);
|
char buf[30];
|
||||||
FGThruster * thrust = Propulsion->GetThruster(i);
|
sprintf(buf, "engines/engine[%d]/thruster", i);
|
||||||
|
SGPropertyNode * tnode = fgGetNode(buf, true);
|
||||||
|
FGThruster * thruster = Propulsion->GetThruster(i);
|
||||||
|
|
||||||
node->setDoubleValue("mp-osi", eng->getManifoldPressure_inHg());
|
switch (Propulsion->GetEngine(i)->GetType()) {
|
||||||
node->setDoubleValue("rpm", thrust->GetRPM());
|
case FGEngine::etPiston:
|
||||||
node->setDoubleValue("egt-degf", eng->getExhaustGasTemp_degF());
|
{ // FGPiston code block
|
||||||
|
FGPiston* eng = (FGPiston*)Propulsion->GetEngine(i);
|
||||||
|
node->setDoubleValue("egt-degf", eng->getExhaustGasTemp_degF());
|
||||||
|
node->setDoubleValue("oil-temperature-degf", eng->getOilTemp_degF());
|
||||||
|
node->setDoubleValue("oil-pressure-psi", eng->getOilPressure_psi());
|
||||||
|
node->setDoubleValue("mp-osi", eng->getManifoldPressure_inHg());
|
||||||
|
node->setDoubleValue("cht-degf", eng->getCylinderHeadTemp_degF());
|
||||||
|
node->setDoubleValue("rpm", eng->getRPM());
|
||||||
|
} // end FGPiston code block
|
||||||
|
break;
|
||||||
|
case FGEngine::etRocket:
|
||||||
|
{ // FGRocket code block
|
||||||
|
FGRocket* eng = (FGRocket*)Propulsion->GetEngine(i);
|
||||||
|
} // end FGRocket code block
|
||||||
|
break;
|
||||||
|
case FGEngine::etSimTurbine:
|
||||||
|
{ // FGSimTurbine code block
|
||||||
|
FGSimTurbine* eng = (FGSimTurbine*)Propulsion->GetEngine(i);
|
||||||
|
node->setDoubleValue("N1", eng->GetN1());
|
||||||
|
node->setDoubleValue("N2", eng->GetN2());
|
||||||
|
node->setDoubleValue("EGT_degC", eng->GetEGT());
|
||||||
|
node->setBoolValue("augmentation", eng->GetAugmentation());
|
||||||
|
node->setBoolValue("water-injection", eng->GetInjection());
|
||||||
|
node->setBoolValue("ignition", eng->GetIgnition());
|
||||||
|
node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle());
|
||||||
|
node->setDoubleValue("inlet-pos-norm", eng->GetInlet());
|
||||||
|
node->setBoolValue("reversed", eng->GetReversed());
|
||||||
|
node->setBoolValue("cutoff", eng->GetCutoff());
|
||||||
|
globals->get_controls()->set_reverser(i, eng->GetReversed() );
|
||||||
|
globals->get_controls()->set_cutoff(i, eng->GetCutoff() );
|
||||||
|
globals->get_controls()->set_water_injection(i, eng->GetInjection() );
|
||||||
|
globals->get_controls()->set_augmentation(i, eng->GetAugmentation() );
|
||||||
|
} // end FGSimTurbine code block
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
{ // FGEngine code block
|
||||||
|
FGEngine* eng = Propulsion->GetEngine(i);
|
||||||
node->setDoubleValue("fuel-flow-gph", eng->getFuelFlow_gph());
|
node->setDoubleValue("fuel-flow-gph", eng->getFuelFlow_gph());
|
||||||
node->setDoubleValue("cht-degf", eng->getCylinderHeadTemp_degF());
|
node->setDoubleValue("thrust_lb", thruster->GetThrust());
|
||||||
node->setDoubleValue("oil-temperature-degf", eng->getOilTemp_degF());
|
|
||||||
node->setDoubleValue("oil-pressure-psi", eng->getOilPressure_psi());
|
|
||||||
node->setDoubleValue("thrust_lb", eng->GetThrust());
|
|
||||||
node->setDoubleValue("N1", eng->GetN1());
|
|
||||||
node->setDoubleValue("N2", eng->GetN2());
|
|
||||||
node->setDoubleValue("EGT_degC", eng->GetEGT());
|
|
||||||
node->setDoubleValue("fuel-flow_pph", eng->getFuelFlow_pph());
|
node->setDoubleValue("fuel-flow_pph", eng->getFuelFlow_pph());
|
||||||
node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle());
|
|
||||||
node->setDoubleValue("inlet-pos-norm", eng->GetInlet());
|
|
||||||
node->setBoolValue("running", eng->GetRunning());
|
node->setBoolValue("running", eng->GetRunning());
|
||||||
node->setBoolValue("starter", eng->GetStarter());
|
node->setBoolValue("starter", eng->GetStarter());
|
||||||
node->setBoolValue("cranking", eng->GetCranking());
|
node->setBoolValue("cranking", eng->GetCranking());
|
||||||
node->setBoolValue("ignition", eng->GetIgnition());
|
|
||||||
node->setBoolValue("augmentation", eng->GetAugmentation());
|
|
||||||
node->setBoolValue("water-injection", eng->GetInjection());
|
|
||||||
node->setBoolValue("reversed", eng->GetReversed());
|
|
||||||
node->setBoolValue("cutoff", eng->GetCutoff());
|
|
||||||
node->setBoolValue("nitrous", eng->GetNitrous());
|
|
||||||
globals->get_controls()->set_starter(i, eng->GetStarter() );
|
globals->get_controls()->set_starter(i, eng->GetStarter() );
|
||||||
globals->get_controls()->set_cutoff(i, eng->GetCutoff() );
|
} // end FGEngine code block
|
||||||
globals->get_controls()->set_augmentation(i, eng->GetAugmentation() );
|
|
||||||
globals->get_controls()->set_reverser(i, eng->GetReversed() );
|
switch (thruster->GetType()) {
|
||||||
globals->get_controls()->set_water_injection(i, eng->GetInjection() );
|
case FGThruster::ttNozzle:
|
||||||
|
{ // FGNozzle code block
|
||||||
|
FGNozzle* noz = (FGNozzle*)thruster;
|
||||||
|
} // end FGNozzle code block
|
||||||
|
break;
|
||||||
|
case FGThruster::ttPropeller:
|
||||||
|
{ // FGPropeller code block
|
||||||
|
FGPropeller* prop = (FGPropeller*)thruster;
|
||||||
|
tnode->setDoubleValue("rpm", thruster->GetRPM());
|
||||||
|
tnode->setDoubleValue("pitch", prop->GetPitch());
|
||||||
|
tnode->setDoubleValue("torque", prop->GetTorque());
|
||||||
|
} // end FGPropeller code block
|
||||||
|
break;
|
||||||
|
case FGThruster::ttRotor:
|
||||||
|
{ // FGRotor code block
|
||||||
|
FGRotor* rotor = (FGRotor*)thruster;
|
||||||
|
} // end FGRotor code block
|
||||||
|
break;
|
||||||
|
case FGThruster::ttDirect:
|
||||||
|
{ // Direct code block
|
||||||
|
} // end Direct code block
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const SGPropertyNode *fuel_freeze
|
static const SGPropertyNode *fuel_freeze = fgGetNode("/sim/freeze/fuel");
|
||||||
= fgGetNode("/sim/freeze/fuel");
|
|
||||||
|
|
||||||
// Copy the fuel levels from JSBSim if fuel
|
// Copy the fuel levels from JSBSim if fuel
|
||||||
// freeze not enabled.
|
// freeze not enabled.
|
||||||
if ( ! fuel_freeze->getBoolValue() ) {
|
if ( ! fuel_freeze->getBoolValue() ) {
|
||||||
for (i = 0; i < Propulsion->GetNumTanks(); i++) {
|
for (i = 0; i < Propulsion->GetNumTanks(); i++) {
|
||||||
SGPropertyNode * node
|
SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
|
||||||
= fgGetNode("/consumables/fuel/tank", i, true);
|
double contents = Propulsion->GetTank(i)->GetContents();
|
||||||
double contents = Propulsion->GetTank(i)->GetContents();
|
node->setDoubleValue("level-gal_us", contents/6.6);
|
||||||
node->setDoubleValue("level-gal_us", contents/6.6);
|
node->setDoubleValue("level-lb", contents);
|
||||||
node->setDoubleValue("level-lb", contents);
|
// node->setDoubleValue("temperature_degC",
|
||||||
// node->setDoubleValue("temperature_degC",
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_gear();
|
update_gear();
|
||||||
|
|
||||||
stall_warning->setDoubleValue( Aerodynamics->GetStallWarn() );
|
stall_warning->setDoubleValue( Aerodynamics->GetStallWarn() );
|
||||||
|
|
||||||
/* elevator_pos_deg->setDoubleValue( FCS->GetDePos()*SG_RADIANS_TO_DEGREES );
|
|
||||||
left_aileron_pos_deg->setDoubleValue( FCS->GetDaLPos()*SG_RADIANS_TO_DEGREES );
|
|
||||||
right_aileron_pos_deg->setDoubleValue( FCS->GetDaRPos()*SG_RADIANS_TO_DEGREES );
|
|
||||||
rudder_pos_deg->setDoubleValue( -1*FCS->GetDrPos()*SG_RADIANS_TO_DEGREES );
|
|
||||||
flap_pos_deg->setDoubleValue( FCS->GetDfPos() ); */
|
|
||||||
|
|
||||||
|
|
||||||
elevator_pos_pct->setDoubleValue( FCS->GetDePos(ofNorm) );
|
elevator_pos_pct->setDoubleValue( FCS->GetDePos(ofNorm) );
|
||||||
left_aileron_pos_pct->setDoubleValue( FCS->GetDaLPos(ofNorm) );
|
left_aileron_pos_pct->setDoubleValue( FCS->GetDaLPos(ofNorm) );
|
||||||
right_aileron_pos_pct->setDoubleValue( -1*FCS->GetDaLPos(ofNorm) );
|
right_aileron_pos_pct->setDoubleValue( -1*FCS->GetDaLPos(ofNorm) );
|
||||||
|
@ -643,17 +707,19 @@ bool FGJSBsim::copy_from_JSBsim() {
|
||||||
flap_pos_pct->setDoubleValue( FCS->GetDfPos(ofNorm) );
|
flap_pos_pct->setDoubleValue( FCS->GetDfPos(ofNorm) );
|
||||||
speedbrake_pos_pct->setDoubleValue( FCS->GetDsbPos(ofNorm) );
|
speedbrake_pos_pct->setDoubleValue( FCS->GetDsbPos(ofNorm) );
|
||||||
spoilers_pos_pct->setDoubleValue( FCS->GetDspPos(ofNorm) );
|
spoilers_pos_pct->setDoubleValue( FCS->GetDspPos(ofNorm) );
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FGJSBsim::ToggleDataLogging(void) {
|
|
||||||
|
bool FGJSBsim::ToggleDataLogging(void)
|
||||||
|
{
|
||||||
return fdmex->GetOutput()->Toggle();
|
return fdmex->GetOutput()->Toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FGJSBsim::ToggleDataLogging(bool state) {
|
bool FGJSBsim::ToggleDataLogging(bool state)
|
||||||
|
{
|
||||||
if (state) {
|
if (state) {
|
||||||
fdmex->GetOutput()->Enable();
|
fdmex->GetOutput()->Enable();
|
||||||
return true;
|
return true;
|
||||||
|
@ -665,12 +731,13 @@ bool FGJSBsim::ToggleDataLogging(bool state) {
|
||||||
|
|
||||||
|
|
||||||
//Positions
|
//Positions
|
||||||
void FGJSBsim::set_Latitude(double lat) {
|
void FGJSBsim::set_Latitude(double lat)
|
||||||
|
{
|
||||||
static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft");
|
static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft");
|
||||||
double alt;
|
double alt;
|
||||||
double sea_level_radius_meters, lat_geoc;
|
double sea_level_radius_meters, lat_geoc;
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Latitude(lat);
|
FGInterface::set_Latitude(lat);
|
||||||
|
|
||||||
if ( altitude->getDoubleValue() > -9990 ) {
|
if ( altitude->getDoubleValue() > -9990 ) {
|
||||||
|
@ -693,11 +760,12 @@ void FGJSBsim::set_Latitude(double lat) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_Longitude(double lon) {
|
|
||||||
|
|
||||||
|
void FGJSBsim::set_Longitude(double lon)
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO,"FGJSBsim::set_Longitude: " << lon );
|
SG_LOG(SG_FLIGHT,SG_INFO,"FGJSBsim::set_Longitude: " << lon );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Longitude(lon);
|
FGInterface::set_Longitude(lon);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -707,7 +775,8 @@ void FGJSBsim::set_Longitude(double lon) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_Altitude(double alt) {
|
void FGJSBsim::set_Altitude(double alt)
|
||||||
|
{
|
||||||
static const SGPropertyNode *latitude = fgGetNode("/position/latitude-deg");
|
static const SGPropertyNode *latitude = fgGetNode("/position/latitude-deg");
|
||||||
|
|
||||||
double sea_level_radius_meters,lat_geoc;
|
double sea_level_radius_meters,lat_geoc;
|
||||||
|
@ -715,7 +784,7 @@ void FGJSBsim::set_Altitude(double alt) {
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt );
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt );
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, " lat (deg) = " << latitude->getDoubleValue() );
|
SG_LOG(SG_FLIGHT,SG_INFO, " lat (deg) = " << latitude->getDoubleValue() );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Altitude(alt);
|
FGInterface::set_Altitude(alt);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -732,10 +801,11 @@ void FGJSBsim::set_Altitude(double alt) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_V_calibrated_kts(double vc) {
|
void FGJSBsim::set_V_calibrated_kts(double vc)
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc );
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_V_calibrated_kts(vc);
|
FGInterface::set_V_calibrated_kts(vc);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -743,10 +813,11 @@ void FGJSBsim::set_V_calibrated_kts(double vc) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_Mach_number(double mach) {
|
void FGJSBsim::set_Mach_number(double mach)
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Mach_number: " << mach );
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Mach_number: " << mach );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Mach_number(mach);
|
FGInterface::set_Mach_number(mach);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -754,11 +825,12 @@ void FGJSBsim::set_Mach_number(double mach) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_Velocities_Local( double north, double east, double down ){
|
void FGJSBsim::set_Velocities_Local( double north, double east, double down )
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local: "
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local: "
|
||||||
<< north << ", " << east << ", " << down );
|
<< north << ", " << east << ", " << down );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Velocities_Local(north, east, down);
|
FGInterface::set_Velocities_Local(north, east, down);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -768,11 +840,12 @@ void FGJSBsim::set_Velocities_Local( double north, double east, double down ){
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){
|
void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w)
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Wind_Body: "
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Wind_Body: "
|
||||||
<< u << ", " << v << ", " << w );
|
<< u << ", " << v << ", " << w );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Velocities_Wind_Body(u, v, w);
|
FGInterface::set_Velocities_Wind_Body(u, v, w);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -783,11 +856,12 @@ void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){
|
||||||
}
|
}
|
||||||
|
|
||||||
//Euler angles
|
//Euler angles
|
||||||
void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) {
|
void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi )
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Euler_Angles: "
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Euler_Angles: "
|
||||||
<< phi << ", " << theta << ", " << psi );
|
<< phi << ", " << theta << ", " << psi );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Euler_Angles(phi, theta, psi);
|
FGInterface::set_Euler_Angles(phi, theta, psi);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -798,10 +872,11 @@ void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Flight Path
|
//Flight Path
|
||||||
void FGJSBsim::set_Climb_Rate( double roc) {
|
void FGJSBsim::set_Climb_Rate( double roc)
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Climb_Rate: " << roc );
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Climb_Rate: " << roc );
|
||||||
|
|
||||||
// In case we're not trimming
|
// In case we're not trimming
|
||||||
FGInterface::set_Climb_Rate(roc);
|
FGInterface::set_Climb_Rate(roc);
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -814,7 +889,8 @@ void FGJSBsim::set_Climb_Rate( double roc) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::set_Gamma_vert_rad( double gamma) {
|
void FGJSBsim::set_Gamma_vert_rad( double gamma)
|
||||||
|
{
|
||||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Gamma_vert_rad: " << gamma );
|
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Gamma_vert_rad: " << gamma );
|
||||||
|
|
||||||
update_ic();
|
update_ic();
|
||||||
|
@ -824,18 +900,18 @@ void FGJSBsim::set_Gamma_vert_rad( double gamma) {
|
||||||
needTrim=true;
|
needTrim=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::init_gear(void ) {
|
void FGJSBsim::init_gear(void )
|
||||||
|
{
|
||||||
FGGroundReactions* gr=fdmex->GetGroundReactions();
|
FGGroundReactions* gr=fdmex->GetGroundReactions();
|
||||||
int Ngear=GroundReactions->GetNumGearUnits();
|
int Ngear=GroundReactions->GetNumGearUnits();
|
||||||
for (int i=0;i<Ngear;i++) {
|
for (int i=0;i<Ngear;i++) {
|
||||||
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
|
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
|
||||||
node->setDoubleValue("xoffset-in",
|
node->setDoubleValue("xoffset-in",
|
||||||
gr->GetGearUnit(i)->GetBodyLocation()(1));
|
gr->GetGearUnit(i)->GetBodyLocation()(1));
|
||||||
node->setDoubleValue("yoffset-in",
|
node->setDoubleValue("yoffset-in",
|
||||||
gr->GetGearUnit(i)->GetBodyLocation()(2));
|
gr->GetGearUnit(i)->GetBodyLocation()(2));
|
||||||
node->setDoubleValue("zoffset-in",
|
node->setDoubleValue("zoffset-in",
|
||||||
gr->GetGearUnit(i)->GetBodyLocation()(3));
|
gr->GetGearUnit(i)->GetBodyLocation()(3));
|
||||||
node->setBoolValue("wow", gr->GetGearUnit(i)->GetWOW());
|
node->setBoolValue("wow", gr->GetGearUnit(i)->GetWOW());
|
||||||
node->setBoolValue("has-brake", gr->GetGearUnit(i)->GetBrakeGroup() > 0);
|
node->setBoolValue("has-brake", gr->GetGearUnit(i)->GetBrakeGroup() > 0);
|
||||||
node->setDoubleValue("position-norm", FCS->GetGearPos());
|
node->setDoubleValue("position-norm", FCS->GetGearPos());
|
||||||
|
@ -843,56 +919,60 @@ void FGJSBsim::init_gear(void ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::update_gear(void) {
|
void FGJSBsim::update_gear(void)
|
||||||
|
{
|
||||||
FGGroundReactions* gr=fdmex->GetGroundReactions();
|
FGGroundReactions* gr=fdmex->GetGroundReactions();
|
||||||
int Ngear=GroundReactions->GetNumGearUnits();
|
int Ngear=GroundReactions->GetNumGearUnits();
|
||||||
for (int i=0;i<Ngear;i++) {
|
for (int i=0;i<Ngear;i++) {
|
||||||
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
|
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
|
||||||
node->getChild("wow", 0, true)
|
node->getChild("wow", 0, true)->setBoolValue(gr->GetGearUnit(i)->GetWOW());
|
||||||
->setBoolValue(gr->GetGearUnit(i)->GetWOW());
|
node->getChild("position-norm", 0, true)->setDoubleValue(FCS->GetGearPos());
|
||||||
node->getChild("position-norm", 0, true)
|
|
||||||
->setDoubleValue(FCS->GetGearPos());
|
|
||||||
gr->GetGearUnit(i)->SetTirePressure(node->getDoubleValue("tire-pressure-norm"));
|
gr->GetGearUnit(i)->SetTirePressure(node->getDoubleValue("tire-pressure-norm"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::do_trim(void) {
|
void FGJSBsim::do_trim(void)
|
||||||
|
{
|
||||||
|
FGTrim *fgtrim;
|
||||||
|
|
||||||
FGTrim *fgtrim;
|
if ( fgGetBool("/sim/presets/onground") )
|
||||||
if( fgGetBool("/sim/presets/onground") ) {
|
{
|
||||||
fgic->SetVcalibratedKtsIC(0.0);
|
fgic->SetVcalibratedKtsIC(0.0);
|
||||||
fgtrim=new FGTrim(fdmex,tGround);
|
fgtrim = new FGTrim(fdmex,tGround);
|
||||||
} else {
|
} else {
|
||||||
fgtrim=new FGTrim(fdmex,tLongitudinal);
|
fgtrim = new FGTrim(fdmex,tLongitudinal);
|
||||||
}
|
}
|
||||||
if( !fgtrim->DoTrim() ) {
|
|
||||||
fgtrim->Report();
|
|
||||||
fgtrim->TrimStats();
|
|
||||||
} else {
|
|
||||||
trimmed->setBoolValue(true);
|
|
||||||
}
|
|
||||||
if (FGJSBBase::debug_lvl > 0)
|
|
||||||
State->ReportState();
|
|
||||||
delete fgtrim;
|
|
||||||
pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
|
|
||||||
throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );
|
|
||||||
aileron_trim->setDoubleValue( FCS->GetDaCmd() );
|
|
||||||
rudder_trim->setDoubleValue( FCS->GetDrCmd() );
|
|
||||||
|
|
||||||
globals->get_controls()->set_elevator_trim(FCS->GetPitchTrimCmd());
|
if ( !fgtrim->DoTrim() ) {
|
||||||
globals->get_controls()->set_elevator(FCS->GetDeCmd());
|
fgtrim->Report();
|
||||||
globals->get_controls()->set_throttle(FGControls::ALL_ENGINES,
|
fgtrim->TrimStats();
|
||||||
FCS->GetThrottleCmd(0));
|
} else {
|
||||||
|
trimmed->setBoolValue(true);
|
||||||
|
}
|
||||||
|
if (FGJSBBase::debug_lvl > 0)
|
||||||
|
State->ReportState();
|
||||||
|
|
||||||
globals->get_controls()->set_aileron(FCS->GetDaCmd());
|
delete fgtrim;
|
||||||
globals->get_controls()->set_rudder( FCS->GetDrCmd());
|
|
||||||
|
pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
|
||||||
SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );
|
throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );
|
||||||
|
aileron_trim->setDoubleValue( FCS->GetDaCmd() );
|
||||||
|
rudder_trim->setDoubleValue( FCS->GetDrCmd() );
|
||||||
|
|
||||||
|
globals->get_controls()->set_elevator_trim(FCS->GetPitchTrimCmd());
|
||||||
|
globals->get_controls()->set_elevator(FCS->GetDeCmd());
|
||||||
|
globals->get_controls()->set_throttle(FGControls::ALL_ENGINES,
|
||||||
|
FCS->GetThrottleCmd(0));
|
||||||
|
|
||||||
|
globals->get_controls()->set_aileron(FCS->GetDaCmd());
|
||||||
|
globals->get_controls()->set_rudder( FCS->GetDrCmd());
|
||||||
|
|
||||||
|
SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGJSBsim::update_ic(void) {
|
void FGJSBsim::update_ic(void)
|
||||||
if( !needTrim ) {
|
{
|
||||||
|
if ( !needTrim ) {
|
||||||
fgic->SetLatitudeRadIC(get_Lat_geocentric() );
|
fgic->SetLatitudeRadIC(get_Lat_geocentric() );
|
||||||
fgic->SetLongitudeRadIC( get_Longitude() );
|
fgic->SetLongitudeRadIC( get_Longitude() );
|
||||||
fgic->SetAltitudeFtIC( get_Altitude() );
|
fgic->SetAltitudeFtIC( get_Altitude() );
|
||||||
|
|
|
@ -47,12 +47,12 @@ DEFINITIONS
|
||||||
|
|
||||||
#define ID_CONDITION "$Id$"
|
#define ID_CONDITION "$Id$"
|
||||||
|
|
||||||
namespace JSBSim {
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -54,10 +54,6 @@ namespace JSBSim {
|
||||||
|
|
||||||
class FGFCS;
|
class FGFCS;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -46,7 +46,6 @@ INCLUDES
|
||||||
#include "../FGJSBBase.h"
|
#include "../FGJSBBase.h"
|
||||||
#include "../FGPropertyManager.h"
|
#include "../FGPropertyManager.h"
|
||||||
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINITIONS
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -63,10 +62,6 @@ namespace JSBSim {
|
||||||
|
|
||||||
class FGFCS;
|
class FGFCS;
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -75,15 +70,15 @@ CLASS DOCUMENTATION
|
||||||
The Flight Control System (FCS) for JSBSim consists of the FCS container
|
The Flight Control System (FCS) for JSBSim consists of the FCS container
|
||||||
class (see \URL[FGFCS]{FGFCS.html}), the FGFCSComponent base class, and the
|
class (see \URL[FGFCS]{FGFCS.html}), the FGFCSComponent base class, and the
|
||||||
component classes from which can be constructed a string, or channel. See:
|
component classes from which can be constructed a string, or channel. See:
|
||||||
<ul>
|
|
||||||
<li>\URL[Switch Component]{FGSwitch.html}</li>
|
- FGSwitch
|
||||||
<li>\URL[Gain Component]{FGGain.html}</li>
|
- FGGain
|
||||||
<li>\URL[Flaps Component]{FGFlaps.html}</li>
|
- FGKinemat
|
||||||
<li>\URL[Filter Component]{FGFilter.html}</li>
|
- FGFilter
|
||||||
<li>\URL[Deadband Component]{FGDeadBand.html}</li>
|
- FGDeadBand
|
||||||
<li>\URL[Summer Component]{FGSummer.html}</li>
|
- FGSummer
|
||||||
<li>\URL[Gradient Component]{FGGradient.html}</li>
|
- FGGradient
|
||||||
</ul>
|
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see Documentation for the FGFCS class, and for the configuration file class
|
@see Documentation for the FGFCS class, and for the configuration file class
|
||||||
|
|
|
@ -59,6 +59,7 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
||||||
Name = AC_cfg->GetValue("NAME");
|
Name = AC_cfg->GetValue("NAME");
|
||||||
AC_cfg->GetNextConfigLine();
|
AC_cfg->GetNextConfigLine();
|
||||||
dt = fcs->GetState()->Getdt();
|
dt = fcs->GetState()->Getdt();
|
||||||
|
Trigger = 0;
|
||||||
|
|
||||||
C1 = C2 = C3 = C4 = C5 = C6 = 0.0;
|
C1 = C2 = C3 = C4 = C5 = C6 = 0.0;
|
||||||
|
|
||||||
|
@ -71,12 +72,18 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
||||||
|
|
||||||
while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
|
while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
|
||||||
*AC_cfg >> token;
|
*AC_cfg >> token;
|
||||||
if (token == "C1") *AC_cfg >> C1;
|
if (token == "C1") *AC_cfg >> C1;
|
||||||
else if (token == "C2") *AC_cfg >> C2;
|
else if (token == "C2") *AC_cfg >> C2;
|
||||||
else if (token == "C3") *AC_cfg >> C3;
|
else if (token == "C3") *AC_cfg >> C3;
|
||||||
else if (token == "C4") *AC_cfg >> C4;
|
else if (token == "C4") *AC_cfg >> C4;
|
||||||
else if (token == "C5") *AC_cfg >> C5;
|
else if (token == "C5") *AC_cfg >> C5;
|
||||||
else if (token == "C6") *AC_cfg >> C6;
|
else if (token == "C6") *AC_cfg >> C6;
|
||||||
|
else if (token == "TRIGGER")
|
||||||
|
{
|
||||||
|
token = AC_cfg->GetValue("TRIGGER");
|
||||||
|
*AC_cfg >> token;
|
||||||
|
Trigger = resolveSymbol(token);
|
||||||
|
}
|
||||||
else if (token == "INPUT")
|
else if (token == "INPUT")
|
||||||
{
|
{
|
||||||
token = AC_cfg->GetValue("INPUT");
|
token = AC_cfg->GetValue("INPUT");
|
||||||
|
@ -146,6 +153,8 @@ FGFilter::~FGFilter()
|
||||||
|
|
||||||
bool FGFilter::Run(void)
|
bool FGFilter::Run(void)
|
||||||
{
|
{
|
||||||
|
int test = 0;
|
||||||
|
|
||||||
FGFCSComponent::Run(); // call the base class for initialization of Input
|
FGFCSComponent::Run(); // call the base class for initialization of Input
|
||||||
|
|
||||||
if (Initialize) {
|
if (Initialize) {
|
||||||
|
@ -153,6 +162,15 @@ bool FGFilter::Run(void)
|
||||||
PreviousOutput1 = PreviousInput1 = Output = Input;
|
PreviousOutput1 = PreviousInput1 = Output = Input;
|
||||||
Initialize = false;
|
Initialize = false;
|
||||||
|
|
||||||
|
} else if (Trigger != 0) {
|
||||||
|
test = Trigger->getIntValue();
|
||||||
|
if (test < 0) {
|
||||||
|
Output = PreviousOutput1 = PreviousOutput2 = 0.0;
|
||||||
|
Input = PreviousInput1 = PreviousInput2 = 0.0;
|
||||||
|
} else {
|
||||||
|
Output = PreviousOutput1 = PreviousOutput2 = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Input = InputNodes[0]->getDoubleValue();
|
Input = InputNodes[0]->getDoubleValue();
|
||||||
switch (FilterType) {
|
switch (FilterType) {
|
||||||
|
|
|
@ -52,38 +52,127 @@ FORWARD DECLARATIONS
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
/** Encapsulates a filter for the flight control system.
|
/** Encapsulates a filter for the flight control system.
|
||||||
Filters are modeled using the Tustin Substitution method. These types of
|
The filter component can simulate any filter up to second order. The
|
||||||
filters can currently be modeled:
|
Tustin substitution is used to take filter definitions from LaPlace space to the
|
||||||
|
time domain. The general format for a filter specification is:
|
||||||
- Lag
|
|
||||||
- Lead-Lag
|
|
||||||
- Washout
|
|
||||||
- Integrator
|
|
||||||
- Second order
|
|
||||||
|
|
||||||
The filter is specified in the config file like this:
|
<pre>
|
||||||
<pre>
|
\<COMPONENT NAME="name" TYPE="type">
|
||||||
\<COMPONENT NAME="{name}" TYPE="{LAG_FILTER}"\><BR>
|
INPUT \<property>
|
||||||
INPUT 15<BR>
|
C1 \<value>
|
||||||
C1 600<BR>
|
[C2 \<value>]
|
||||||
OUTPUT fcs/elevator-pos-rad<BR>
|
[C3 \<value>]
|
||||||
\</COMPONENT\>
|
[C4 \<value>]
|
||||||
</pre>
|
[C5 \<value>]
|
||||||
|
[C6 \<value>]
|
||||||
|
[OUTPUT \<property>]
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
For a lag filter of the form,
|
||||||
|
<pre>
|
||||||
|
C1
|
||||||
|
------
|
||||||
|
s + C1
|
||||||
|
</pre>
|
||||||
|
the corresponding filter definition is:
|
||||||
|
<pre>
|
||||||
|
\<COMPONENT NAME="name" TYPE="LAG_FILTER">
|
||||||
|
INPUT \<property>
|
||||||
|
C1 \<value>
|
||||||
|
[OUTPUT \<property>]
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
As an example, for the specific filter:
|
||||||
|
<pre>
|
||||||
|
600
|
||||||
|
------
|
||||||
|
s + 600
|
||||||
|
</pre>
|
||||||
|
the corresponding filter definition could be:
|
||||||
|
<pre>
|
||||||
|
\<COMPONENT NAME="LAG_1" TYPE="LAG_FILTER">
|
||||||
|
INPUT aileron_cmd
|
||||||
|
C1 600
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
For a lead-lag filter of the form:
|
||||||
|
<pre>
|
||||||
|
C1*s + C2
|
||||||
|
---------
|
||||||
|
C3*s + C4
|
||||||
|
</pre>
|
||||||
|
The corresponding filter definition is:
|
||||||
|
<pre>
|
||||||
|
\<COMPONENT NAME="name" TYPE="LEAD_LAG_FILTER">
|
||||||
|
INPUT \<property>
|
||||||
|
C1 \<value>
|
||||||
|
C2 \<value>
|
||||||
|
C3 \<value>
|
||||||
|
C4 \<value>
|
||||||
|
[OUTPUT \<property>]
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
For a washout filter of the form:
|
||||||
|
<pre>
|
||||||
|
s
|
||||||
|
------
|
||||||
|
s + C1
|
||||||
|
</pre>
|
||||||
|
The corresponding filter definition is:
|
||||||
|
<pre>
|
||||||
|
\<COMPONENT NAME="name" TYPE="WASHOUT_FILTER">
|
||||||
|
INPUT \<property>
|
||||||
|
C1 \<value>
|
||||||
|
[OUTPUT \<property>]
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
For a second order filter of the form:
|
||||||
|
<pre>
|
||||||
|
C1*s^2 + C2*s + C3
|
||||||
|
------------------
|
||||||
|
C4*s^2 + C5*s + C6
|
||||||
|
</pre>
|
||||||
|
The corresponding filter definition is:
|
||||||
|
<pre>
|
||||||
|
\<COMPONENT NAME="name" TYPE="SECOND_ORDER_FILTER">
|
||||||
|
INPUT \<property>
|
||||||
|
C1 \<value>
|
||||||
|
C2 \<value>
|
||||||
|
C3 \<value>
|
||||||
|
C4 \<value>
|
||||||
|
C5 \<value>
|
||||||
|
C6 \<value>
|
||||||
|
[OUTPUT \<property>]
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
For an integrator of the form:
|
||||||
|
<pre>
|
||||||
|
C1
|
||||||
|
---
|
||||||
|
s
|
||||||
|
</pre>
|
||||||
|
The corresponding filter definition is:
|
||||||
|
<pre>
|
||||||
|
\<COMPONENT NAME="name" TYPE="INTEGRATOR">
|
||||||
|
INPUT \<property>
|
||||||
|
C1 \<value>
|
||||||
|
[OUTPUT \<property>]
|
||||||
|
[TRIGGER \<property>]
|
||||||
|
\</COMPONENT>
|
||||||
|
</pre>
|
||||||
|
For the integrator, the TRIGGER features the following behavior, if the TRIGGER property value is:
|
||||||
|
- -1 (or simply less than zero), all previous inputs and outputs are set to 0.0
|
||||||
|
- 0, no action is taken - the output is calculated normally
|
||||||
|
- +1 (or simply greater than zero), all previous outputs (only) will be set to 0.0
|
||||||
|
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFilter.h?rev=HEAD">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFilter.cpp?rev=HEAD">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
@ -122,6 +211,7 @@ private:
|
||||||
double PreviousOutput1;
|
double PreviousOutput1;
|
||||||
double PreviousOutput2;
|
double PreviousOutput2;
|
||||||
FGConfigFile* AC_cfg;
|
FGConfigFile* AC_cfg;
|
||||||
|
FGPropertyManager* Trigger;
|
||||||
void Debug(int from);
|
void Debug(int from);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,19 +72,19 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
||||||
while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
|
while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
|
||||||
*AC_cfg >> token;
|
*AC_cfg >> token;
|
||||||
if (token == "INPUT") {
|
if (token == "INPUT") {
|
||||||
token = AC_cfg->GetValue("INPUT");
|
*AC_cfg >> token;
|
||||||
|
|
||||||
if (token[0] == '-') {
|
if (token[0] == '-') {
|
||||||
invert = true;
|
invert = true;
|
||||||
token.erase(0,1);
|
token.erase(0,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InputNodes.size() > 0) {
|
if (InputNodes.size() > 0) {
|
||||||
cerr << "Gains can only accept one input" << endl;
|
cerr << "Gains can only accept one input" << endl;
|
||||||
} else {
|
} else {
|
||||||
*AC_cfg >> token;
|
|
||||||
InputNodes.push_back( resolveSymbol(token) );
|
InputNodes.push_back( resolveSymbol(token) );
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (token == "GAIN") {
|
} else if (token == "GAIN") {
|
||||||
*AC_cfg >> Gain;
|
*AC_cfg >> Gain;
|
||||||
} else if (token == "MIN") {
|
} else if (token == "MIN") {
|
||||||
|
@ -113,7 +113,7 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
||||||
*Table << *AC_cfg;
|
*Table << *AC_cfg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FGFCSComponent::bind();
|
FGFCSComponent::bind();
|
||||||
if (Type == "AEROSURFACE_SCALE")
|
if (Type == "AEROSURFACE_SCALE")
|
||||||
treenode->Tie( "output-norm", this, &FGGain::GetOutputPct );
|
treenode->Tie( "output-norm", this, &FGGain::GetOutputPct );
|
||||||
|
@ -198,7 +198,6 @@ void FGGain::Debug(int from)
|
||||||
if (IsOutput) cout << " OUTPUT: " << OutputNode->getName() << endl;
|
if (IsOutput) cout << " OUTPUT: " << OutputNode->getName() << endl;
|
||||||
cout << " MIN: " << Min << endl;
|
cout << " MIN: " << Min << endl;
|
||||||
cout << " MAX: " << Max << endl;
|
cout << " MAX: " << Max << endl;
|
||||||
if(invert) cout << " Invert mapping" << endl;
|
|
||||||
if (ScheduledBy != 0) {
|
if (ScheduledBy != 0) {
|
||||||
cout << " Scheduled by parameter: " << ScheduledBy->getName() << endl;
|
cout << " Scheduled by parameter: " << ScheduledBy->getName() << endl;
|
||||||
Table->Print();
|
Table->Print();
|
||||||
|
|
|
@ -26,10 +26,6 @@
|
||||||
HISTORY
|
HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -53,17 +49,27 @@ INCLUDES
|
||||||
#include "../FGConfigFile.h"
|
#include "../FGConfigFile.h"
|
||||||
#include "../FGTable.h"
|
#include "../FGTable.h"
|
||||||
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINES
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_GAIN "$Id$"
|
#define ID_GAIN "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
class FGFCS;
|
class FGFCS;
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Encapsulates a gain component for the flight control system.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -26,10 +26,6 @@
|
||||||
HISTORY
|
HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -45,15 +41,26 @@ INCLUDES
|
||||||
#include "../FGConfigFile.h"
|
#include "../FGConfigFile.h"
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINES
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_GRADIENT "$Id$"
|
#define ID_GRADIENT "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
class FGFCS;
|
class FGFCS;
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Encapsulates a gradient component for the flight control system.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -26,10 +26,6 @@
|
||||||
HISTORY
|
HISTORY
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
COMMENTS, REFERENCES, and NOTES
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
SENTRY
|
SENTRY
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -57,13 +53,24 @@ INCLUDES
|
||||||
#include "../FGConfigFile.h"
|
#include "../FGConfigFile.h"
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
DEFINES
|
DEFINITIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
#define ID_FLAPS "$Id$"
|
#define ID_FLAPS "$Id$"
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
FORWARD DECLARATIONS
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
CLASS DOCUMENTATION
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
/** Encapsulates a kinematic component for the flight control system.
|
||||||
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DECLARATION
|
CLASS DECLARATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
|
@ -65,10 +65,6 @@ FORWARD DECLARATIONS
|
||||||
namespace JSBSim {
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
@ -77,10 +73,6 @@ CLASS DOCUMENTATION
|
||||||
state variables, or even floating point numbers (e.g. for a bias).
|
state variables, or even floating point numbers (e.g. for a bias).
|
||||||
@author Jon S. Berndt
|
@author Jon S. Berndt
|
||||||
@version $Id$
|
@version $Id$
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGSummer.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Header File </a>
|
|
||||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGSummer.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
|
||||||
Source File </a>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
|
@ -47,12 +47,12 @@ DEFINITIONS
|
||||||
|
|
||||||
#define ID_SWITCH "$Id$"
|
#define ID_SWITCH "$Id$"
|
||||||
|
|
||||||
namespace JSBSim {
|
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
FORWARD DECLARATIONS
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
|
namespace JSBSim {
|
||||||
|
|
||||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
CLASS DOCUMENTATION
|
CLASS DOCUMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
@ -85,20 +85,20 @@ complex groupings of logical comparisons. Each CONDITION_GROUP contains
|
||||||
additional conditions, as well as possibly additional CONDITION_GROUPs.
|
additional conditions, as well as possibly additional CONDITION_GROUPs.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
\<COMPONENT NAME="switch1" TYPE="SWITCH"\><BR>
|
\<COMPONENT NAME="switch1" TYPE="SWITCH"\>
|
||||||
\<TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}"\><BR>
|
\<TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}"\>
|
||||||
{property} {conditional} {property|value}<BR>
|
{property} {conditional} {property|value}
|
||||||
\<CONDITION_GROUP LOGIC="{AND|OR}"\><BR>
|
\<CONDITION_GROUP LOGIC="{AND|OR}"\>
|
||||||
{property} {conditional} {property|value}<BR>
|
{property} {conditional} {property|value}
|
||||||
...<BR>
|
...
|
||||||
\</CONDITION_GROUP\><BR>
|
\</CONDITION_GROUP\>
|
||||||
...<BR>
|
...
|
||||||
\</TEST><BR>
|
\</TEST>
|
||||||
\<TEST LOGIC="{AND|OR}" OUTPUT="{property|value}"\><BR>
|
\<TEST LOGIC="{AND|OR}" OUTPUT="{property|value}"\>
|
||||||
{property} {conditional} {property|value}<BR>
|
{property} {conditional} {property|value}
|
||||||
...<BR>
|
...
|
||||||
\</TEST\><BR>
|
\</TEST\>
|
||||||
...<BR>
|
...
|
||||||
\</COMPONENT\>
|
\</COMPONENT\>
|
||||||
</pre>
|
</pre>
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue