]> git.mxchange.org Git - flightgear.git/commitdiff
Curt Olson:
authorcurt <curt>
Wed, 14 Jan 2004 22:09:39 +0000 (22:09 +0000)
committercurt <curt>
Wed, 14 Jan 2004 22:09:39 +0000 (22:09 +0000)
Sync with most current JSBSim CVS.

82 files changed:
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAerodynamics.h
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAircraft.h
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGAtmosphere.h
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGAuxiliary.h
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGCoefficient.h
src/FDM/JSBSim/FGColumnVector3.h
src/FDM/JSBSim/FGColumnVector4.h
src/FDM/JSBSim/FGConfigFile.cpp
src/FDM/JSBSim/FGConfigFile.h
src/FDM/JSBSim/FGEngine.cpp
src/FDM/JSBSim/FGEngine.h
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGFactorGroup.cpp
src/FDM/JSBSim/FGFactorGroup.h
src/FDM/JSBSim/FGForce.h
src/FDM/JSBSim/FGGroundReactions.h
src/FDM/JSBSim/FGInertial.h
src/FDM/JSBSim/FGInitialCondition.h
src/FDM/JSBSim/FGJSBBase.cpp
src/FDM/JSBSim/FGJSBBase.h
src/FDM/JSBSim/FGLGear.cpp
src/FDM/JSBSim/FGLGear.h
src/FDM/JSBSim/FGMassBalance.h
src/FDM/JSBSim/FGMatrix33.h
src/FDM/JSBSim/FGModel.h
src/FDM/JSBSim/FGNozzle.cpp
src/FDM/JSBSim/FGNozzle.h
src/FDM/JSBSim/FGOutput.h
src/FDM/JSBSim/FGPiston.cpp
src/FDM/JSBSim/FGPiston.h
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPosition.h
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropeller.h
src/FDM/JSBSim/FGPropertyManager.cpp
src/FDM/JSBSim/FGPropertyManager.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGPropulsion.h
src/FDM/JSBSim/FGRocket.cpp
src/FDM/JSBSim/FGRocket.h
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGRotor.h
src/FDM/JSBSim/FGScript.cpp
src/FDM/JSBSim/FGScript.h
src/FDM/JSBSim/FGSimTurbine.cpp
src/FDM/JSBSim/FGSimTurbine.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGState.h
src/FDM/JSBSim/FGTable.cpp
src/FDM/JSBSim/FGTable.h
src/FDM/JSBSim/FGTank.cpp
src/FDM/JSBSim/FGTank.h
src/FDM/JSBSim/FGThruster.cpp
src/FDM/JSBSim/FGThruster.h
src/FDM/JSBSim/FGTranslation.cpp
src/FDM/JSBSim/FGTranslation.h
src/FDM/JSBSim/FGTrim.h
src/FDM/JSBSim/FGTrimAxis.h
src/FDM/JSBSim/FGTurbine.h
src/FDM/JSBSim/FGUtility.h
src/FDM/JSBSim/FGfdmSocket.cpp
src/FDM/JSBSim/FGfdmSocket.h
src/FDM/JSBSim/JSBSim.cxx
src/FDM/JSBSim/filtersjb/FGCondition.h
src/FDM/JSBSim/filtersjb/FGDeadBand.h
src/FDM/JSBSim/filtersjb/FGFCSComponent.h
src/FDM/JSBSim/filtersjb/FGFilter.cpp
src/FDM/JSBSim/filtersjb/FGFilter.h
src/FDM/JSBSim/filtersjb/FGGain.cpp
src/FDM/JSBSim/filtersjb/FGGain.h
src/FDM/JSBSim/filtersjb/FGGradient.h
src/FDM/JSBSim/filtersjb/FGKinemat.h
src/FDM/JSBSim/filtersjb/FGSummer.h
src/FDM/JSBSim/filtersjb/FGSwitch.h

index 214a6f0b614bffd573c69688ba8e6bd70f8e0849..43d59bb07b44a1487e928aa09bd757b2fd263d4f 100644 (file)
@@ -107,7 +107,7 @@ bool FGAerodynamics::Run(void)
   if (!FGModel::Run()) {
 
     twovel = 2*Translation->GetVt();
-    if (twovel > 0) {
+    if (twovel != 0) {
       bi2vel = Aircraft->GetWingSpan() / twovel;
       ci2vel = Aircraft->Getcbar() / twovel;
     }  
index bd641f3b913b533b28bcc3fc4ca9ac07509f0681..def5575c6e1e33f7d1d57b4f26df8f1af1d253dd 100644 (file)
@@ -80,9 +80,17 @@ CLASS DOCUMENTATION
     This class owns and contains the list of coefficients that define the
     aerodynamic properties of this aircraft. Here also, such unique phenomena
     as ground effect and maximum lift curve tailoff are handled.
-    @author Jon S. Berndt
-    @author Tony Peden
-    @version $Id$
+    @config
+    <pre>
+    \<AERODYNAMICS>
+       \<AXIS NAME="{LIFT|DRAG|SIDE|ROLL|PITCH|YAW}">
+         {Coefficient definitions}
+       \</AXIS>
+       {Additional axis definitions}
+    \</AERODYNAMICS> </pre>
+    
+    @author Jon S. Berndt, Tony Peden
+    $Id$
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 9125732faa43f9f43958ec0842bd9023893441f1..3542546ae62df76094fdb71f82bc7a46250cb37a 100644 (file)
@@ -232,6 +232,10 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
     } else if (parameter == "AC_AERORP") {
       *AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
       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") {
       *AC_cfg >> pmWt >> pmX >> pmY >> pmZ;
       MassBalance->AddPointMass(pmWt, pmX, pmY, pmZ);
@@ -306,6 +310,12 @@ void FGAircraft::bind(void)
                        (PMF)&FGAircraft::GetXYZep);
   PropertyManager->Tie("metrics/eyepoint-z-ft", this,3,
                        (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-y-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");
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index bd25f3b2aab6156fd638cfcb2b71026dbabc6629..4ddcd46877010b671fd74fc644202df4028dcaee 100644 (file)
@@ -73,10 +73,6 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -85,26 +81,20 @@ CLASS DOCUMENTATION
     the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties,
     landing gear, etc. These constituent parts may actually run as separate
     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
     @version $Id$
-    @see
-     <ol><li>Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
+    @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</li>
-     <li>D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
-     JSC 12960, July 1977</li>
-     <li>Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
-     NASA-Ames", NASA CR-2497, January 1975</li>
-     <li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
-     Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
-     <li>Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
-     1982 ISBN 0-471-08936-2</li></ol>
-    @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>
+          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
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -155,10 +145,14 @@ public:
   inline FGColumnVector3& GetForces(void) { return vForces; }
   inline double GetForces(int idx) const { return vForces(idx); }
   inline FGColumnVector3& GetBodyAccel(void) { return vBodyAccel; }
+  inline double GetBodyAccel(int idx) { return vBodyAccel(idx); }
   inline FGColumnVector3& GetNcg   (void)  { return vNcg; }
+  inline double GetNcg(int idx)  { return vNcg(idx); }
   inline FGColumnVector3& GetXYZrp(void) { return vXYZrp; }
+  inline FGColumnVector3& GetXYZvrp(void) { return vXYZvrp; }
   inline FGColumnVector3& GetXYZep(void) { return vXYZep; }
   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 void SetAircraftName(string name) {AircraftName = name;}
 
@@ -173,6 +167,7 @@ private:
   FGColumnVector3 vMoments;
   FGColumnVector3 vForces;
   FGColumnVector3 vXYZrp;
+  FGColumnVector3 vXYZvrp;
   FGColumnVector3 vXYZep;
   FGColumnVector3 vEuler;
   FGColumnVector3 vDXYZcg;
index bf02c1bc0a8f69da1f52a8c666c044e39a6910d8..df7af2fe99127724404cca7d4589328f1ba99235 100644 (file)
@@ -156,9 +156,9 @@ bool FGAtmosphere::Run(void)
 
     Debug(2);
 
-       return false;
+    return false;
   } else {                               // skip Run() execution this time
-       return true;
+    return true;
   }
 }
 
index 72bdb1d395454c59dfe76b20458de8e1c6fff65d..2eae721fa2dc1955b6147a3d6aad81fef63fbe00 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  Header:       FGAtmosphere.h
  Author:       Jon Berndt
 HISTORY
 --------------------------------------------------------------------------------
 11/24/98   JSB   Created
-07/23/99   TP   Added implementation of 1959 Standard Atmosphere
-           Moved calculation of Mach number to FGTranslation
-                Updated to '76 model
+07/23/99   TP    Added implementation of 1959 Standard Atmosphere
+                 Moved calculation of Mach number to FGTranslation
+                 Updated to '76 model
  
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGAtmosphere_H
 #define FGAtmosphere_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
 #include "FGMatrix33.h"
@@ -61,28 +60,19 @@ FORWARD DECLARATIONS
 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
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Models the standard atmosphere.
     @author Tony Peden, Jon Berndt
     @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">
-         Header File </a>
-    @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>
+    @see Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
+         1989, ISBN 0-07-001641-0
 */
 
-/******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGAtmosphere : public FGModel {
 public:
@@ -159,7 +149,7 @@ public:
   void unbind(void);
 
   
-private:
+protected:
   double rho;
 
   enum tType {ttStandard, ttBerndt, ttNone} turbType;
@@ -196,6 +186,6 @@ private:
 
 } // namespace JSBSim
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index a4a430b90fde24fdd969f7632ed6709724329d04..a630eab38e5581b0139790fbaa46b9d239553391 100644 (file)
@@ -98,28 +98,33 @@ bool FGAuxiliary::Run()
   if (!FGModel::Run()) {
     GetState();
     
-    //caculate total temperature assuming isentropic flow
+    //calculate total temperature assuming isentropic flow
     tat=sat*(1 + 0.2*mach*mach);
+    tatc=RankineToCelsius(tat);
     
     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 {
       // shock in front of pitot tube, we'll assume its normal and use
       // the Rayleigh Pitot Tube Formula, i.e. the ratio of total
       // 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
       // 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;
     }
 
     A = pow(((pt-p)/psl+1),0.28571);
-    vcas = sqrt(7*psl/rhosl*(A-1));
-    veas = sqrt(2*qbar/rhosl);
+    if (machU > 0.0) {
+      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
     // for the coordinated turn ball instrument. Motion base platforms sometimes
@@ -222,8 +227,12 @@ void FGAuxiliary::bind(void)
                        &FGAuxiliary::GetVequivalentFPS);
   PropertyManager->Tie("velocities/ve-kts", this,
                        &FGAuxiliary::GetVequivalentKTS);
+  PropertyManager->Tie("velocities/machU", this,
+                       &FGAuxiliary::GetMachU);
   PropertyManager->Tie("velocities/tat-r", this,
                        &FGAuxiliary::GetTotalTemperature);
+  PropertyManager->Tie("velocities/tat-c", this,
+                       &FGAuxiliary::GetTAT_C);
   PropertyManager->Tie("velocities/pt-lbs_sqft", this,
                        &FGAuxiliary::GetTotalPressure);
                      
@@ -257,6 +266,9 @@ void FGAuxiliary::unbind(void)
   PropertyManager->Untie("velocities/vc-kts");
   PropertyManager->Untie("velocities/ve-fps");
   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-y-ft_sec2");
   PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
@@ -275,6 +287,7 @@ void FGAuxiliary::GetState(void)
 {
   qbar = Translation->Getqbar();
   mach = Translation->GetMach();
+  machU= Translation->GetMachU();
   p = Atmosphere->GetPressure();
   rhosl = Atmosphere->GetDensitySL();
   psl = Atmosphere->GetPressureSL();
index b9701c4933f6c590f79fe8b27061c36d66f0cde3..a76976978234a1165b6143c38783d534d56dbfa5 100644 (file)
@@ -56,10 +56,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -67,10 +63,6 @@ CLASS DOCUMENTATION
 /** Encapsulates various uncategorized scheduled functions.
     @author Tony Peden, Jon Berndt
     @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:
   /** Constructor
       @param Executive a pointer to the parent executive object */
-  FGAuxiliary(FGFDMExec*);
+  FGAuxiliary(FGFDMExec* Executive);
   /// Destructor
   ~FGAuxiliary();
 
@@ -94,8 +86,10 @@ public:
   inline double GetVcalibratedKTS(void) const { return vcas*fpstokts; }
   inline double GetVequivalentFPS(void) const { return veas; }
   inline double GetVequivalentKTS(void) const { return veas*fpstokts; }
+  inline double GetMachU(void) const { return machU; }
   
   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
   // for supersonic it is the 1D total pressure behind a normal shock
@@ -118,7 +112,8 @@ private:
   double vcas;
   double veas;
   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!
 
index aaa032a31ce956a062524b2078d89ca5d175abc4..66111bc401448f6a9ce0162334710e1b52027f7a 100644 (file)
@@ -52,7 +52,7 @@ INCLUDES
 #include "FGPropertyManager.h"
 
 #ifndef FGFS
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iomanip.h>
 #  else
 #    include <iomanip>
index abd95e3c029a89bea813f4dcf3333ab65c7ccf01..01c6abb806337bc84401ecb1efc53a833606ca82 100644 (file)
@@ -75,13 +75,6 @@ class FGAuxiliary;
 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
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -92,10 +85,6 @@ CLASS DOCUMENTATION
     is called and the coefficient values are calculated.
     @author Jon S. Berndt
     @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.
       Non-dimensionalizing parameter descriptions are output
-      for each aero coefficient defined.
-      @param multipliers the list of multipliers for this coefficient.*/
+      for each aero coefficient defined. */
   virtual void DisplayCoeffFactors(void);
 
   /// Returns the name of the coefficient.
index 1fb89af1ac34e28ca1b492796f826ed36a7552d1..b2f41f82518c4c54de303e2fed8cef6ba195ded1 100644 (file)
@@ -33,14 +33,18 @@ INCLUDES
    SG_USING_STD(endl);
 #else
 #  include <string>
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <fstream.h>
-#    include <math.h>
 #    include <iostream.h>
+#    include <math.h>
 #  else
 #    include <fstream>
-#    include <cmath>
 #    include <iostream>
+#    if defined(sgi) && !defined(__GNUC__)
+#      include <math.h>
+#    else
+#      include <cmath>
+#    endif
      using std::ostream;
      using std::istream;
      using std::cerr;
@@ -65,7 +69,16 @@ FORWARD DECLARATIONS
 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
index 8ded42d3299d0c59982f6b84d28124994d497d7f..347efb372041e67cdcb0f0c3532bf6cd3ddf5983 100644 (file)
@@ -33,13 +33,17 @@ INCLUDES
    SG_USING_STD(endl);
 #else
 #  include <string>
-#  if defined (sgi) && !defined(__GNUC__)
+#  if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <fstream.h>
-#    include <math.h>
 #    include <iostream.h>
+#    include <math.h>
 #  else
 #    include <fstream>
+#  if defined (sgi) && !defined(__GNUC__)
+#    include <math.h>
+#  else
 #    include <cmath>
+#  endif
 #    include <iostream>
      using std::ostream;
      using std::istream;
@@ -65,7 +69,16 @@ FORWARD DECLARATIONS
 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
index c6c3832880ed5177a293b2c88347e706587179c9..8930caafd0af459284e5f093cc75a13cdc418ced 100644 (file)
@@ -32,7 +32,7 @@ CLASS IMPLEMENTATION
 
 FGConfigFile::FGConfigFile(string cfgFileName)
 {
-#if defined ( sgi ) && !defined( __GNUC__ )
+#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
   cfgfile.open(cfgFileName.c_str(), ios::in );
 #else
   cfgfile.open(cfgFileName.c_str(), ios::in | ios::binary );
@@ -40,7 +40,7 @@ FGConfigFile::FGConfigFile(string cfgFileName)
   CommentsOn = false;
   CurrentIndex = 0;
   Opened = true;
-#if defined ( sgi ) && !defined( __GNUC__ )
+#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
    if (!cfgfile.fail() && !cfgfile.eof())  GetNextConfigLine();
 #else
   if (cfgfile.is_open()) GetNextConfigLine();
@@ -214,7 +214,7 @@ string FGConfigFile::GetLine(void)
       }
     } else {
       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);
 #else
         if (test >= 0x20 || test == 0x09) cfgfile.unget();
index c13a65c94d00c884f722caa35c0ea84b12371647..d4d89422ade45af9bf98bb9689db558946b2b6d4 100644 (file)
@@ -53,7 +53,7 @@ INCLUDES
    SG_USING_STD(cout);
 #else
 #  include <string>
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <fstream.h>
 #    include <iostream.h>
 #  else
@@ -61,11 +61,11 @@ INCLUDES
 #    include <iostream>
      using std::ostream;
      using std::istream;
-     using std::ifstream;
      using std::ios;
      using std::cerr;
-     using std::endl;
      using std::cout;
+     using std::ifstream;
+     using std::endl;
 #  endif
     using std::string;
 #endif
@@ -84,10 +84,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -96,10 +92,6 @@ CLASS DOCUMENTATION
     JSBSim config files are in XML format.
     @author Jon S. Berndt
     @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; }
 
   /** Returns the value of the tag supplied.
-      @param 
-      @return */
-  string GetValue(string);
+      @param tag the tag for the value that is desired.
+      @return tthe value of the tag supplied.*/
+  string GetValue(string tag);
+
   string GetValue(void);
   string GetCommentString(void) {return CommentString;}
   string GetLineComment(void) {return LineComment;}
index e152719fc6a6df9f42704139cf65dc1cd2521176..06bb5b63476b4e20060a2e584a881519265053af 100644 (file)
@@ -46,7 +46,7 @@ INCLUDES
 #    include <fstream.h>
 #  endif
 #else
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <fstream.h>
 #  else
 #    include <fstream>
@@ -67,45 +67,40 @@ CLASS IMPLEMENTATION
 
 
 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);
 }
 
@@ -144,21 +139,24 @@ void FGEngine::ConsumeFuel(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double FGEngine::CalcFuelNeed(void) {
+double FGEngine::CalcFuelNeed(void)
+{
   FuelNeed = SLFuelFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
   return FuelNeed;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double FGEngine::CalcOxidizerNeed(void) {
+double FGEngine::CalcOxidizerNeed(void)
+{
   OxidizerNeed = SLOxiFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
   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;
   Y = y;
   Z = z;
index e213002f0f5207698cb614568f2271446a4cc409..13d657ea35c9f3256023e627182fb1030195c11b 100644 (file)
@@ -59,6 +59,7 @@ INCLUDES
 #endif
 
 #include "FGJSBBase.h"
+#include "FGPropertyManager.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -87,10 +88,6 @@ class FGPosition;
 class FGAuxiliary;
 class FGOutput;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -114,55 +111,22 @@ public:
 
   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  GetThrottleMax(void) { return MaxThrottle; }
   virtual double  GetThrottle(void) { return Throttle; }
   virtual double  GetMixture(void) { return Mixture; }
-  virtual int     GetMagnetos(void) { return Magnetos; }
   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 {
-    return FuelFlow_gph;
-  }
-
-  virtual double getManifoldPressure_inHg () const {
-    return ManifoldPressure_inHg;
-  }
-  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 double getFuelFlow_gph () const {return FuelFlow_gph;}
+  virtual double getFuelFlow_pph () const {return FuelFlow_pph;}
+  virtual double GetThrust(void) { return Thrust; }
+  virtual bool   GetStarved(void) { return Starved; }
+  virtual bool   GetRunning(void) { return Running; }
+  virtual bool   GetCranking(void) { return Cranking; }
 
   virtual void SetStarved(bool tt) { Starved = tt; }
   virtual void SetStarved(void)    { Starved = true; }
@@ -171,14 +135,7 @@ public:
   virtual void SetName(string name) { Name = name; }
   virtual void AddFeedTank(int tkID);
 
-  virtual void SetMagnetos(int m) { Magnetos = m; }
   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.
       @param PowerRequired this is the power required to run the thrusting device
@@ -218,6 +175,7 @@ public:
   virtual void SetTrimMode(bool state) {TrimMode = state;}
 
 protected:
+  FGPropertyManager* PropertyManager;
   string Name;
   EngineType Type;
   double X, Y, Z;
@@ -231,38 +189,18 @@ protected:
   double Thrust;
   double Throttle;
   double Mixture;
-  int   Magnetos;
+  double FuelNeed;
+  double OxidizerNeed;
+  double PctPower;
+  int   EngineNumber;
   bool  Starter;
-  double FuelNeed, OxidizerNeed;
   bool  Starved;
-  bool  Flameout;
   bool  Running;
   bool  Cranking;
-  double PctPower;
-  int   EngineNumber;
   bool  TrimMode;
 
   double FuelFlow_gph;
-  double ManifoldPressure_inHg;
-  double ExhaustGasTemp_degK;
-  double CylinderHeadTemp_degK;
-  double OilPressure_psi;
-  double OilTemp_degK;
-
   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;
   FGState*        State;
@@ -277,7 +215,7 @@ protected:
   FGOutput*       Output;
 
   vector <int> SourceTanks;
-  virtual void Debug(int from);
+  void Debug(int from);
 };
 }
 #include "FGState.h"
index c2f560b47254fb0152e6e57bded32ed85de9bdef..1d7e484cffdb68616c995316d97fd7a58fdfd5f0 100644 (file)
@@ -70,18 +70,12 @@ namespace JSBSim {
 typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf, NNorm } FcIdx;
 typedef enum { ofRad=0, ofNorm, ofMag , NForms} OutputForm;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Encapsulates the Flight Control System (FCS) functionality.
-    <ul><li>\URL[Source Code]{FGFCS.cpp.html}</li>
-    <li>\URL[Header File]{FGFCS.h.html}</li></ul>
-    This class owns and contains the list of \URL[components]{FGFCSComponent.html}
+    This class owns and contains the list of FGFCSComponents
     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
     or command and ends at an effector, e.g. an aerosurface. The FCS components
@@ -152,10 +146,6 @@ CLASS DOCUMENTATION
     @see FGGradient
     @see FGFilter
     @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>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 401645d0fcca129013f74cd4017b0c6865775744..b8231016cf71f250d0e1d0e17a43d9acd2b32864 100644 (file)
@@ -46,7 +46,7 @@ INCLUDES
 #  include STL_IOSTREAM
 #  include STL_ITERATOR
 #else
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #  else
 #    include <iostream>
@@ -500,6 +500,7 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
   scratch = AC_cfg->GetValue("VERSION").c_str();
 
   CFGVersion = AC_cfg->GetValue("VERSION");
+  Release    = AC_cfg->GetValue("RELEASE");
 
   if (debug_lvl > 0)
     cout << "                            Version: " << highint << CFGVersion
@@ -511,6 +512,25 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
     cerr << "         You have version: " << CFGVersion << endl << fgdef << endl;
     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;
 }
index a89ffbd26ac7e192579794057edc5d7589205070..0be0ff8d1abc69bffaffed61951dbd461916f398 100644 (file)
@@ -46,8 +46,8 @@ INCLUDES
 #include "FGJSBBase.h"
 #include "FGPropertyManager.h"
 
-
 #include <vector>
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -60,23 +60,12 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Encapsulates the JSBSim simulation executive.
-    @author Jon S. Berndt
-    @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
+    This class is the interface class through which all other simulation classes
     are instantiated, initialized, and run. When integrated with FlightGear (or
     other flight simulator) this class is typically instantiated by an interface
     class on the simulator side.
@@ -109,6 +98,8 @@ CLASS DOCUMENTATION
        a message is printed out when they go out of bounds</li>
     </ol>
 
+    @author Jon S. Berndt
+    @version $Id$
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -178,20 +169,20 @@ public:
   
 
   /** 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"
   */
   bool SetEnginePath(string path)   { EnginePath = path; return true; }
 
   /** 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
       modeled aircraft such as C172/, x15/, etc.
   */
   bool SetAircraftPath(string path) { AircraftPath = path; return true; }
   
   /** 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".
   */
   bool SetControlPath(string path) { ControlPath = path; return true; }
@@ -285,6 +276,7 @@ private:
   string ControlPath;
   
   string CFGVersion;
+  string Release;
 
   FGState*           State;
   FGAtmosphere*      Atmosphere;
index ebf1da9a6d7d26ff8ced04c7c7df6ac05d0d0220..883ea783e3a40876f457ffc2962aff419bd6b393 100644 (file)
@@ -51,7 +51,7 @@ INCLUDES
 #include "FGFDMExec.h"
 
 #ifndef FGFS
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iomanip.h>
 #  else
 #    include <iomanip>
index cbed19b3d6737cb33163edc1b4ebd16dda370ea8..d4fb17de7332bef2d7f4e7c855908e2a95630237 100644 (file)
@@ -76,21 +76,12 @@ class FGAuxiliary;
 class FGOutput;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** This class encapsulates the functionality needed to manage a factor group
     i.e. factor*(coeff1 + coeff2 + coeff3)
     @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>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 08560e9910965bbb23aa273052d560d79740e1f6..40911af8684457853d353488ce594e5799913f3a 100644 (file)
@@ -57,8 +57,6 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_FORCE "$Id$"
-
 #include "FGFDMExec.h"
 #include "FGJSBBase.h"
 #include "FGMatrix33.h"
@@ -66,15 +64,17 @@ INCLUDES
 #include "FGColumnVector4.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-FORWARD DECLARATIONS
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-namespace JSBSim {
+#define ID_FORCE "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index fc3a7f3fad4f3b236fdb65a7f93387edf40366b7..1a34dae3b049588ca3b51b85d15f7ae1e95cb35a 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 09/13/00   JSB   Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -61,8 +57,19 @@ INCLUDES
 
 #define ID_GROUNDREACTIONS "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Manages ground reactions modeling.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -83,11 +90,10 @@ public:
   string GetGroundReactionValues(void);
   
   inline int GetNumGearUnits(void) const { return lGear.size(); }
+
   /** Gets a gear instance
       @param gear index of gear instance
       @return a pointer to the FGLGear instance of the gear unit requested */
-  
-  
   inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); }
   
   void bind(void);
index 6e2f4bc11e8c85bf851d47a491e2f4512709a59c..93073690c45cd441c816bffb5dcce41f87a64a98 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 09/13/00   JSB   Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -59,10 +55,25 @@ INCLUDES
 #include "FGColumnVector3.h"
 #include "FGColumnVector4.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_INERTIAL "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models inertial forces (e.g. centripetal and coriolis accelerations).
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index c83838e45596950f447c8aa05c388ef404a88145..25f2c43ffabc04e328bc4b39839fdb11c3d9b4a1 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  Header:       FGInitialCondition.h
  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,
 you have chosen your IC's wisely) even after setting it up with this class.
  
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGINITIALCONDITION_H
 #define FGINITIALCONDITION_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGFDMExec.h"
 #include "FGJSBBase.h"
@@ -60,18 +60,14 @@ DEFINITIONS
 
 #define ID_INITIALCONDITION "$Id$"
 
-namespace JSBSim {
-
-typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
-typedef enum { setwned, setwmd, setwhc } windset; 
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
+
+typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
+typedef enum { setwned, setwmd, setwhc } windset; 
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -89,9 +85,7 @@ CLASS DOCUMENTATION
    FGInitialCondition fgic=new FGInitialCondition(FDMExec);
    fgic->SetVcalibratedKtsIC()
    fgic->SetAltitudeFtIC();
-   .
-   .
-   .
+
    //to directly into Run
    FDMExec->GetState()->Initialize(fgic)
    delete fgic;
@@ -102,36 +96,32 @@ CLASS DOCUMENTATION
    
    Speed:
    
-        Since vc, ve, vt, and mach all represent speed, the remaining
-        three are recalculated each time one of them is set (using the
-        current altitude).  The most recent speed set is remembered so 
-        that if and when altitude is reset, the last set speed is used 
-        to recalculate the remaining three. Setting any of the body 
-        components forces a recalculation of vt and vt then becomes the
-        most recent speed set.
+   Since vc, ve, vt, and mach all represent speed, the remaining
+   three are recalculated each time one of them is set (using the
+   current altitude).  The most recent speed set is remembered so 
+   that if and when altitude is reset, the last set speed is used 
+   to recalculate the remaining three. Setting any of the body 
+   components forces a recalculation of vt and vt then becomes the
+   most recent speed set.
    
    Alpha,Gamma, and Theta:
    
    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
    alpha and theta and alpha is favored when setting gamma. i.e.
    
-       set alpha : recalculate theta using gamma as currently set
-                 set theta : recalculate alpha using gamma as currently set
-                 set gamma : recalculate theta using alpha as currently set
+   - set alpha : recalculate theta using gamma as currently set
+   - set theta : recalculate alpha using gamma as currently set
+   - set gamma : recalculate theta using alpha as currently set
  
-        The idea being that gamma is most interesting to pilots (since it 
-        is indicative of climb rate). 
-        
-        Setting climb rate is, for the purpose of this discussion, 
-        considered equivalent to setting gamma.
-   @author Anthony K. Peden
-   @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>
+   The idea being that gamma is most interesting to pilots (since it 
+   is indicative of climb rate). 
+   
+   Setting climb rate is, for the purpose of this discussion, 
+   considered equivalent to setting gamma.
+   @author Tony Peden
+   @version "$Id$"
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index fa2da135907fc277e9496a7af64852fd3e28c87b..f191791a5d7bd78dbac1804ad01adc24e3b72ced 100644 (file)
@@ -69,7 +69,7 @@ const double FGJSBBase::in3tom3 = 1.638706E-5;
 const double FGJSBBase::Reng = 1716.0;
 const double FGJSBBase::SHRatio = 1.40;
 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;
 FGJSBBase::Message FGJSBBase::localMsg;
index 9c29ab0ebdea85220c1089d8eb199c6a7e5539fb..8ca173d2ba16a3c37f0eca2d2e0e5a49830a051f 100644 (file)
@@ -79,8 +79,8 @@ using std::max;
 
 static char *gcvt(double number, size_t ndigit, char *buf)
 {
-     sprintf(buf, "%f", number);
-     return buf;
+  sprintf(buf, "%f", number);
+  return buf;
 }
 #endif
 
@@ -96,10 +96,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -216,6 +212,13 @@ public:
   void disableHighLighting(void);
 
   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:
   static Message localMsg;
index 49d29ed0a28a78a953af59ef5f326dba2f0ab328..fb374821114175f67ff5fc85a50690c4865f83bf 100644 (file)
@@ -39,7 +39,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGLGear.h"
-#include <algorithm>
+//#include <algorithm>
 
 namespace JSBSim {
 
@@ -208,7 +208,9 @@ FGColumnVector3& FGLGear::Force(void)
 {
   double SteerGain = 0;
   double SinWheel, CosWheel;
-  double deltaT;
+  double deltaSlip;
+  double deltaT = State->Getdt()*Aircraft->GetRate();
+  double maxdeltaSlip = 0.5*deltaT;
 
   vForce.InitMatrix();
   vMoment.InitMatrix();
@@ -250,7 +252,7 @@ FGColumnVector3& FGLGear::Force(void)
 
     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
 // including the strut compression and not vWhlBodyVec.  Will fix this later.
@@ -300,30 +302,26 @@ FGColumnVector3& FGLGear::Force(void)
 
       switch (eBrakeGrp) {
       case bgLeft:
-        SteerGain = 0.10;
-        BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) +
+         BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) +
                         staticFCoeff*FCS->GetBrake(bgLeft) );
         break;
       case bgRight:
-        SteerGain = 0.10;
         BrakeFCoeff =  ( rollingFCoeff*(1.0 - FCS->GetBrake(bgRight)) +
                          staticFCoeff*FCS->GetBrake(bgRight) );
         break;
       case bgCenter:
-        SteerGain = 0.10;
         BrakeFCoeff =  ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
                          staticFCoeff*FCS->GetBrake(bgCenter) );
         break;
       case bgNose:
-        SteerGain = -0.50;
-        BrakeFCoeff =  rollingFCoeff;
+        BrakeFCoeff =  ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
+                         staticFCoeff*FCS->GetBrake(bgCenter) );
         break;
       case bgTail:
-        SteerGain = -0.10;
-        BrakeFCoeff =  rollingFCoeff;
+        BrakeFCoeff =  ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
+                         staticFCoeff*FCS->GetBrake(bgCenter) );
         break;
       case bgNone:
-        SteerGain = 0.0;
         BrakeFCoeff =  rollingFCoeff;
         break;
       default:
@@ -333,7 +331,7 @@ FGColumnVector3& FGLGear::Force(void)
 
       switch (eSteerType) {
       case stSteer:
-        SteerAngle = SteerGain*FCS->GetDrCmd()*0.349; // 20 deg
+        SteerAngle = -maxSteerAngle * FCS->GetDrCmd() * 0.01745; 
         break;
       case stFixed:
         SteerAngle = 0.0;
@@ -360,18 +358,34 @@ FGColumnVector3& FGLGear::Force(void)
 
       if (RollingWhlVel == 0.0 && SideWhlVel == 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;
       } else {
         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) ||
           (WheelSlip > 0.0 && lastWheelSlip < 0.0))
       {
         WheelSlip = 0.0;
       }
-      
+*/    
       lastWheelSlip = WheelSlip;
 
 // Compute the sideforce coefficients using similar assumptions to LaRCSim for now.
@@ -433,7 +447,7 @@ FGColumnVector3& FGLGear::Force(void)
       vForce  = State->GetTl2b() * vLocalForce;
       vMoment = vWhlBodyVec * vForce;
 
-    } else {
+    } else { // Gear is NOT compressed
 
       WOW = false;
 
@@ -448,8 +462,6 @@ FGColumnVector3& FGLGear::Force(void)
       compressLength = 0.0; // reset compressLength to zero for data output validity
     }
 
-    deltaT = State->Getdt()*Aircraft->GetRate();
-
     if (FirstContact) LandingDistanceTraveled += Position->GetVground()*deltaT;
   
     if (StartedGroundRun) {
index 5e746a804d3d60899d7d4f1a19ea8346fc19d420..397892b856a2db6a920f72add1fa4045e1a5f4bd 100644 (file)
@@ -70,10 +70,6 @@ class FGState;
 class FGMassBalance;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -171,10 +167,6 @@ CLASS DOCUMENTATION
           Wiley & Sons, 1979 ISBN 0-471-03032-5
     @see W. A. Ragsdale, "A Generic Landing Gear Dynamics Model for LASRS++",
      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>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 2ca2b17f18adbe59c8804bef7ddde34a8d12ec41..a81d7c665965eccb0127a291344dc8688680568a 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 09/12/2000  JSB  Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -46,10 +42,25 @@ INCLUDES
 #include "FGPropulsion.h"
 #include <vector>
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_MASSBALANCE "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONSS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models weight and balance information.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index e43e4f0c6f2ec1ebd52e03422da3f19b8862da52..6a04049b2f54fe2f4223595218dcedfc56baf0a6 100644 (file)
@@ -35,13 +35,18 @@ INCLUDES
    SG_USING_STD(endl);
 #else
 #  include <string>
-#  if defined(sgi) && !defined(__GNUC__)
-#    include <fstream.h>
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
+     include <fstream.h>
+     include <iostream.h>
 #    include <math.h>
-#    include <iostream.h>
 #  else
 #    include <fstream>
-#    include <cmath>
+#    include <iostream>
+#    if defined(sgi) && !defined(__GNUC__)
+#      include <math.h>
+#    else
+#      include <cmath>
+#    endif
 #    include <iostream>
      using std::ostream;
      using std::istream;
@@ -69,6 +74,13 @@ namespace JSBSim {
 
 class FGColumnVector3;
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Exception convenience class.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DECLARATION: MatrixException
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -79,6 +91,13 @@ public:
   string Message;
 };
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Handles matrix math operations.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DECLARATION: FGMatrix33
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 6cd7a82950bc14b35cf9627c1ba12830a3258e06..10501c66d0b2a8d3ed49aa2a7a648b8aff011cc2 100644 (file)
@@ -49,7 +49,7 @@ INCLUDES
 #    include <iostream.h>
 #  endif
 #else
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #  else
 #    include <iostream>
@@ -58,12 +58,12 @@ INCLUDES
 
 #include <string>
 
-#define ID_MODEL "$Id$"
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#define ID_MODEL "$Id$"
+
 using namespace std;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -89,20 +89,12 @@ class FGAuxiliary;
 class FGOutput;
 class FGConfigFile;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Base class for all scheduled JSBSim models
     @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>
   */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index d46a622b75f7013f2b46709b6df63e621adad379..12ca06aa10aa7785af8df811391d7bd5c4e84acc 100644 (file)
@@ -70,6 +70,7 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMEx
   }
 
   Thrust = 0;
+  ReverserAngle = 0.0;
   Type = ttNozzle;
   Area2 = (Diameter*Diameter/4.0)*M_PI;
   AreaT = Area2/ExpR;
@@ -90,7 +91,7 @@ double FGNozzle::Calculate(double CfPc)
 {
   double pAtm = fdmex->GetAtmosphere()->GetPressure();
   Thrust = max((double)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
-  vFn(1) = Thrust;
+  vFn(1) = Thrust * cos(ReverserAngle);
 
   return Thrust;
 }
index 7f92fffffa550d1092c6056606d6abe1876fc8b5..c02e9c5b22fc2f6fe043a7a48e898813ebecff44 100644 (file)
@@ -52,19 +52,13 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** 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">
-         Header File </a>
-    @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>
+    @author Jon S. Berndt
+    @version $Id$
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -83,6 +77,7 @@ public:
   double GetPowerRequired(void);
   
 private:
+  double ReverserAngle;
   double PE;
   double ExpR;
   double nzlEff;
index 664c4f4859d245d9e37631cd75f54f8854f9b21d..70d13ee8241a56bdd7366bc5cc0440eacacebc13 100644 (file)
@@ -45,7 +45,7 @@ INCLUDES
 #  include STL_IOSTREAM
 #  include STL_FSTREAM
 #else
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #    include <fstream.h>
 #  else
@@ -56,10 +56,25 @@ INCLUDES
 
 #include "FGfdmSocket.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_OUTPUT "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Handles simulation output.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index e0907230a9fb6139b71d366c18cddfee530b156b..c95a86e6066556a7081aac271f88b49290486682 100644 (file)
@@ -60,13 +60,6 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
 {
   string token;
 
-  MinManifoldPressure_inHg = 6.5;
-  MaxManifoldPressure_inHg = 28.5;
-  Displacement = 360;
-  MaxHP = 200;
-  Cycles = 2;
-  IdleRPM = 600;
-
   Name = Eng_cfg->GetValue("NAME");
   Eng_cfg->GetNextConfigLine();
   while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
@@ -86,7 +79,17 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
   crank_counter = 0;
   EngineNumber = 0;
   OilTemp_degK = 298;
+  MinManifoldPressure_inHg = 6.5;
+  MaxManifoldPressure_inHg = 28.5;
   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();
 
@@ -150,7 +153,8 @@ double FGPiston::Calculate(double PowerRequired)
   p_amb_sea_level = Atmosphere->GetPressureSL() * 48;
   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();
 
@@ -334,29 +338,34 @@ void FGPiston::doFuelFlow(void)
 void FGPiston::doEnginePower(void)
 {
   ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
+
   if (Running) {       
     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;
-    double T_amb_degF = (T_amb * 1.8) - 459.67;
-    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);
+    Percentage_Power += ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
+
     double Percentage_of_best_power_mixture_power =
       Power_Mixture_Correlation->GetValue(14.7 / equivalence_ratio);
-    Percentage_Power =
-      Percentage_Power * Percentage_of_best_power_mixture_power / 100.0;
-    if (Percentage_Power < 0.0)
-      Percentage_Power = 0.0;
-    else if (Percentage_Power > 100.0)
-      Percentage_Power = 100.0;
+
+    Percentage_Power *= Percentage_of_best_power_mixture_power / 100.0;
+
+    if (Percentage_Power < 0.0) Percentage_Power = 0.0;
+    else if (Percentage_Power > 100.0) Percentage_Power = 100.0;
+    
     HP = Percentage_Power * MaxHP / 100.0;
-  } else {  
+
+  } else {
+
     // Power output when the engine is not running
     if (Cranking) {
       if (RPM < 10) {
-        HP = 3.0;      // This is a hack to prevent overshooting the idle rpm in the first time step
-                    // It may possibly need to be changed if the prop model is changed.
+        HP = 3.0;   // This is a hack to prevent overshooting the idle rpm in
+                    // the first time step. It may possibly need to be changed
+                    // if the prop model is changed.
       } else if (RPM < 480) {
         HP = 3.0 + ((480 - RPM) / 10.0);  
         // This is a guess - would be nice to find a proper starter moter torque curve
index 2b14104d1cbb0920f3903e4377e55faeb09834ab..caf97eb939898279046bc49a5720be169ac15326 100644 (file)
@@ -28,10 +28,6 @@ HISTORY
 09/12/2000  JSB  Created
 10/01/2001  DPM  Modified to use equations from Dave Luff's piston model.
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -60,22 +56,14 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DOCUMENTATION
+CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** 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 Dave Luff (engine operational code)
     @author David Megginson (porting and additional code)
-    @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>
+    @version "$Id$"
   */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -94,6 +82,18 @@ public:
   double GetPowerAvailable(void) {return PowerAvailable;}
   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:
   int crank_counter;
 
@@ -147,12 +147,13 @@ private:
   double T_amb;              // degrees Kelvin
   double RPM;                // revolutions per minute
   double IAS;                // knots
+  bool Magneto_Left;
+  bool Magneto_Right;
+  int Magnetos;
 
   //
   // Outputs (in addition to those in FGEngine).
   //
-  bool Magneto_Left;
-  bool Magneto_Right;
   double rho_air;
   double volumetric_efficiency;
   double m_dot_air;
@@ -161,6 +162,12 @@ private:
   double Percentage_Power;
   double HP;
   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);
 };
index b13c110100205c01d7a3b44dd74751c9892643ce..a003cc18970db725e36159d8abd51f003ef0b558 100644 (file)
@@ -65,7 +65,11 @@ INCLUDES
 #else
 #  if defined(sgi) && !defined(__GNUC__)
 #    include <math.h>
-#    include <iomanip.h>
+#    if (_COMPILER_VERSION < 740)
+#      include <iomanip.h>
+#    else
+#      include <iomanip>
+#    endif
 #  else
 #    include <cmath>
 #    include <iomanip>
@@ -104,13 +108,16 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex)
   Name = "FGPosition";
   LongitudeDot = LatitudeDot = RadiusDot = 0.0;
   
-  for (int i=0;i<3;i++) {
+  for (int i=0;i<4;i++) {
     LatitudeDot_prev[i]  = 0.0;
     LongitudeDot_prev[i] = 0.0;
     RadiusDot_prev[i]    = 0.0;
   }
-  
+
+  vVRPoffset.InitMatrix();
+
   Longitude = Latitude = 0.0;
+  LongitudeVRP = LatitudeVRP = 0.0;
   gamma = Vt = Vground = 0.0;
   hoverbmac = hoverbcg = 0.0;
   psigt = 0.0;
@@ -155,7 +162,6 @@ bool FGPosition::Run(void)
 {
   double cosLat;
   double hdot_Vt;
-  FGColumnVector3 vMac;
 
   if (!FGModel::Run()) {
     GetState();
@@ -178,6 +184,23 @@ bool FGPosition::Run(void)
 
     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
     
     hoverbcg = DistanceAGL/b;
index 24444e419e8665d36385db4dad857a8846641172..bac37730af727003cb207cf0e80eff64d6a3ba6c 100644 (file)
@@ -56,20 +56,12 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DOCUMENTATION
+CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Models the lateral and longitudinal translational EOM.
     @author Jon S. Berndt
     @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:
   /** Constructor
       @param Executive a pointer to the parent executive object */
-  FGPosition(FGFDMExec*);
+  FGPosition(FGFDMExec* Executive);
 
   /// Destructor
   ~FGPosition();
@@ -100,10 +92,13 @@ public:
   inline double GetVground(void) const { return Vground; }
   inline double GetGroundTrack(void) const { return psigt; }
   inline double Geth(void)  const { return h; }
+  inline double GethVRP(void)  const { return hVRP; }
   inline double Gethdot(void) const { return RadiusDot; }
   inline double GetLatitude(void) const { return Latitude; }
+  inline double GetLatitudeVRP(void) const { return LatitudeVRP; }
   inline double GetLatitudeDot(void) const { return LatitudeDot; }
   inline double GetLongitude(void) const { return Longitude; }
+  inline double GetLongitudeVRP(void) const { return LongitudeVRP; }
   inline double GetLongitudeDot(void) const { return LongitudeDot; }
   inline double GetRunwayRadius(void) const { return RunwayRadius; }
   inline double GetDistanceAGL(void)  const { return DistanceAGL; }
@@ -124,6 +119,7 @@ public:
   inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
       vRunwayNormal << fgx << fgy << fgz;
   }
+  void SetVRP(FGColumnVector3& vrp) {vVRP = vrp;}
   
   void bind(void);
   void unbind(void);
@@ -132,11 +128,15 @@ private:
   FGColumnVector3 vVel;
   FGColumnVector3 vVelDot;
   FGColumnVector3 vRunwayNormal;
+  FGColumnVector3 vVRP;
+  FGColumnVector3 vVRPoffset;
+  FGColumnVector3 vMac;
   
-  double Radius, h;
+  double Radius, h, hVRP;
   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 LongitudeVRP, LatitudeVRP;
   double dt;
   double RunwayRadius;
   double DistanceAGL;
index 6dff5c58783e8db3b1cb0bd0bbf4a63185b577d0..da3fbd41d5a80847342fb8950d0cbafcc78a2231 100644 (file)
@@ -58,6 +58,7 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
   int rows, cols;
 
   MaxPitch = MinPitch = P_Factor = Sense = Pitch = 0.0;
+  GearRatio = 1.0;
 
   Name = Prop_cfg->GetValue("NAME");
   Prop_cfg->GetNextConfigLine();
@@ -70,6 +71,8 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
       Diameter /= 12.0;
     } else if (token == "NUMBLADES") {
       *Prop_cfg >> numBlades;
+    } else if (token == "GEARRATIO") {
+      *Prop_cfg >> GearRatio;
     } else if (token == "MINPITCH") {
       *Prop_cfg >> MinPitch;
     } else if (token == "MAXPITCH") {
@@ -176,7 +179,7 @@ double FGPropeller::Calculate(double PowerAvailable)
 
   if (omega <= 5) omega = 1.0;
 
-  ExcessTorque = PowerAvailable / omega;
+  ExcessTorque = PowerAvailable / omega * GearRatio;
   RPM = (RPS + ((ExcessTorque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
 
                                // The friction from the engine should
@@ -217,7 +220,7 @@ double FGPropeller::GetPowerRequired(void)
       else if (Pitch > MaxPitch)  Pitch = MaxPitch;
 
     } else {
-      Pitch = MaxPitch - (MaxPitch - MinPitch) * advance;
+      Pitch = MinPitch + (MaxPitch - MinPitch) * advance;
     }
     cPReq = cPower->GetValue(J, Pitch);
   }
index eec3e2d42186ac5c2a59b8837a87a5f6885f1e7f..8d905772cd04c142fe804451cc6ed8d7aadf4e3d 100644 (file)
@@ -55,10 +55,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -83,10 +79,6 @@ CLASS DOCUMENTATION
     @see FGEngine
     @see FGThruster
     @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>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index ae942e7d44a9917befcd51748b6411975cf0f323..84eb466566d516fd5d9a859ccce6cbb45be3d4cd 100644 (file)
@@ -126,7 +126,7 @@ string FGPropertyManager::GetFullyQualifiedName(void) {
     }
     fqname+= stack[0];
     return fqname;  
-       
+
 }    
     
     
index a492a9df3d43ba692fa12ee150937bd55257a60b..5e2ee49453abcc92ce99c472cfd255bef8f12740 100644 (file)
@@ -53,19 +53,11 @@ using namespace std;
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Class wrapper for property handling.
     @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);
 
 
-                                   // Templates cause ambiguity here
+        // Templates cause ambiguity here
 
     /**
      * Tie a property to an external bool variable.
@@ -508,9 +500,11 @@ class FGPropertyManager : public SGPropertyNode {
                                               bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
-                                    useDefault))
+         useDefault))
+      {
         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)
     {
       if (!tie(name.c_str(),
-                                    SGRawValueFunctionsIndexed<V>(index,
-                                                                  getter,
-                                                                  setter),
-                                    useDefault))
+           SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
+      {
         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)
     {
       if (!tie(name.c_str(),
-                                SGRawValueMethods<T,V>(*obj, getter, setter),
-                                useDefault))
+             SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
+      {
         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)
     {
       if (!tie(name.c_str(),
-                                SGRawValueMethodsIndexed<T,V>(*obj,
-                                                              index,
-                                                              getter,
-                                                              setter),
-                                useDefault))
+          SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
+      {
         cout <<
-          "Failed to tie property " << name << " to indexed object methods" << endl;
+         "Failed to tie property " << name << " to indexed object methods" << endl;
+      }
    }
 };                                                                                       
 }
index 41f49e02b569b89cd79786c049d64e33d05489db..7596fa538b59a1aea6037efa9027b3383eac0aff 100644 (file)
@@ -79,12 +79,15 @@ CLASS IMPLEMENTATION
 FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec)
 {
   Name = "FGPropulsion";
+
   numSelectedFuelTanks = numSelectedOxiTanks = 0;
   numTanks = numEngines = numThrusters = 0;
   numOxiTanks = numFuelTanks = 0;
   dt = 0.0;
   ActiveEngine = -1; // -1: ALL, 0: Engine 1, 1: Engine 2 ...
+
   bind();
+
   Debug(0);
 }
 
@@ -381,6 +384,8 @@ string FGPropulsion::GetPropulsionStrings(void)
     case FGEngine::etTurbine:
       break;
     case FGEngine::etSimTurbine:
+      PropulsionStrings += (Engines[i]->GetName() + "_N1[" + buffer + "], ");
+      PropulsionStrings += (Engines[i]->GetName() + "_N2[" + buffer + "]");
       break;
     default:
       PropulsionStrings += "INVALID ENGINE TYPE";
@@ -406,6 +411,9 @@ string FGPropulsion::GetPropulsionStrings(void)
         PropulsionStrings += (Thrusters[i]->GetName() + "_Pitch[" + buffer + "], ");
       PropulsionStrings += (Thrusters[i]->GetName() + "_RPM[" + buffer + "]");
       break;
+    case FGThruster::ttDirect:
+      PropulsionStrings += (Thrusters[i]->GetName() + "_Thrust[" + buffer + "]");
+      break;
     default:
       PropulsionStrings += "INVALID THRUSTER TYPE";
       break;
@@ -437,6 +445,8 @@ string FGPropulsion::GetPropulsionValues(void)
     case FGEngine::etTurbine:
       break;
     case FGEngine::etSimTurbine:
+      PropulsionValues += (string(gcvt(((FGSimTurbine*)Engines[i])->GetN1(), 10, buff))) + ", ";
+      PropulsionValues += (string(gcvt(((FGSimTurbine*)Engines[i])->GetN2(), 10, buff)));
       break;
     }
 
@@ -448,6 +458,9 @@ string FGPropulsion::GetPropulsionValues(void)
       break;
     case FGThruster::ttRotor:
       break;
+    case FGThruster::ttDirect:
+      PropulsionValues += (string(gcvt(((FGThruster*)Thrusters[i])->GetThrust(), 10, buff)));
+      break;
     case FGThruster::ttPropeller:
       FGPropeller* Propeller = (FGPropeller*)Thrusters[i];
       FGColumnVector3 vPFactor = Propeller->GetPFactor();
@@ -564,12 +577,12 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
 
 void FGPropulsion::SetMagnetos(int setting)
 {
-  if (ActiveEngine == -1) {
+  if (ActiveEngine < 0) {
     for (unsigned i=0; i<Engines.size(); i++) {
-      Engines[i]->SetMagnetos(setting);
+      ((FGPiston*)Engines[i])->SetMagnetos(setting);
     }
   } else {
-    Engines[ActiveEngine]->SetMagnetos(setting);
+    ((FGPiston*)Engines[ActiveEngine])->SetMagnetos(setting);
   }
 }
 
@@ -577,9 +590,12 @@ void FGPropulsion::SetMagnetos(int setting)
 
 void FGPropulsion::SetStarter(int setting)
 {
-  if (ActiveEngine == -1) {
+  if (ActiveEngine < 0) {
     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 {
     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)
 {
-  if ( unsigned(engine) > Engines.size())
+  if (engine >= Engines.size() || engine < 0)
     ActiveEngine = -1;
   else
     ActiveEngine = engine;
@@ -605,28 +640,14 @@ void FGPropulsion::bind(void)
 {
   typedef double (FGPropulsion::*PMF)(int) 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,
-                       (iPMF)0,
-                       &FGPropulsion::SetMagnetos,
-                       true);
+                       (iPMF)0, &FGPropulsion::SetMagnetos, true);
   PropertyManager->Tie("propulsion/starter_cmd", this,
-                       (iPMF)0,
-                       &FGPropulsion::SetStarter,
-                       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);
+                       (iPMF)0, &FGPropulsion::SetStarter,  true);
+  PropertyManager->Tie("propulsion/cutoff_cmd", this,
+                       (iPMF)0, &FGPropulsion::SetCutoff,   true);
+
   PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
                        (PMF)&FGPropulsion::GetForces);
   PropertyManager->Tie("forces/fby-prop-lbs", this,2,
@@ -639,20 +660,18 @@ void FGPropulsion::bind(void)
                        (PMF)&FGPropulsion::GetMoments);
   PropertyManager->Tie("moments/n-prop-lbsft", this,3,
                        (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)
 {
-  /* 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/starter_cmd");
+  PropertyManager->Untie("propulsion/cutoff_cmd");
   PropertyManager->Untie("propulsion/active_engine");
   PropertyManager->Untie("forces/fbx-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/m-prop-lbsft");
   PropertyManager->Untie("moments/n-prop-lbsft");
-  //PropertyManager->Untie("propulsion/tanks-weight-lbs");
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index b262e5415a4987faf884702cef5a3b8c8dab8c7a..e392fc3d8f66c2b0bfb584cbb0cf2350b1685ec6 100644 (file)
@@ -74,27 +74,33 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Propulsion management class.
-    FGPropulsion manages all aspects of propulsive force generation, including
-    containment of engines, tanks, and thruster class instances in STL vectors,
-    and the interaction and communication between them.
+    The Propulsion class is the container for the entire propulsion system, which is
+    comprised of engines, tanks, and "thrusters" (the device that transforms the
+    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
     @version $Id$
-    @see FGEngine
-    @see FGTank
-    @see FGThruster
-    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.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/FGPropulsion.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
-         Source File </a>
+    @see
+    FGEngine
+    FGTank
+    FGThruster
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -144,7 +150,7 @@ public:
                       if (index <= Engines.size()-1) return Engines[index];
                       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();}
 
   /** Retrieves a tank object pointer from the list of tanks.
@@ -192,9 +198,17 @@ public:
   double GetTanksIzz(const FGColumnVector3& vXYZcg);
   double GetTanksIxz(const FGColumnVector3& vXYZcg);
   double GetTanksIxy(const FGColumnVector3& vXYZcg);
-  
+
+  inline int GetActiveEngine(void) const
+  {
+    return ActiveEngine;
+  }
+
+  inline int GetActiveEngine(void);
+
   void SetMagnetos(int setting);
   void SetStarter(int setting);
+  void SetCutoff(int setting=0);
   void SetActiveEngine(int engine);
   
   void bind();
index b786bc4ed7baae3b424bfde0359bb9f804f11167..f2c7fb3775ee8b5d0567870fe48725c68a40a48d 100644 (file)
@@ -73,6 +73,7 @@ FGRocket::FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec)
 
   EngineNumber = 0;
   Type = etRocket;
+  Flameout = false;
 
   PC = 0.0;
   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);
 }
@@ -91,7 +92,7 @@ double FGRocket::Calculate(double pe)
 {
   double Cf=0;
 
-  ConsumeFuel();
+  if (!Flameout && !Starved) ConsumeFuel();
 
   Throttle = FCS->GetThrottlePos(EngineNumber);
 
index 79d5cce49271ca8b9eedb48f343d3fd780e234a8..b9b3dc80422323c6467dded52fe7d9ecf24480e0 100644 (file)
@@ -53,10 +53,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -70,9 +66,9 @@ CLASS DOCUMENTATION
         <li>Variance (in percent, from 0 to 1.0, nominally 0.05)</li>
     </ul>
     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>
-        <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>Minimum working throttle setting</li>
         <li>Sea level fuel flow at maximum thrust</li>
@@ -89,17 +85,13 @@ CLASS DOCUMENTATION
     determined.
 
     @author Jon S. Berndt
-    @version $Id$
-    @see FGNozzle
-    @see FGThruster
-    @see FGForce
-    @see FGEngine
-    @see FGPropulsion
-    @see 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>
+    $Id$
+    @see FGNozzle,
+    FGThruster,
+    FGForce,
+    FGEngine,
+    FGPropulsion,
+    FGTank
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -115,7 +107,7 @@ public:
   FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg);
 
   /** Destructor */
-  ~FGRocket();
+  ~FGRocket(void);
 
   /** Determines the thrust coefficient.
       This routine takes the nozzle exit pressure and calculates the thrust
@@ -128,6 +120,12 @@ public:
       @return chamber pressure in psf. */
   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:
   double SHR;
   double maxPC;
@@ -135,6 +133,8 @@ private:
   double kFactor;
   double Variance;
   double PC;
+  bool Flameout;
+
   void Debug(int from);
 };
 }
index 77a4ea5ceac5394e25be9b2441b6211728c02789..1b98e75cb1deb4aaaa38149ff688dd7dc6d90a74 100644 (file)
@@ -89,6 +89,7 @@ FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex)
   vPQRdot_prev[0].InitMatrix();
   vPQRdot_prev[1].InitMatrix();
   vPQRdot_prev[2].InitMatrix();
+  vPQRdot_prev[3].InitMatrix();
 
   bind();
   
index 442e23d0ccb35fbf73d1228ce7df33a85556ae0f..832540c8be3d08aeb686b0dfdf65aa20eb665291 100644 (file)
@@ -27,24 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 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
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -72,10 +54,38 @@ INCLUDES
 #include "FGColumnVector3.h"
 #include "FGColumnVector4.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_ROTATION "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 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
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -127,7 +137,7 @@ private:
   FGColumnVector3 vPQR;
   FGColumnVector3 vAeroPQR;
   FGColumnVector3 vPQRdot;
-  FGColumnVector3 vPQRdot_prev[3];
+  FGColumnVector3 vPQRdot_prev[4];
   FGColumnVector3 vMoments;
   FGColumnVector3 vEuler;
   FGColumnVector3 vEulerRates;
index 8cf05ed77e2f8538942ac48eb1a5d34b68b12e72..b699391f7ed48d1e1be5fda2165b90f555eea5e3 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 08/24/00  JSB  Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -44,10 +40,25 @@ INCLUDES
 
 #include "FGThruster.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_ROTOR "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models a rotor (such as for a helicopter); NOT YET IMPLEMENTED.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index aa85b427f9dab906c4796e821542bf46f74fac68..7c9ec35ddd6d19507cc26cf6d055852d97bba187 100644 (file)
@@ -46,7 +46,7 @@ INCLUDES
 #  include STL_IOSTREAM
 #  include STL_ITERATOR
 #else
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #  else
 #    include <iostream>
index 575ab25c168dd173a06d8128b512a5add85cee06..7b4587a92f770dad1f5cb7ae2dd9960fc5276959 100644 (file)
@@ -54,27 +54,16 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** 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>
 
     <p>There is simple scripting support provided in the FGScript
-    class. Commands are specified using the <u>Simple Scripting
-    Directives for JSBSim</u> (SSDJ). The script file is in XML
+    class. Commands are specified using the <em>Simple Scripting
+    Directives for JSBSim</em> (SSDJ). The script file is in XML
     format. A test condition (or conditions) can be set up in the
     script and when the condition evaluates to true, the specified
     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 &quot;use&quot; lines. Next,
     comes the &quot;run&quot; section, where the conditions are
     described in &quot;when&quot; clauses.</p>
+    @author Jon S. Berndt
+    @version "$Id$"
 
 */
 
index 63b97e286024a9ae668a02e42dafbed9e94c3213..3558297d4b54f1b0e4cbd33ade8a58888cfe3678 100644 (file)
@@ -55,7 +55,7 @@ CLASS IMPLEMENTATION
 FGSimTurbine::FGSimTurbine(FGFDMExec* exec, FGConfigFile* cfg) : FGEngine(exec)
 {
   SetDefaults();
-  FGEngine::Type=etSimTurbine;
+
   Load(cfg);
   Debug(0);
 }
@@ -83,7 +83,7 @@ double FGSimTurbine::Calculate(double dummy)
       phase = tpRun;
       N2 = IdleN2;
       N1 = IdleN1;
-      OilTemp_degK = TAT + 10;  
+      OilTemp_degK = 366.0;  
       Cutoff = false;
       }
     else {
@@ -121,121 +121,125 @@ double FGSimTurbine::Calculate(double dummy)
 
 double FGSimTurbine::Off(void)
 {
-    double qbar = Translation->Getqbar();
-    Running = false;
-    FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.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);
-    EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
-    OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);  
-    OilPressure_psi = N2 * 0.62;
-    NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
-    EPR = Seek(&EPR, 1.0, 0.2, 0.2);
-    return 0.0; 
+  double qbar = Translation->Getqbar();
+  Running = false;
+  FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.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);
+  EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
+  OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);  
+  OilPressure_psi = N2 * 0.62;
+  NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
+  EPR = Seek(&EPR, 1.0, 0.2, 0.2);
+  return 0.0; 
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 double FGSimTurbine::Run(void)
 {
-    double idlethrust, milthrust, thrust;
-    double N2norm;   // 0.0 = idle N2, 1.0 = maximum N2
-    idlethrust = MilThrust * ThrustTables[0]->TotalValue();
-    milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
+  double idlethrust, milthrust, thrust;
+  double N2norm;   // 0.0 = idle N2, 1.0 = maximum N2
+  idlethrust = MilThrust * ThrustTables[0]->TotalValue();
+  milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
+
+  Running = true;
+  Starter = false;
  
-    Running = true;
-    Starter = false;
-   
-    N2 = Seek(&N2, IdleN2 + ThrottleCmd * N2_factor, delay, delay * 3.0);
-    N1 = Seek(&N1, IdleN1 + ThrottleCmd * N1_factor, delay, delay * 2.4);
-    N2norm = (N2 - IdleN2) / N2_factor;
-    thrust = idlethrust + (milthrust * N2norm * N2norm); 
-    thrust = thrust * (1.0 - BleedDemand);
-    EGT_degC = TAT + 363.1 + ThrottleCmd * 357.1;
-    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;
+  N2 = Seek(&N2, IdleN2 + ThrottleCmd * N2_factor, delay, delay * 3.0);
+  N1 = Seek(&N1, IdleN1 + ThrottleCmd * N1_factor, delay, delay * 2.4);
+  N2norm = (N2 - IdleN2) / N2_factor;
+  thrust = idlethrust + (milthrust * N2norm * N2norm); 
+  thrust = thrust * (1.0 - BleedDemand);
+  EGT_degC = TAT + 363.1 + ThrottleCmd * 357.1;
+  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 (AugMethod == 1) {
-      if ((ThrottleCmd > 0.99) && (N2 > 97.0)) {Augmentation = true;} 
-        else {Augmentation = false;}
-      }
+  if (AugMethod == 1) {
+    if ((ThrottleCmd > 0.99) && (N2 > 97.0)) {Augmentation = true;} 
+    else {Augmentation = false;}
+  }
 
-    if ((Augmented == 1) && Augmentation) {
-      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);
-      }
+  if ((Augmented == 1) && Augmentation) {
+    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);
+  }
+
+  if ((Injected == 1) && Injection)
+    thrust = thrust * ThrustTables[3]->TotalValue(); 
 
-    if ((Injected == 1) && Injection)
-      thrust = thrust * ThrustTables[3]->TotalValue(); 
+  ConsumeFuel();
+  if (Cutoff) phase = tpOff;
+  if (Starved) phase = tpOff;
 
-    ConsumeFuel();
-    if (Cutoff) phase = tpOff;
-    if (Starved) phase = tpOff;
-    return thrust;
+  return thrust;
 }
         
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 double FGSimTurbine::SpinUp(void)
 {
-    Running = false;
-    FuelFlow_pph = 0.0;
-    N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
-    N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
-    EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
-    OilPressure_psi = N2 * 0.62;
-    OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
-    EPR = 1.0;
-    NozzlePosition = 1.0;
-    return 0.0;
+  Running = false;
+  FuelFlow_pph = 0.0;
+  N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
+  N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
+  EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
+  OilPressure_psi = N2 * 0.62;
+  OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
+  EPR = 1.0;
+  NozzlePosition = 1.0;
+
+  return 0.0;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 double FGSimTurbine::Start(void)
 {
-    if ((N2 > 15.0) && !Starved) {       // minimum 15% N2 needed for start
-      Cranking = true;                   // provided for sound effects signal
-      if (N2 < IdleN2) {
-        N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
-        N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
-        EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
-        FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
-        OilPressure_psi = N2 * 0.62;
-        }
-      else {
-        phase = tpRun;
-        Running = true;
-        Starter = false;
-        Cranking = false;
-        } 
+  if ((N2 > 15.0) && !Starved) {       // minimum 15% N2 needed for start
+    Cranking = true;                   // provided for sound effects signal
+    if (N2 < IdleN2) {
+      N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
+      N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
+      EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
+      FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
+      OilPressure_psi = N2 * 0.62;
       }
-    else {                 // no start if N2 < 15%
-      phase = tpOff;
+    else {
+      phase = tpRun;
+      Running = true;
       Starter = false;
-      }
-    return 0.0; 
+      Cranking = false;
+      } 
+    }
+  else {                 // no start if N2 < 15%
+    phase = tpOff;
+    Starter = false;
+    }
+
+  return 0.0; 
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 double FGSimTurbine::Stall(void)
 {
-    double qbar = Translation->Getqbar();
-    EGT_degC = TAT + 903.14;
-    FuelFlow_pph = IdleFF;
-    N1 = Seek(&N1, qbar/10.0, 0, N1/10.0); 
-    N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
-    if (ThrottleCmd == 0) phase = tpRun;        // clear the stall with throttle
-    return 0.0; 
+  double qbar = Translation->Getqbar();
+  EGT_degC = TAT + 903.14;
+  FuelFlow_pph = IdleFF;
+  N1 = Seek(&N1, qbar/10.0, 0, N1/10.0); 
+  N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
+  if (ThrottleCmd == 0) phase = tpRun;        // clear the stall with throttle
+
+  return 0.0; 
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -297,7 +301,8 @@ double FGSimTurbine::Seek(double *var, double target, double accel, double decel
 
 void FGSimTurbine::SetDefaults(void)
 {
-  Name = "None_Defined";
+  Name = "Not defined";
+  Type = etSimTurbine;
   MilThrust = 10000.0;
   MaxThrust = 10000.0;
   BypassRatio = 0.0;
@@ -317,47 +322,59 @@ void FGSimTurbine::SetDefaults(void)
   Augmentation = false;
   Injection = false;
   Reversed = false;
+  Cutoff = true;
   phase = tpOff;
   Stalled = false;
   Seized = false;
   Overtemp = false;
   Fire = false;
+  EGT_degC = 0.0;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGSimTurbine::Load(FGConfigFile *Eng_cfg)
 {
-  int i;
   string token;
+
   Name = Eng_cfg->GetValue("NAME");
-  cout << Name << endl;
   Eng_cfg->GetNextConfigLine();
-  *Eng_cfg >> token >> MilThrust;
-  *Eng_cfg >> token >> MaxThrust;
-  *Eng_cfg >> token >> BypassRatio;
-  *Eng_cfg >> token >> TSFC;
-  *Eng_cfg >> token >> ATSFC;
-  *Eng_cfg >> token >> IdleN1;
-  *Eng_cfg >> token >> IdleN2;
-  *Eng_cfg >> token >> MaxN1;
-  *Eng_cfg >> token >> MaxN2;
-  *Eng_cfg >> token >> Augmented;
-  *Eng_cfg >> token >> AugMethod;
-  *Eng_cfg >> token >> Injected;
-  i=0;
-  while( Eng_cfg->GetValue() != string("/FG_SIMTURBINE") && i < 10){
-    ThrustTables.push_back( new FGCoefficient(FDMExec) );
-    ThrustTables.back()->Load(Eng_cfg);
-    i++;
+  int counter=0;
+
+  while (Eng_cfg->GetValue() != string("/FG_SIMTURBINE")) {
+    *Eng_cfg >> token;
+
+    if (token[0] == '<') token.erase(0,1); // Tables are read "<TABLE"
+
+    if      (token == "MILTHRUST") *Eng_cfg >> MilThrust;
+    else if (token == "MAXTHRUST") *Eng_cfg >> MaxThrust;
+    else if (token == "BYPASSRATIO") *Eng_cfg >> BypassRatio;
+    else if (token == "TSFC") *Eng_cfg >> TSFC;
+    else if (token == "ATSFC") *Eng_cfg >> ATSFC;
+    else if (token == "IDLEN1") *Eng_cfg >> IdleN1;
+    else if (token == "IDLEN2") *Eng_cfg >> IdleN2;
+    else if (token == "MAXN1") *Eng_cfg >> MaxN1;
+    else if (token == "MAXN2") *Eng_cfg >> MaxN2;
+    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
-  delay= 60.0 / (BypassRatio + 3.0);
+
+  // Pre-calculations and initializations
+
+  delay = 60.0 / (BypassRatio + 3.0);
   N1_factor = MaxN1 - IdleN1;
   N2_factor = MaxN2 - IdleN2;
   OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
   IdleFF = pow(MilThrust, 0.2) * 107.0;  // just an estimate
+
   return true;
 }
 
@@ -389,6 +406,24 @@ void FGSimTurbine::Debug(int from)
     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 (from == 0) cout << "Instantiated: FGSimTurbine" << endl;
index eca4e680a35d8521baee54777a6fedab9a2349a6..b62dd94202f22a97e7c3368d9a296e744293d262 100644 (file)
@@ -29,10 +29,6 @@ HISTORY
 09/22/2003  DPC  Added starting, stopping, new framework 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -69,24 +65,67 @@ CLASS DOCUMENTATION
     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.
 <P>
-    -STARTING (on ground):
-      -#  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
-          pneumatic starter.
-      -#  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
-          automatically be set to false after the start cycle.
+    - STARTING (on ground):
+      -# 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
+         pneumatic starter.
+      -# 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
+         automatically be set to false after the start cycle.
 <P>
-    -STARTING (in air):
-      -#  Increase speed to obtain a minimum of %15 N2.  If this is not possible,
-          the starter may be used to assist.
-      -#  Place the control FGEngine::Cutoff to false.
+    - STARTING (in air):
+      -# Increase speed to obtain a minimum of %15 N2.  If this is not possible,
+         the starter may be used to assist.
+      -# Place the control FGEngine::Cutoff to false.
 <P>
     Ignition is assumed to be on anytime the Cutoff control is set to false, 
     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
-    @version $Id$
+    @version "$Id$"
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -97,25 +136,49 @@ class FGSimTurbine : public FGEngine
 {
 public:
   /** Constructor
-      @param exec pointer to executive structure
-      @param Eng_Cfg pointer to engine config file instance */
-  FGSimTurbine(FGFDMExec* exec, FGConfigFile* Eng_cfg);
+      @param Executive pointer to executive structure
+      @param Eng_cfg pointer to engine config file instance */
+  FGSimTurbine(FGFDMExec* Executive, FGConfigFile* Eng_cfg);
   /// Destructor
   ~FGSimTurbine();
 
   enum phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpStall, tpSeize, tpTrim };
 
-  double Calculate(double);
+  double Calculate(double PowerRequired);
   double CalcFuelNeed(void);
   double GetPowerAvailable(void);
   double Seek(double* var, double target, double accel, double decel);
 
-  virtual phaseType GetPhase(void) { return phase; }
-  virtual void SetPhase( phaseType p ) { phase = p; } 
+  phaseType GetPhase(void) { return phase; }
+
+  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:
 
   typedef vector<FGCoefficient*> CoeffArray;
@@ -129,6 +192,8 @@ private:
   double ATSFC;            ///< Augmented TSFC (lbm/hr/lbf)
   double IdleN1;           ///< Idle N1
   double IdleN2;           ///< Idle N2
+  double N1;               ///< N1
+  double N2;               ///< N2
   double MaxN1;            ///< N1 at 100% throttle
   double MaxN2;            ///< N2 at 100% throttle
   double IdleFF;           ///< Idle Fuel Flow (lbm/hr)
@@ -142,10 +207,22 @@ private:
   bool Seized;             ///< true if inner spool is seized
   bool Overtemp;           ///< true if EGT exceeds limits
   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 Ignition;
+  int Augmented;           ///< = 1 if augmentation installed
   int AugMethod;           ///< = 0 if using property /engine[n]/augmentation
                            ///< = 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 Run(void);
index 9adba93f29957fa635abbece50725cc50a8e41fc..999af7da55af9ef0a0e056f44949702fed14b616 100644 (file)
@@ -86,7 +86,7 @@ FGState::FGState(FGFDMExec* fdex)
   Propulsion      = FDMExec->GetPropulsion();
   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();
   
index 49c6625a3e61bc5248533ecf52eb68a9be717237..0995d8e0d5441d0d1fbab0b78599cb459d29af4a 100644 (file)
@@ -76,7 +76,6 @@ INCLUDES
 #include "FGGroundReactions.h"
 #include "FGPropulsion.h"
 
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -89,10 +88,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -100,10 +95,6 @@ CLASS DOCUMENTATION
 /** Encapsulates the calculation of aircraft state.
     @author Jon S. Berndt
     @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
 
-  enum iType {AB4, AB3, AB2, AM3, EULER, TRAPZ};
+  enum iType {AB4, AB3, AB2, AM3, AM4, EULER, TRAPZ};
   
   /** Multi-method integrator.
       @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>AB2 - Adams-Bashforth, second order</li>
              <li>AM3 - Adams Moulton, third order</li>
+             <li>AM4 - Adams Moulton, fourth order</li>
              <li>EULER - Euler</li>
              <li>TRAPZ - Trapezoidal</li>
              </ul>
@@ -243,23 +235,35 @@ public:
 
     switch (type) {
     case AB4:
-      vResult = (delta_t/24.0)*(  55.0 * vTDeriv
-                                - 59.0 * vLastArray[0]
-                                + 37.0 * vLastArray[1]
-                                -  9.0 * vLastArray[2] );
+      vResult = (delta_t/24.0)*(  55.0 * vLastArray[0]
+                                - 59.0 * vLastArray[1]
+                                + 37.0 * vLastArray[2]
+                                -  9.0 * vLastArray[3] );
+      vLastArray[3] = vLastArray[2];
       vLastArray[2] = vLastArray[1];
       vLastArray[1] = vLastArray[0];
       vLastArray[0] = vTDeriv;
       break;
     case AB3:
-      vResult = (delta_t/12.0)*(  23.0 * vTDeriv
-                                - 16.0 * vLastArray[0]
-                                +  5.0 * vLastArray[1] );
+      vResult = (delta_t/12.0)*(  23.0 * vLastArray[0]
+                                - 16.0 * vLastArray[1]
+                                +  5.0 * vLastArray[2] );
+      vLastArray[2] = vLastArray[1];
       vLastArray[1] = vLastArray[0];
       vLastArray[0] = vTDeriv;
       break;
     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;
       break;
     case AM3:
@@ -341,7 +345,7 @@ private:
   FGMatrix33 mTs2b;
   FGMatrix33 mTb2s;
   FGColumnVector4 vQtrn;
-  FGColumnVector4 vQdot_prev[3];
+  FGColumnVector4 vQdot_prev[4];
   FGColumnVector4 vQdot;
   FGColumnVector3 vUVW;
   FGColumnVector3 vLocalVelNED;
index 531c1222dfd4ef32e339239cc590c7a2eb7726e4..5dbbadb99ceb09bad37c3bac74c3da8843498ce7 100644 (file)
@@ -38,7 +38,7 @@ INCLUDES
 
 #include "FGTable.h"
 
-#if defined ( sgi ) && !defined( __GNUC__ )
+#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
 #include <iomanip.h>
 #else
 #include <iomanip>
@@ -249,7 +249,7 @@ void FGTable::Print(void)
   if (Type == tt1D) startRow = 1;
   else startRow = 0;
 
-#if defined (sgi) && !defined(__GNUC__)
+#if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
   unsigned long flags = cout.setf(ios::fixed);
 #else
   ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream
index e26bba4c2d044a3a4772517feeabffc1df974166..6e28e9628cf75ac9875a1a0efaaf5f20703c69bc 100644 (file)
@@ -53,10 +53,6 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -67,10 +63,6 @@ CLASS DOCUMENTATION
     @version $Id$
     @see FGCoefficient
     @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>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 664b6b4ce006108c85c02b4329f65b0de2e10351..ea56e13f426ae1f1bbad4dfeb2179e737f5d952f 100644 (file)
@@ -38,7 +38,7 @@ INCLUDES
 
 #include "FGTank.h"
 
-#if !defined ( sgi ) || defined( __GNUC__ )
+#if !defined ( sgi ) || defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
 using std::cerr;
 using std::endl;
 using std::cout;
index b36c6e1ab8f7b70a391b5ac4e21bf9bac7873e7f..c04f7128b30aa1bd77d8300b9a0174a899da73c2 100644 (file)
@@ -57,7 +57,7 @@ INCLUDES
 #else
 # include <string>
   using std::string;
-# if !defined(sgi) || defined(__GNUC__)
+# if !defined(sgi) || defined(__GNUC__) || (_COMPILER_VERSION >= 740)
    using std::cerr;
    using std::endl;
    using std::cout;
@@ -65,13 +65,24 @@ INCLUDES
 #endif
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #define ID_TANK "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models a fuel tank.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index adddcbc56b4b51ea4fd1d50882f625b83b11cbd9..bd4f3991215282d0c50c689c0dac47557ae54ed2 100644 (file)
@@ -50,6 +50,7 @@ CLASS IMPLEMENTATION
 FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
                                              ThrusterNumber(0)
 {
+  Type = ttDirect;
   SetTransformType(FGForce::tCustom);
 
   Debug(0);
@@ -57,12 +58,15 @@ FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGThruster::FGThruster(FGFDMExec *FDMExec, 
-                       FGConfigFile *Eng_cfg ): FGForce(FDMExec) {
-   ThrusterNumber=0;                   
-   SetTransformType(FGForce::tCustom);
-   Name=Eng_cfg->GetValue();
-   Debug(0);
+FGThruster::FGThruster(FGFDMExec *FDMExec,
+                       FGConfigFile *Eng_cfg ): FGForce(FDMExec)
+{
+  ThrusterNumber = 0;
+  Type = ttDirect;
+  SetTransformType(FGForce::tCustom);
+  Name = Eng_cfg->GetValue();
+  GearRatio = 1.0;
+  Debug(0);
 }   
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index d1c2a6deb02cebc82fbdab30afb545d460f8552c..a546b316395e09dfdb8cdd7779b66a914ffddc72 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 08/24/00  JSB  Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -45,14 +41,18 @@ INCLUDES
 #include "FGForce.h"
 #include "FGConfigFile.h"
 
-#define ID_THRUSTER "$Id$"
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-namespace JSBSim {
+#define ID_THRUSTER "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -75,9 +75,9 @@ public:
   /// Destructor
   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 SetThrusterNumber(int nn) {ThrusterNumber = nn;}
   virtual void SetRPM(double rpm) {};
@@ -88,6 +88,7 @@ public:
   string GetName(void) {return Name;}
   int GetThrusterNumber(void) {return ThrusterNumber;}
   virtual double GetRPM(void) { return 0.0; };
+  double GetGearRatio(void) {return GearRatio; } 
 
 protected:
   eType Type;
@@ -96,6 +97,7 @@ protected:
   double Thrust;
   double PowerRequired;
   double deltaT;
+  double GearRatio;
   virtual void Debug(int from);
 };
 }
index 7b415b6bb1105f42c13147b6e5dd0c5b1ae69fb8..4042a02d0c60f7939d45867b924cd75a5a9369a1 100644 (file)
@@ -95,6 +95,7 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex)
   vUVWdot_prev[0].InitMatrix();
   vUVWdot_prev[1].InitMatrix();
   vUVWdot_prev[2].InitMatrix();
+  vUVWdot_prev[3].InitMatrix();
 
   bind();
   Debug(0);
@@ -160,6 +161,9 @@ bool FGTranslation::Run(void)
     qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
     qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
     Mach = Vt / 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);
 
index 992cf5e8c9fd93c9a9312a7af793e6458dc63dea..6442b30f011f68a7ae36351ab5cb9c3e487f8d98 100644 (file)
@@ -27,24 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 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
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -76,10 +58,38 @@ INCLUDES
 #include "FGColumnVector3.h"
 #include "FGColumnVector4.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_TRANSLATION "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 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
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -104,6 +114,7 @@ public:
   double GetqbarUV (void) const { return qbarUV; }
   inline double GetVt   (void) const { return Vt; }
   double GetMach (void) const { return Mach; }
+  double GetMachU(void) const { return vMachUVW(eU); }
   double Getadot (void) const { return adot; }
   double Getbdot (void) const { return bdot; }
 
@@ -130,9 +141,10 @@ public:
 private:
   FGColumnVector3 vUVW;
   FGColumnVector3 vUVWdot;
-  FGColumnVector3 vUVWdot_prev[3];
+  FGColumnVector3 vUVWdot_prev[4];
   FGMatrix33      mVel;
   FGColumnVector3 vAeroUVW;
+  FGColumnVector3 vMachUVW;
 
   double Vt, Mach;
   double qbar, qbarUW, qbarUV;
index 1276c5851c4adb91a20f35eaeb3c72e9df257443..6d8069813705b390642b406414e2d1ab678930a3 100644 (file)
@@ -66,20 +66,16 @@ DEFINITIONS
   #define snprintf _snprintf
 #endif
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
 typedef enum { tLongitudinal, tFull, tGround, tPullup, 
                tCustom, tNone, tTurn 
              } TrimMode;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-FORWARD DECLARATIONS
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -97,30 +93,25 @@ CLASS DOCUMENTATION
     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
     are provided as well. They are:
-    <ul>
-    <li> tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator</li>
-    <li> tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder
-                and heading minus ground track (hmgt) with beta</li>
-    <li> tPullup: tLongitudinal but adjust alpha to achieve load factor input
-         with SetTargetNlf()
-
-    <li> tGround: wdot with altitude, qdot with theta, and pdot with phi</li>
+    - tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator
+    - tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder
+             and heading minus ground track (hmgt) with beta
+    - tPullup: tLongitudinal but adjust alpha to achieve load factor input
+               with SetTargetNlf()
+    - tGround: wdot with altitude, qdot with theta, and pdot with phi
     
     The remaining modes include <b>tCustom</b>, which is completely user defined and
     <b>tNone</b>.
-    </ul>
-    
+
     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 
     initial conditions: is the model capable of steady state flight
     at those conditions?  Check the speed, altitude, configuration (flaps,
     gear, etc.), weight, cg, and anything else that may be relevant.
     
-    Example usage:
+    Example usage:<pre>
     FGFDMExec* FDMExec = new FGFDMExec();
-    .
-    .
-    .
+
     FGInitialCondition* fgic = new FGInitialCondition(FDMExec);
     FGTrim *fgt(FDMExec,fgic,tFull);
     fgic->SetVcaibratedKtsIC(100);
@@ -129,13 +120,9 @@ CLASS DOCUMENTATION
     if( !fgt->DoTrim() ) {
       cout << "Trim Failed" << endl;
     }
-    fgt->ReportState();  
+    fgt->ReportState(); </pre>  
     @author Tony Peden
-    @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>
+    @version "$Id$"
 */       
   
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -197,11 +184,11 @@ private:
 public:
   /** Initializes the trimming class
       @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
   */
@@ -219,10 +206,10 @@ public:
   void TrimStats();
   
   /** 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
   */
-  void SetMode(TrimMode tt);
+  void SetMode(TrimMode tm);
 
   /** Clear all state-control pairs from the current configuration.
       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
       @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 );
 
   /** automatically switch to trimming longitudinal acceleration with
       flight path angle (gamma) once it becomes apparent that there
       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; }
   
index 605bca53e52c5c0418baa8d72f18ba526150fa76..1a236d8a3fb5781afd5848ca0fc4b9d6a1468a13 100644 (file)
@@ -44,10 +44,18 @@ INCLUDES
 #include "FGJSBBase.h"
 #include "FGInitialCondition.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 #define ID_TRIMAXIS "$Id$"
 
 #define DEFAULT_TOLERANCE 0.001
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
 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 DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models an aircraft axis for purposes of trimming.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 31e662913ac9e555d36584ef50d5852185342259..a7c488bc6f07138d14903bfafa475062a942722f 100644 (file)
@@ -27,10 +27,6 @@ HISTORY
 --------------------------------------------------------------------------------
 08/23/2002  JSB  Created
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -49,6 +45,10 @@ INCLUDES
 
 #define ID_TURBINE "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index aca70178366c4b03c22832b9356874f2bbe89dac..3aa34c5d05f0a1c8e50cbde222fb0ae968cdb230 100644 (file)
@@ -46,8 +46,16 @@ DEFINES
 
 #define ID_UTILITY "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index d117100dab5d972e9d0e0760647ea25ae067972b..b63b65abc6a38c161e7e380c6d65322f429132b1 100644 (file)
@@ -53,7 +53,7 @@ FGfdmSocket::FGfdmSocket(string address, int port)
   size = 0;
   connected = false;
 
-#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
+  #if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
     WSADATA wsaData;
     int wsaReturnCode;
     wsaReturnCode = WSAStartup(MAKEWORD(1,1), &wsaData);
index c059834c163a265c4a1dba5055740a086d47cf21..0c64541b2251df820236181abfc785b23af01edd 100644 (file)
@@ -34,10 +34,6 @@ SENTRY
 #ifndef FGfdmSocket_H
 #define FGfdmSocket_H
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -53,7 +49,7 @@ INCLUDES
    SG_USING_STD(endl);
 #else
 #  include <string>
-#  if defined(sgi) && !defined(__GNUC__)
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #    include <fstream.h>
 #  else
@@ -82,8 +78,19 @@ DEFINITIONS
 
 #define ID_FDMSOCKET "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a socket object.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 34f2af9a92266291d311491f86fee3fbb4198ccd..283e783a5a1fd351ba8c4eb0d60260ac95d65183 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <simgear/compiler.h>
 
+#include <stdio.h>     //      size_t
 #ifdef SG_MATH_EXCEPTION_CLASH
 #  include <math.h>
 #endif
@@ -60,6 +61,8 @@
 #include <FDM/JSBSim/FGAerodynamics.h>
 #include <FDM/JSBSim/FGLGear.h>
 #include <FDM/JSBSim/FGPropertyManager.h>
+#include <FDM/JSBSim/FGEngine.h>
+#include <FDM/JSBSim/FGRotor.h>
 #include "JSBSim.hxx"
 
 static inline double
@@ -157,12 +160,15 @@ FGJSBsim::FGJSBsim( double dt )
     
     init_gear();
 
-                               // Set initial fuel levels if provided.
+    // Set initial fuel levels if provided.
     for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) {
       SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
-      if (node->getChild("level-gal_us", 0, false) != 0)
-       Propulsion->GetTank(i)
-         ->SetContents(node->getDoubleValue("level-gal_us") * 6.6);
+      if (node->getChild("level-gal_us", 0, false) != 0) {
+        Propulsion->GetTank(i)->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());
@@ -195,7 +201,6 @@ FGJSBsim::FGJSBsim( double dt )
         =fgGetNode("/surface-positions/speedbrake-pos-norm",true);
     spoilers_pos_pct=fgGetNode("/surface-positions/spoilers-pos-norm",true);
     
-
     elevator_pos_pct->setDoubleValue(0);
     left_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_east = fgGetNode("/environment/wind-from-east-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) {
-        delete fdmex;
+FGJSBsim::~FGJSBsim(void)
+{
+  delete fdmex;
 }
 
 /******************************************************************************/
@@ -226,8 +237,8 @@ FGJSBsim::~FGJSBsim(void) {
 // Initialize the JSBsim flight model, dt is the time increment for
 // each subsequent iteration through the EOM
 
-void FGJSBsim::init() {
-
+void FGJSBsim::init()
+{
     double tmp;
     
     SG_LOG( SG_FLIGHT, SG_INFO, "Starting and initializing JSBsim" );
@@ -268,10 +279,9 @@ void FGJSBsim::init() {
      << ", " << fdmex->GetAtmosphere()->GetDensity() );
 
     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
 
     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()= " << 
                                   globals->get_controls()->get_gear_down() );
-    
-
-   
 }
 
 /******************************************************************************/
 
 // Run an iteration of the EOM (equations of motion)
 
-void
-FGJSBsim::update( double dt ) {
-
+void FGJSBsim::update( double dt )
+{
     if (is_suspended())
       return;
 
@@ -361,7 +367,7 @@ FGJSBsim::update( double dt ) {
     }    
     
     for ( i=0; i < multiloop; i++ ) {
-        fdmex->Run();
+      fdmex->Run();
     }
 
     FGJSBBase::Message* msg;
@@ -395,7 +401,8 @@ FGJSBsim::update( double dt ) {
 
 // Convert from the FGInterface struct to the JSBsim generic_ struct
 
-bool FGJSBsim::copy_to_JSBsim() {
+bool FGJSBsim::copy_to_JSBsim()
+{
     double tmp;
     unsigned int i;
 
@@ -411,30 +418,52 @@ bool FGJSBsim::copy_to_JSBsim() {
     FCS->SetDsbCmd( globals->get_controls()->get_speedbrake() ); 
     FCS->SetDspCmd( globals->get_controls()->get_spoilers() ); 
 
-                               // Parking brake sets minimum braking
-                               // level for mains.
+        // Parking brake sets minimum braking
+        // level for mains.
     double parking_brake = globals->get_controls()->get_brake_parking();
     FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
     FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
     FCS->SetCBrake( 0.0 );
+    // FCS->SetCBrake( globals->get_controls()->get_brake(2) );
 
     FCS->SetGearCmd( globals->get_controls()->get_gear_down());
     for (i = 0; i < Propulsion->GetNumEngines(); i++) {
-      FGEngine * eng = Propulsion->GetEngine(i);
       SGPropertyNode * node = fgGetNode("engines/engine", i, true);
+
       FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
       FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(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->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") );
+      } // end FGEngine code block
     }
 
     _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
 
-bool FGJSBsim::copy_from_JSBsim() {
+bool FGJSBsim::copy_from_JSBsim()
+{
     unsigned int i, j;
 
     _set_Inertias( MassBalance->GetMass(),
@@ -488,25 +518,17 @@ bool FGJSBsim::copy_from_JSBsim() {
                       MassBalance->GetXYZcg(2),
                       MassBalance->GetXYZcg(3) );
 
-    _set_Accels_Body( Aircraft->GetBodyAccel()(1),
-                      Aircraft->GetBodyAccel()(2),
-                      Aircraft->GetBodyAccel()(3) );
-
-    //_set_Accels_CG_Body( Aircraft->GetBodyAccel()(1),
-    //                     Aircraft->GetBodyAccel()(2),
-    //                     Aircraft->GetBodyAccel()(3) );
-    //
-    _set_Accels_CG_Body_N ( Aircraft->GetNcg()(1),
-                            Aircraft->GetNcg()(2),
-                            Aircraft->GetNcg()(3) );
-    
-    _set_Accels_Pilot_Body( Auxiliary->GetPilotAccel()(1),
-                            Auxiliary->GetPilotAccel()(2),
-                            Auxiliary->GetPilotAccel()(3) );
+    _set_Accels_Body( Aircraft->GetBodyAccel(1),
+                      Aircraft->GetBodyAccel(2),
+                      Aircraft->GetBodyAccel(3) );
 
-   // _set_Accels_Pilot_Body_N( Auxiliary->GetPilotAccel()(1)/32.1739,
-   //                           Auxiliary->GetNpilot(2)/32.1739,
-   //                           Auxiliary->GetNpilot(3)/32.1739 );
+    _set_Accels_CG_Body_N ( Aircraft->GetNcg(1),
+                            Aircraft->GetNcg(2),
+                            Aircraft->GetNcg(3) );
+    
+    _set_Accels_Pilot_Body( Auxiliary->GetPilotAccel(1),
+                            Auxiliary->GetPilotAccel(2),
+                            Auxiliary->GetPilotAccel(3) );
 
     _set_Nlf( Aircraft->GetNlf() );
 
@@ -524,8 +546,6 @@ bool FGJSBsim::copy_from_JSBsim() {
 
     _set_V_equiv_kts( Auxiliary->GetVequivalentKTS() );
 
-    // _set_V_calibrated( Auxiliary->GetVcalibratedFPS() );
-
     _set_V_calibrated_kts( Auxiliary->GetVcalibratedKTS() );
 
     _set_V_ground_speed( Position->GetVground() );
@@ -546,9 +566,15 @@ bool FGJSBsim::copy_from_JSBsim() {
 
     // Positions
     _updateGeocentricPosition( Position->GetLatitude(),
-                              Position->GetLongitude(),
-                              Position->Geth() );
-
+             Position->GetLongitude(),
+             Position->Geth() );
+
+    // Positions of Visual Reference Point
+/*
+    _updateGeocentricPosition( Position->GetLatitudeVRP(),
+             Position->GetLongitudeVRP(),
+             Position->GethVRP() );
+*/
     _set_Altitude_AGL( Position->GetDistanceAGL() );
 
     _set_Euler_Angles( Rotation->Getphi(),
@@ -560,7 +586,6 @@ bool FGJSBsim::copy_from_JSBsim() {
 
 
     _set_Gamma_vert_rad( Position->GetGamma() );
-    // set_Gamma_horiz_rad( Gamma_horiz_rad );
 
     _set_Earth_position_angle( Auxiliary->GetEarthPositionAngle() );
 
@@ -573,69 +598,108 @@ bool FGJSBsim::copy_from_JSBsim() {
         }
     }
 
-                               // Copy the engine values from JSBSim.
-    for( i=0; i < Propulsion->GetNumEngines(); i++ ) {
+    // Copy the engine values from JSBSim.
+    for ( i=0; i < Propulsion->GetNumEngines(); i++ ) {
       SGPropertyNode * node = fgGetNode("engines/engine", i, true);
-      FGEngine * eng = Propulsion->GetEngine(i);
-      FGThruster * thrust = Propulsion->GetThruster(i);
+      char buf[30];
+      sprintf(buf, "engines/engine[%d]/thruster", i);
+      SGPropertyNode * tnode = fgGetNode(buf, true);
+      FGThruster * thruster = Propulsion->GetThruster(i);
+
+      switch (Propulsion->GetEngine(i)->GetType()) {
+      case FGEngine::etPiston:
+        { // 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;
+      }
 
-      node->setDoubleValue("mp-osi", eng->getManifoldPressure_inHg());
-      node->setDoubleValue("rpm", thrust->GetRPM());
-      node->setDoubleValue("egt-degf", eng->getExhaustGasTemp_degF());
+      { // FGEngine code block
+      FGEngine* eng = Propulsion->GetEngine(i);
       node->setDoubleValue("fuel-flow-gph", eng->getFuelFlow_gph());
-      node->setDoubleValue("cht-degf", eng->getCylinderHeadTemp_degF());
-      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("thrust_lb", thruster->GetThrust());
       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("starter", eng->GetStarter());
       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_cutoff(i, eng->GetCutoff() );
-      globals->get_controls()->set_augmentation(i, eng->GetAugmentation() );
-      globals->get_controls()->set_reverser(i, eng->GetReversed() );
-      globals->get_controls()->set_water_injection(i, eng->GetInjection() );
+      } // end FGEngine code block
+
+      switch (thruster->GetType()) {
+      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
-       = fgGetNode("/sim/freeze/fuel");
+    static const SGPropertyNode *fuel_freeze = fgGetNode("/sim/freeze/fuel");
 
-                               // Copy the fuel levels from JSBSim if fuel
-                               // freeze not enabled.
+    // Copy the fuel levels from JSBSim if fuel
+    // freeze not enabled.
     if ( ! fuel_freeze->getBoolValue() ) {
-       for (i = 0; i < Propulsion->GetNumTanks(); i++) {
-           SGPropertyNode * node
-               = fgGetNode("/consumables/fuel/tank", i, true);
-           double contents = Propulsion->GetTank(i)->GetContents();
-           node->setDoubleValue("level-gal_us", contents/6.6);
-           node->setDoubleValue("level-lb", contents);
-            // node->setDoubleValue("temperature_degC", 
-       }
+      for (i = 0; i < Propulsion->GetNumTanks(); i++) {
+        SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
+        double contents = Propulsion->GetTank(i)->GetContents();
+        node->setDoubleValue("level-gal_us", contents/6.6);
+        node->setDoubleValue("level-lb", contents);
+        // node->setDoubleValue("temperature_degC", 
+      }
     }
 
     update_gear();
     
     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) );
     left_aileron_pos_pct->setDoubleValue( 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) );
     speedbrake_pos_pct->setDoubleValue( FCS->GetDsbPos(ofNorm) );
     spoilers_pos_pct->setDoubleValue( FCS->GetDspPos(ofNorm) );
-
     
     return true;
 }
 
-bool FGJSBsim::ToggleDataLogging(void) {
+
+bool FGJSBsim::ToggleDataLogging(void)
+{
     return fdmex->GetOutput()->Toggle();
 }
 
 
-bool FGJSBsim::ToggleDataLogging(bool state) {
+bool FGJSBsim::ToggleDataLogging(bool state)
+{
     if (state) {
       fdmex->GetOutput()->Enable();
       return true;
@@ -665,12 +731,13 @@ bool FGJSBsim::ToggleDataLogging(bool state) {
 
 
 //Positions
-void FGJSBsim::set_Latitude(double lat) {
+void FGJSBsim::set_Latitude(double lat)
+{
     static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft");
     double alt;
     double sea_level_radius_meters, lat_geoc;
 
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Latitude(lat);
     
     if ( altitude->getDoubleValue() > -9990 ) {
@@ -693,11 +760,12 @@ void FGJSBsim::set_Latitude(double lat) {
     needTrim=true;
 }
 
-void FGJSBsim::set_Longitude(double lon) {
 
+void FGJSBsim::set_Longitude(double 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);
 
     update_ic();
@@ -707,7 +775,8 @@ void FGJSBsim::set_Longitude(double lon) {
     needTrim=true;
 }
 
-void FGJSBsim::set_Altitude(double alt) {
+void FGJSBsim::set_Altitude(double alt)
+{
     static const SGPropertyNode *latitude = fgGetNode("/position/latitude-deg");
 
     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, "  lat (deg) = " << latitude->getDoubleValue() );
     
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Altitude(alt);
 
     update_ic();
@@ -732,10 +801,11 @@ void FGJSBsim::set_Altitude(double alt) {
     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 );
 
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_V_calibrated_kts(vc);
 
     update_ic();
@@ -743,10 +813,11 @@ void FGJSBsim::set_V_calibrated_kts(double vc) {
     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 );
     
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Mach_number(mach);
 
     update_ic();
@@ -754,11 +825,12 @@ void FGJSBsim::set_Mach_number(double mach) {
     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: "
        << north << ", " <<  east << ", " << down );
     
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Velocities_Local(north, east, down);
 
     update_ic();
@@ -768,11 +840,12 @@ void FGJSBsim::set_Velocities_Local( double north, double east, double down ){
     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: "
        << u << ", " <<  v << ", " <<  w );
     
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Velocities_Wind_Body(u, v, w);
 
     update_ic();
@@ -783,11 +856,12 @@ void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){
 }
 
 //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: "
        << phi << ", " << theta << ", " << psi );
     
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Euler_Angles(phi, theta, psi);
 
     update_ic();
@@ -798,10 +872,11 @@ void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) {
 }
 
 //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 );
     
-                                // In case we're not trimming
+    // In case we're not trimming
     FGInterface::set_Climb_Rate(roc);
 
     update_ic();
@@ -814,7 +889,8 @@ void FGJSBsim::set_Climb_Rate( double roc) {
     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 );
     
     update_ic();
@@ -824,18 +900,18 @@ void FGJSBsim::set_Gamma_vert_rad( double gamma) {
     needTrim=true;
 }
 
-void FGJSBsim::init_gear(void ) {
-    
+void FGJSBsim::init_gear(void )
+{
     FGGroundReactions* gr=fdmex->GetGroundReactions();
     int Ngear=GroundReactions->GetNumGearUnits();
     for (int i=0;i<Ngear;i++) {
       SGPropertyNode * node = fgGetNode("gear/gear", i, true);
       node->setDoubleValue("xoffset-in",
-                          gr->GetGearUnit(i)->GetBodyLocation()(1));
+         gr->GetGearUnit(i)->GetBodyLocation()(1));
       node->setDoubleValue("yoffset-in",
-                          gr->GetGearUnit(i)->GetBodyLocation()(2));
+         gr->GetGearUnit(i)->GetBodyLocation()(2));
       node->setDoubleValue("zoffset-in",
-                          gr->GetGearUnit(i)->GetBodyLocation()(3));
+         gr->GetGearUnit(i)->GetBodyLocation()(3));
       node->setBoolValue("wow", gr->GetGearUnit(i)->GetWOW());
       node->setBoolValue("has-brake", gr->GetGearUnit(i)->GetBrakeGroup() > 0);
       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();
     int Ngear=GroundReactions->GetNumGearUnits();
     for (int i=0;i<Ngear;i++) {
       SGPropertyNode * node = fgGetNode("gear/gear", i, true);
-      node->getChild("wow", 0, true)
-       ->setBoolValue(gr->GetGearUnit(i)->GetWOW());
-      node->getChild("position-norm", 0, true)
-       ->setDoubleValue(FCS->GetGearPos());
+      node->getChild("wow", 0, true)->setBoolValue(gr->GetGearUnit(i)->GetWOW());
+      node->getChild("position-norm", 0, true)->setDoubleValue(FCS->GetGearPos());
       gr->GetGearUnit(i)->SetTirePressure(node->getDoubleValue("tire-pressure-norm"));
     }  
 }
 
-void FGJSBsim::do_trim(void) {
-
-        FGTrim *fgtrim;
-        if( fgGetBool("/sim/presets/onground") ) {
-            fgic->SetVcalibratedKtsIC(0.0);
-            fgtrim=new FGTrim(fdmex,tGround);
-        } else {
-            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());
-        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::do_trim(void)
+{
+  FGTrim *fgtrim;
+
+  if ( fgGetBool("/sim/presets/onground") )
+  {
+    fgic->SetVcalibratedKtsIC(0.0);
+    fgtrim = new FGTrim(fdmex,tGround);
+  } else {
+    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());
+  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) {       
-   if( !needTrim ) {
+void FGJSBsim::update_ic(void)
+{
+   if ( !needTrim ) {
      fgic->SetLatitudeRadIC(get_Lat_geocentric() );       
      fgic->SetLongitudeRadIC( get_Longitude() );       
      fgic->SetAltitudeFtIC( get_Altitude() );       
index c8945b0fb21f91c36a648946d755e0689d1a82e6..06a609707ecf7d6c43099e2e560d2349598fa9bd 100644 (file)
@@ -47,12 +47,12 @@ DEFINITIONS
 
 #define ID_CONDITION "$Id$"
 
-namespace JSBSim {
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 1f30e4dc047f40e0420f1766c298fefbc0236481..dab0d93519ea2258bb64191a0c5159b6fc6fbcc9 100644 (file)
@@ -54,10 +54,6 @@ namespace JSBSim {
 
 class FGFCS;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 9920aa5ab44446d7f69e422a4dc4b66118f0311a..d6294f93b7dd12b750ec951ffdbdc7ad1ccdc757 100644 (file)
@@ -46,7 +46,6 @@ INCLUDES
 #include "../FGJSBBase.h"
 #include "../FGPropertyManager.h"
 
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -63,10 +62,6 @@ namespace JSBSim {
 
 class FGFCS;
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -75,15 +70,15 @@ CLASS DOCUMENTATION
     The Flight Control System (FCS) for JSBSim consists of the FCS container
     class (see \URL[FGFCS]{FGFCS.html}), the FGFCSComponent base class, and the
     component classes from which can be constructed a string, or channel. See:
-    <ul>
-    <li>\URL[Switch Component]{FGSwitch.html}</li>
-    <li>\URL[Gain Component]{FGGain.html}</li>
-    <li>\URL[Flaps Component]{FGFlaps.html}</li>
-    <li>\URL[Filter Component]{FGFilter.html}</li>
-    <li>\URL[Deadband Component]{FGDeadBand.html}</li>
-    <li>\URL[Summer Component]{FGSummer.html}</li>
-    <li>\URL[Gradient Component]{FGGradient.html}</li>
-    </ul>
+
+    - FGSwitch
+    - FGGain
+    - FGKinemat
+    - FGFilter
+    - FGDeadBand
+    - FGSummer
+    - FGGradient
+    
     @author Jon S. Berndt
     @version $Id$
     @see Documentation for the FGFCS class, and for the configuration file class
index 3dc26999d3be0d9ec1d13da7cf41bb27ba565e05..6fa065b84e7dc400280f26a6b0aa0e7553b24a0f 100644 (file)
@@ -59,6 +59,7 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   Name = AC_cfg->GetValue("NAME");
   AC_cfg->GetNextConfigLine();
   dt = fcs->GetState()->Getdt();
+  Trigger = 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")) {
     *AC_cfg >> token;
-    if (token == "C1")          *AC_cfg >> C1;
-    else if (token == "C2")     *AC_cfg >> C2;
-    else if (token == "C3")     *AC_cfg >> C3;
-    else if (token == "C4")     *AC_cfg >> C4;
-    else if (token == "C5")     *AC_cfg >> C5;
-    else if (token == "C6")     *AC_cfg >> C6;
+    if (token == "C1")           *AC_cfg >> C1;
+    else if (token == "C2")      *AC_cfg >> C2;
+    else if (token == "C3")      *AC_cfg >> C3;
+    else if (token == "C4")      *AC_cfg >> C4;
+    else if (token == "C5")      *AC_cfg >> C5;
+    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")
     {
       token = AC_cfg->GetValue("INPUT");
@@ -146,6 +153,8 @@ FGFilter::~FGFilter()
 
 bool FGFilter::Run(void)
 {
+  int test = 0;
+
   FGFCSComponent::Run(); // call the base class for initialization of Input
 
   if (Initialize) {
@@ -153,6 +162,15 @@ bool FGFilter::Run(void)
     PreviousOutput1 = PreviousInput1 = Output = Input;
     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 {
     Input = InputNodes[0]->getDoubleValue();
     switch (FilterType) {
index e524e37a676f605cd88e1ad0a998ab807e5ea4ef..49ef577261c35292535df3644a048c27b99d48ef 100644 (file)
@@ -52,38 +52,127 @@ FORWARD DECLARATIONS
 
 namespace JSBSim {
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Encapsulates a filter for the flight control system.
-    Filters are modeled using the Tustin Substitution method. These types of
-    filters can currently be modeled:
-    
-    - Lag
-    - Lead-Lag
-    - Washout
-    - Integrator
-    - Second order
-
-    The filter is specified in the config file like this:
-    <pre>
-    \<COMPONENT NAME="{name}" TYPE="{LAG_FILTER}"\><BR>
-      INPUT        15<BR>
-      C1           600<BR>
-      OUTPUT       fcs/elevator-pos-rad<BR>
-    \</COMPONENT\>
-    </pre>
+The filter component can simulate any filter up to second order. The
+Tustin substitution is used to take filter definitions from LaPlace space to the
+time domain. The general format for a filter specification is:
+
+<pre>
+\<COMPONENT NAME="name" TYPE="type">
+  INPUT \<property>
+  C1  \<value>
+  [C2 \<value>]
+  [C3 \<value>]
+  [C4 \<value>]
+  [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
     @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 PreviousOutput2;
   FGConfigFile* AC_cfg;
+  FGPropertyManager* Trigger;
   void Debug(int from);
 };
 }
index e62a07c95b4098c7909da40b3d3d63c19eb0c75d..567547e586902da12e90f6439394b6b0d59af2c7 100644 (file)
@@ -72,19 +72,19 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
     if (token == "INPUT") {
-      token = AC_cfg->GetValue("INPUT");
+      *AC_cfg >> token;
 
       if (token[0] == '-') {
         invert = true;
         token.erase(0,1);
-      }      
+      }
 
       if (InputNodes.size() > 0) {
         cerr << "Gains can only accept one input" << endl;
       } else  {
-        *AC_cfg >> token;
         InputNodes.push_back( resolveSymbol(token) );
-      }  
+      }
+
     } else if (token == "GAIN") {
       *AC_cfg >> Gain;
     } else if (token == "MIN") {
@@ -113,7 +113,7 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
       *Table << *AC_cfg;
     }
   }
-  
+
   FGFCSComponent::bind();
   if (Type == "AEROSURFACE_SCALE")
     treenode->Tie( "output-norm", this, &FGGain::GetOutputPct );
@@ -198,7 +198,6 @@ void FGGain::Debug(int from)
       if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
       cout << "      MIN: " << Min << endl;
       cout << "      MAX: " << Max << endl;
-      if(invert) cout << "      Invert mapping" << endl;
       if (ScheduledBy != 0) {
         cout << "      Scheduled by parameter: " << ScheduledBy->getName() << endl;
         Table->Print();
index 562a1a65c4f1f465da5704a1345bfd6bfe0ca826..d762698672a0eddded1090852920b214023b6b4b 100644 (file)
 HISTORY
 --------------------------------------------------------------------------------
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -53,17 +49,27 @@ INCLUDES
 #include "../FGConfigFile.h"
 #include "../FGTable.h"
 
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #define ID_GAIN "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
 class FGFCS;
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a gain component for the flight control system.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index fdb2c102510eb39db44ca3b828e555aceaea77f6..66ac963699b78780bed7446194da77ed11715eb7 100644 (file)
 HISTORY
 --------------------------------------------------------------------------------
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -45,15 +41,26 @@ INCLUDES
 #include "../FGConfigFile.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #define ID_GRADIENT "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
 class FGFCS;
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a gradient component for the flight control system.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 9358a6353de9e63b683342ec14ff778d73f69b5b..9f16e8deafebc258399a5ce46746932593d60c3a 100644 (file)
 HISTORY
 --------------------------------------------------------------------------------
  
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -57,13 +53,24 @@ INCLUDES
 #include "../FGConfigFile.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #define ID_FLAPS "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 namespace JSBSim {
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a kinematic component for the flight control system.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 6bc5ee032f29279f1f34789dd5b1ec1d8cd62d5f..172dc8b5e0459119c60dcfc2d3e8c3ca8ccf7b57 100644 (file)
@@ -65,10 +65,6 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -77,10 +73,6 @@ CLASS DOCUMENTATION
     state variables, or even floating point numbers (e.g. for a bias).
     @author Jon S. Berndt
     @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>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index cf1ea4c9041dd85036818f7a55e68bebded9b422..3220a268cd8a4a94c87e177300fe510eb589027f 100644 (file)
@@ -47,12 +47,12 @@ DEFINITIONS
 
 #define ID_SWITCH "$Id$"
 
-namespace JSBSim {
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -85,20 +85,20 @@ complex groupings of logical comparisons. Each CONDITION_GROUP contains
 additional conditions, as well as possibly additional CONDITION_GROUPs.
 
 <pre>
-\<COMPONENT NAME="switch1" TYPE="SWITCH"\><BR>
-  \<TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}"\><BR>
-    {property} {conditional} {property|value}<BR>
-    \<CONDITION_GROUP LOGIC="{AND|OR}"\><BR>
-      {property} {conditional} {property|value}<BR>
-      ...<BR>
-    \</CONDITION_GROUP\><BR>
-    ...<BR>
-  \</TEST><BR>
-  \<TEST LOGIC="{AND|OR}" OUTPUT="{property|value}"\><BR>
-    {property} {conditional} {property|value}<BR>
-    ...<BR>
-  \</TEST\><BR>
-  ...<BR>
+\<COMPONENT NAME="switch1" TYPE="SWITCH"\>
+  \<TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}"\>
+    {property} {conditional} {property|value}
+    \<CONDITION_GROUP LOGIC="{AND|OR}"\>
+      {property} {conditional} {property|value}
+      ...
+    \</CONDITION_GROUP\>
+    ...
+  \</TEST>
+  \<TEST LOGIC="{AND|OR}" OUTPUT="{property|value}"\>
+    {property} {conditional} {property|value}
+    ...
+  \</TEST\>
+  ...
 \</COMPONENT\>
 </pre>
 */