]> git.mxchange.org Git - flightgear.git/commitdiff
20010710 sync with JSBSim.
authorcurt <curt>
Tue, 10 Jul 2001 15:56:38 +0000 (15:56 +0000)
committercurt <curt>
Tue, 10 Jul 2001 15:56:38 +0000 (15:56 +0000)
20 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/FGCoefficient.h
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGGroundReactions.cpp
src/FDM/JSBSim/FGGroundReactions.h
src/FDM/JSBSim/FGModel.h
src/FDM/JSBSim/FGOutput.cpp
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPosition.h
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGPropulsion.h
src/FDM/JSBSim/FGTranslation.cpp
src/FDM/JSBSim/FGTranslation.h
src/FDM/JSBSim/JSBSim.cpp

index 1e18f3bb75ae9b5547ec63267f6a25fa6a9c29c4..a24df84bd3517162803127c255d52eef13be6ddb 100644 (file)
@@ -131,7 +131,7 @@ bool FGAerodynamics::Run(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGAerodynamics::LoadAerodynamics(FGConfigFile* AC_cfg)
+bool FGAerodynamics::Load(FGConfigFile* AC_cfg)
 {
   string token, axis;
 
index 5e97441c9e486652e914d1dc83947d7881a6ff38..817e014531f57f7cc579e8d9cf31976b9aedf413 100644 (file)
@@ -105,7 +105,7 @@ public:
 
   /** Loads the Aerodynamics model
       @return true if successful */
-  bool LoadAerodynamics(FGConfigFile* AC_cfg);
+  bool Load(FGConfigFile* AC_cfg);
 
   /** Outputs coefficient information.
       Non-dimensionalizing parameter descriptions are output
index 65b863f88b45c09b86919a657ee7f2697a82d812..bc73c5c97970ee19d0d6c52fc55fb5b0165380a7 100644 (file)
@@ -28,8 +28,7 @@
 FUNCTIONAL DESCRIPTION
 --------------------------------------------------------------------------------
 Models the aircraft reactions and forces. This class is instantiated by the
-FGFDMExec class and scheduled as an FDM entry. LoadAircraft() is supplied with a
-name of a valid, registered aircraft, and the data file is parsed.
+FGFDMExec class and scheduled as an FDM entry. 
  
 HISTORY
 --------------------------------------------------------------------------------
@@ -190,46 +189,32 @@ FGAircraft::~FGAircraft()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string fname) {
-  string path;
-  string filename;
-  string aircraftCfgFileName;
+bool FGAircraft::Load(FGConfigFile* AC_cfg)
+{
   string token;
 
-  AircraftPath = aircraft_path;
-  EnginePath = engine_path;
-
-# ifndef macintosh
-  aircraftCfgFileName = AircraftPath + "/" + fname + "/" + fname + ".xml";
-# else
-  aircraftCfgFileName = AircraftPath + ";" + fname + ";" + fname + ".xml";
-# endif
-
-  FGConfigFile AC_cfg(aircraftCfgFileName);
-  if (!AC_cfg.IsOpen()) return false;
-
-  ReadPrologue(&AC_cfg);
+  ReadPrologue(AC_cfg);
 
-  while ((AC_cfg.GetNextConfigLine() != "EOF") &&
-         (token = AC_cfg.GetValue()) != "/FDM_CONFIG") {
+  while ((AC_cfg->GetNextConfigLine() != "EOF") &&
+         (token = AC_cfg->GetValue()) != "/FDM_CONFIG") {
     if (token == "METRICS") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Metrics" << fgdef << endl;
-      ReadMetrics(&AC_cfg);
+      ReadMetrics(AC_cfg);
     } else if (token == "AERODYNAMICS") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Aerodynamics" << fgdef << endl;
-      ReadAerodynamics(&AC_cfg);
+      ReadAerodynamics(AC_cfg);
     } else if (token == "UNDERCARRIAGE") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Landing Gear" << fgdef << endl;
-      ReadUndercarriage(&AC_cfg);
+      ReadUndercarriage(AC_cfg);
     } else if (token == "PROPULSION") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Propulsion" << fgdef << endl;
-      ReadPropulsion(&AC_cfg);
+      ReadPropulsion(AC_cfg);
     } else if (token == "FLIGHT_CONTROL") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Flight Control" << fgdef << endl;
-      ReadFlightControls(&AC_cfg);
+      ReadFlightControls(AC_cfg);
     } else if (token == "OUTPUT") {
       if (debug_lvl > 0) cout << fgcyan << "\n  Reading Output directives" << fgdef << endl;
-      ReadOutput(&AC_cfg);
+      ReadOutput(AC_cfg);
     }
   }
 
@@ -375,7 +360,7 @@ void FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg) {
-  if (!Propulsion->LoadPropulsion(AC_cfg)) {
+  if (!Propulsion->Load(AC_cfg)) {
     cerr << "Propulsion not successfully loaded" << endl;
   }
 }
@@ -383,7 +368,7 @@ void FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg) {
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg) {
-  if (!FCS->LoadFCS(AC_cfg)) {
+  if (!FCS->Load(AC_cfg)) {
     cerr << "Flight Controls not successfully loaded" << endl;
   }
 }
@@ -392,7 +377,7 @@ void FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg) {
 
 void FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg)
 {
-  if (!Aerodynamics->LoadAerodynamics(AC_cfg)) {
+  if (!Aerodynamics->Load(AC_cfg)) {
     cerr << "Aerodynamics not successfully loaded" << endl;
   }
 
index 6d252e509164c3e88d4107401ce7a28b6146912a..213fef7738ec2d249b24c2d03e8c5f711724f2ec 100644 (file)
@@ -43,16 +43,13 @@ INCLUDES
 #  ifdef SG_HAVE_STD_INCLUDES
 #    include <vector>
 #    include <iterator>
-#    include <map>
 #  else
 #    include <vector.h>
 #    include <iterator.h>
-#    include <map.h>
 #  endif
 #else
 #  include <vector>
 #  include <iterator>
-#  include <map>
 #endif
 
 #include "FGModel.h"
@@ -130,11 +127,9 @@ public:
   
   /** Loads the aircraft.
       The executive calls this method to load the aircraft into JSBSim.
-      @param apath path to the aircraft files (e.g. "aircraft/X15/")
-      @param epath path to engine files (e.g. "engine/")
-      @param acname name of aircraft (e.g. "X15")
-      @return true if succesful */
-  bool LoadAircraft(string apath, string epath, string acname);
+      @param AC_cfg a pointer to the config file instance
+      @return true if successful */
+  bool Load(FGConfigFile* AC_cfg);
   
   /** Gets the aircraft name
       @return the name of the aircraft as a string type */
@@ -217,8 +212,6 @@ private:
 
   vector <FGLGear> lGear;
 
-  string AircraftPath;
-  string EnginePath;
   void ReadMetrics(FGConfigFile*);
   void ReadPropulsion(FGConfigFile*);
   void ReadFlightControls(FGConfigFile*);
index 5cd6799c31cf52039caad5095f43a66b68a72bf7..ce236f131fe3043ba4fceb3821987e659e55c10a 100644 (file)
@@ -97,7 +97,18 @@ CLASS DECLARATION
 
 class FGCoefficient
 {
+public:
+  FGCoefficient(FGFDMExec*, FGConfigFile*);
+  ~FGCoefficient();
+
   typedef vector <eParam> MultVec;
+  float TotalValue(void);
+  inline string Getname(void) {return name;}
+  inline float GetSD(void) {return SD;}
+  inline MultVec Getmultipliers(void) {return multipliers;}
+  void DumpSD(void);
+
+private:
   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
 
   int numInstances;
@@ -105,6 +116,9 @@ class FGCoefficient
   string description;
   string name;
   string method;
+  float Value(float, float);
+  float Value(float);
+  float Value(void);
   float StaticValue;
   eParam LookupR, LookupC;
   MultVec multipliers;
@@ -124,19 +138,6 @@ class FGCoefficient
   FGAuxiliary*    Auxiliary;
   FGOutput*       Output;
 
-public:
-  FGCoefficient(FGFDMExec*, FGConfigFile*);
-  ~FGCoefficient();
-
-  float Value(float, float);
-  float Value(float);
-  float Value(void);
-  float TotalValue(void);
-  inline string Getname(void) {return name;}
-  inline float GetSD(void) {return SD;}
-  inline MultVec Getmultipliers(void) {return multipliers;}
-  void DumpSD(void);
-private:
   void Debug(void);
 };
 
index 466e0147f0c59b6212f68fcd1b5125fc057079d9..1be919c3c00d83a72cb4d07c2f741eb7241f034c 100644 (file)
@@ -134,12 +134,12 @@ void FGFCS::SetThrottlePos(int engineNum, float setting)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGFCS::LoadFCS(FGConfigFile* AC_cfg)
+bool FGFCS::Load(FGConfigFile* AC_cfg)
 {
   string token;
 
-  FCSName = AC_cfg->GetValue("NAME");
-  if (debug_lvl > 0) cout << "    Control System Name: " << FCSName << endl;
+  Name = AC_cfg->GetValue("NAME");
+  if (debug_lvl > 0) cout << "    Control System Name: " << Name << endl;
   AC_cfg->GetNextConfigLine();
   while ((token = AC_cfg->GetValue()) != "/FLIGHT_CONTROL") {
     if (token == "COMPONENT") {
index 2dae2aa0dd72898bbf59c16edb09545c7b4a63d6..dfaa660326b2bda0b5aec729818aa569af0c031a 100644 (file)
@@ -350,11 +350,7 @@ public:
       the config file instance pointer. LoadFCS() is called from FGAircraft.
       @param AC_cfg pointer to the config file instance
       @return true if succesful */
-  bool LoadFCS(FGConfigFile* AC_cfg);
-
-  /** The name of the flight control laws for this aircraft.
-      This is given in the config file, and is not used for anything currently.*/
-  string FCSName;
+  bool Load(FGConfigFile* AC_cfg);
 
   void AddThrottle(void);
 
index 0e8cb976df197e09aad7b2096985cdfa7bd8f549..ed10e6986e958f6a090e0456c3b5d4559672481e 100644 (file)
@@ -364,14 +364,26 @@ bool FGFDMExec::LoadModel(string APath, string EPath, string model)
 {
   bool result = false;
 
+  string aircraftCfgFileName;
+
+  AircraftPath = APath;
+  EnginePath   = EPath;
+
+# ifndef macintosh
+  aircraftCfgFileName = AircraftPath + "/" + model + "/" + model + ".xml";
+# else
+  aircraftCfgFileName = AircraftPath + ";" + model + ";" + model + ".xml";
+# endif
+
+  FGConfigFile AC_cfg(aircraftCfgFileName);
+  if (!AC_cfg.IsOpen()) return false;
+
   if (modelLoaded) {
     DeAllocate();
     Allocate();
   }
 
-  AircraftPath = APath;
-  EnginePath   = EPath;
-  result = Aircraft->LoadAircraft(AircraftPath, EnginePath, model);
+  result = Aircraft->Load(&AC_cfg);
 
   if (result) {
     modelLoaded = true;
index 66ee85ef3f94229f43e87d7c3e945b55533d12e0..0d310fd9d98232153c97d3fc6f8ef6b798202615 100644 (file)
@@ -66,9 +66,8 @@ bool FGGroundReactions:: Run(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGGroundReactions::LoadGroundReactions(FGConfigFile* AC_cfg)
+bool FGGroundReactions::Load(FGConfigFile* AC_cfg)
 {
-//
   return true;
 }
 
index e4bc87fc6a8d28b5e6e9a8877a2c1ddb8ed7b420..a0b4caf0e2034d30838087e4f99bddfdb6086a3e 100644 (file)
@@ -69,7 +69,7 @@ public:
   ~FGGroundReactions();
 
   bool Run(void);
-  bool LoadGroundReactions(FGConfigFile* AC_cfg);
+  bool Load(FGConfigFile* AC_cfg);
 
 private:
   void Debug(void);
index dcb08daca5cc05cfadabab327b27d45782f1f7c3..ebf2a510822cfac8807f69c36ba3751c5133ec17 100644 (file)
@@ -79,6 +79,7 @@ class FGRotation;
 class FGPosition;
 class FGAuxiliary;
 class FGOutput;
+class FGConfigFile;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
@@ -105,10 +106,15 @@ public:
   /// Destructor
   virtual ~FGModel();
 
+  /** Loads this model.
+      @param Config a pointer to the config file instance
+      @return true if model is successfully loaded*/
+  virtual bool Load(FGConfigFile* Config) {}
   FGModel* NextModel;
   string Name;
 
-    /** Runs the model; called by the Executive
+  /** Runs the model; called by the Executive
       @see JSBSim.cpp documentation
       @return false if no error */
   virtual bool Run(void);
index e03f0266ef3aafcb3b76ef71a41baf4e289a33b6..af3b8ad221ac05871c677e44df4d985c7c953a20 100644 (file)
@@ -158,7 +158,8 @@ void FGOutput::DelimitedOutput(void)
       cout << ", ";
       cout << "QBar, ";
       cout << "Vtotal, ";
-      cout << "U, V, W, ";
+      cout << "UBody, VBody, WBody, ";
+      cout << "UAero, VAero, WAero, ";
       cout << "Vn, Ve, Vd";
     }
     if (SubSystems & FGAircraft::ssForces) {
@@ -233,6 +234,7 @@ void FGOutput::DelimitedOutput(void)
     cout << Translation->Getqbar() << ", ";
     cout << Translation->GetVt() << ", ";
     cout << Translation->GetUVW() << ", ";
+    cout << Translation->GetvAero() << ", ";
     cout << Position->GetVel();
   }
   if (SubSystems & FGAircraft::ssForces) {
@@ -312,7 +314,8 @@ void FGOutput::DelimitedOutput(string fname)
       datafile << ", ";
       datafile << "QBar, ";
       datafile << "Vtotal, ";
-      datafile << "U, V, W, ";
+      datafile << "UBody, VBody, WBody, ";
+      datafile << "UAero, VAero, WAero, ";
       datafile << "Vn, Ve, Vd";
     }
     if (SubSystems & FGAircraft::ssForces) {
@@ -390,6 +393,7 @@ void FGOutput::DelimitedOutput(string fname)
     datafile << Translation->Getqbar() << ", ";
     datafile << Translation->GetVt() << ", ";
     datafile << Translation->GetUVW() << ", ";
+    datafile << Translation->GetvAero() << ", ";
     datafile << Position->GetVel();
   }
   if (SubSystems & FGAircraft::ssForces) {
@@ -463,9 +467,12 @@ void FGOutput::SocketOutput(void)
     socket->Append("Psi");
     socket->Append("Rho");
     socket->Append("Vtotal");
-    socket->Append("U");
-    socket->Append("V");
-    socket->Append("W");
+    socket->Append("UBody");
+    socket->Append("VBody");
+    socket->Append("WBody");
+    socket->Append("UAero");
+    socket->Append("VAero");
+    socket->Append("WAero");
     socket->Append("Vn");
     socket->Append("Ve");
     socket->Append("Vd");
@@ -504,9 +511,12 @@ void FGOutput::SocketOutput(void)
   socket->Append(Rotation->Getpsi());
   socket->Append(Atmosphere->GetDensity());
   socket->Append(Translation->GetVt());
-  socket->Append(Translation->GetU());
-  socket->Append(Translation->GetV());
-  socket->Append(Translation->GetW());
+  socket->Append(Translation->GetUVW(eU));
+  socket->Append(Translation->GetUVW(eV));
+  socket->Append(Translation->GetUVW(eW));
+  socket->Append(Translation->GetvAero(eU));
+  socket->Append(Translation->GetvAero(eV));
+  socket->Append(Translation->GetvAero(eW));
   socket->Append(Position->GetVn());
   socket->Append(Position->GetVe());
   socket->Append(Position->GetVd());
index e8e09b867c0fc43e1a38954c5a76b00fd97672b3..078f495b8a9a4336aa0fb33bde582cdc0f4b2e70 100644 (file)
@@ -93,7 +93,6 @@ extern double globalSceneryAltitude;
 extern double globalSeaLevelRadius;
 
 FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex),
-    vUVW(3),
     vVel(3),
     vVelDot(3),
     vRunwayNormal(3)
@@ -184,9 +183,8 @@ bool FGPosition:: Run(void) {
 void FGPosition::GetState(void) {
   dt = State->Getdt();
 
-  vUVW      = Translation->GetUVW();
   Vt        = Translation->GetVt();
-  vVel      = State->GetTb2l()*vUVW + Atmosphere->GetWindNED();
+  vVel      = State->GetTb2l() * Translation->GetUVW();
   vVelDot   = State->GetTb2l() * Translation->GetUVWdot();
 
   b = Aircraft->GetWingSpan();
index acb7c265b7234e8c3913452f17812af8a243d797..97d57d6107a7e80ad9dcdc80db020cf51386cf25 100644 (file)
@@ -83,7 +83,6 @@ public:
   
   inline FGColumnVector GetVel(void) { return vVel; }
   inline FGColumnVector GetVelDot(void) { return vVelDot; }
-  inline FGColumnVector GetUVW(void) { return vUVW; }
   inline double GetVn(void)  { return vVel(eX); }
   inline double GetVe(void)  { return vVel(eY); }
   inline double GetVd(void)  { return vVel(eZ); }
@@ -115,7 +114,6 @@ public:
   }
   
 private:  
-  FGColumnVector vUVW;
   FGColumnVector vVel;
   FGColumnVector vVelDot;
   FGColumnVector vRunwayNormal;
index 650654047d46b9819ebee550e996a7484dd2e060..b37f66bdefad722818ca4c85bce8db687048a8c3 100644 (file)
@@ -140,7 +140,7 @@ FGPropeller::~FGPropeller()
 float FGPropeller::Calculate(float PowerAvailable)
 {
   float J, C_Thrust, omega;
-  float Vel = (fdmex->GetTranslation()->GetUVW())(1);
+  float Vel = (fdmex->GetTranslation()->GetvAero())(1);
   float rho = fdmex->GetAtmosphere()->GetDensity();
   float RPS = RPM/60.0;
 
@@ -175,7 +175,7 @@ float FGPropeller::GetPowerRequired(void)
 
   float cPReq, RPS = RPM / 60.0;
 
-  float J = (fdmex->GetTranslation()->GetUVW())(1) / (Diameter * RPS);
+  float J = (fdmex->GetTranslation()->GetvAero())(1) / (Diameter * RPS);
   float rho = fdmex->GetAtmosphere()->GetDensity();
 
   if (MaxPitch == MinPitch) { // Fixed pitch prop
index f31f1ed34606cff5714b24f0ef0d976fb106c4de..d95c8971ac22f80f0c098e488a8eda5372776729 100644 (file)
@@ -143,7 +143,7 @@ bool FGPropulsion::GetSteadyState(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGPropulsion::LoadPropulsion(FGConfigFile* AC_cfg)
+bool FGPropulsion::Load(FGConfigFile* AC_cfg)
 {
   string token, fullpath;
   string engineFileName, engType;
index 524cfefcbafa0a1bcd2315401be8c5c1c243ce08..56e38c9980389e379d27fa3ff73ba93a904f593c 100644 (file)
@@ -123,7 +123,7 @@ public:
       @param AC_cfg pointer to the config file instance that describes the
              aircraft being modeled.
       @return true if successfully loaded, otherwise false */
-  bool LoadPropulsion(FGConfigFile* AC_cfg);
+  bool Load(FGConfigFile* AC_cfg);
 
   /// Retrieves the number of engines defined for the aircraft.
   inline unsigned int GetNumEngines(void) {return Engines.size();}
index 40b37267b81a3d52137d2445474a7831c6bcb46a..65274d9fccc6685baf0ae6b2a5174e32905d753d 100644 (file)
@@ -87,7 +87,8 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex),
     vForces(3),
     vEuler(3),
     vlastUVWdot(3),
-    mVel(3,3)
+    mVel(3,3),
+    vAero(3)
 {
   Name = "FGTranslation";
   qbar = 0;
@@ -130,28 +131,29 @@ bool FGTranslation::Run(void) {
     vNcg = vUVWdot*INVGRAVITY;
 
     vUVW += 0.5*dt*rate*(vlastUVWdot + vUVWdot);
+    vAero = vUVW + State->GetTl2b()*Atmosphere->GetWindNED();
 
-    Vt = vUVW.Magnitude();
+    Vt = vAero.Magnitude();
 
-    if (vUVW(eW) != 0.0)
-      alpha = vUVW(eU)*vUVW(eU) > 0.0 ? atan2(vUVW(eW), vUVW(eU)) : 0.0;
-    if (vUVW(eV) != 0.0)
-      beta = vUVW(eU)*vUVW(eU)+vUVW(eW)*vUVW(eW) > 0.0 ? atan2(vUVW(eV),
-             sqrt(vUVW(eU)*vUVW(eU) + vUVW(eW)*vUVW(eW))) : 0.0;
+    if (vAero(eW) != 0.0)
+      alpha = vAero(eU)*vAero(eU) > 0.0 ? atan2(vAero(eW), vAero(eU)) : 0.0;
+    if (vAero(eV) != 0.0)
+      beta = vAero(eU)*vAero(eU)+vAero(eW)*vAero(eW) > 0.0 ? atan2(vAero(eV),
+             sqrt(vAero(eU)*vAero(eU) + vAero(eW)*vAero(eW))) : 0.0;
 
     // stolen, quite shamelessly, from LaRCsim
-    float mUW = (vUVW(eU)*vUVW(eU) + vUVW(eW)*vUVW(eW));
+    float mUW = (vAero(eU)*vAero(eU) + vAero(eW)*vAero(eW));
     float signU=1;
-    if (vUVW(eU) != 0.0)
-      signU = vUVW(eU)/fabs(vUVW(eU));
+    if (vAero(eU) != 0.0)
+      signU = vAero(eU)/fabs(vAero(eU));
 
     if ( (mUW == 0.0) || (Vt == 0.0) ) {
       adot = 0.0;
       bdot = 0.0;
     } else {
-      adot = (vUVW(eU)*vUVWdot(eW) - vUVW(eW)*vUVWdot(eU))/mUW;
-      bdot = (signU*mUW*vUVWdot(eV) - vUVW(eV)*(vUVW(eU)*vUVWdot(eU)
-              + vUVW(eW)*vUVWdot(eW)))/(Vt*Vt*sqrt(mUW));
+      adot = (vAero(eU)*vAero(eW) - vAero(eW)*vUVWdot(eU))/mUW;
+      bdot = (signU*mUW*vUVWdot(eV) - vAero(eV)*(vAero(eU)*vUVWdot(eU)
+              + vAero(eW)*vUVWdot(eW)))/(Vt*Vt*sqrt(mUW));
     }
 
     qbar = 0.5*rho*Vt*Vt;
index 08e85453ee18723dd51590c623096355d31ba5e6..1729a9d85eb66126b9daef0fabdcbc509e1260b9 100644 (file)
@@ -87,6 +87,8 @@ public:
   inline float          GetUVWdot(int idx) { return vUVWdot(idx); }
   inline FGColumnVector GetNcg   (void)    { return vNcg; }
   inline float          GetNcg   (int idx) { return vNcg(idx); }
+  inline FGColumnVector GetvAero (void)    { return vAero; }
+  inline float          GetvAero (int idx) { return vAero(idx); }
 
   inline float Getalpha(void) { return alpha; }
   inline float Getbeta (void) { return beta; }
@@ -121,6 +123,7 @@ private:
   FGColumnVector vEuler;
   FGColumnVector vlastUVWdot;
   FGMatrix       mVel;
+  FGColumnVector vAero;
 
   float Vt, qbar, Mach;
   float Mass, dt;
index 400b6088b63ea20f2e47e9170d9874eb303e2735..3760784cec4dbe588598cd76c2fdc1b71853c7a7 100644 (file)
@@ -88,7 +88,7 @@ USEUNIT("FGNozzle.cpp");
 USEUNIT("FGOutput.cpp");
 USEUNIT("FGPiston.cpp");
 USEUNIT("FGPosition.cpp");
-USEUNIT("FGPropeller.cpp");
+USEUNIT("FGJSBBase.cpp");
 USEUNIT("FGPropulsion.cpp");
 USEUNIT("FGRocket.cpp");
 USEUNIT("FGRotation.cpp");
@@ -112,6 +112,7 @@ USEUNIT("filtersjb\FGGain.cpp");
 USEUNIT("filtersjb\FGGradient.cpp");
 USEUNIT("filtersjb\FGSummer.cpp");
 USEUNIT("filtersjb\FGDeadBand.cpp");
+USEUNIT("FGPropeller.cpp");
 //---------------------------------------------------------------------------
 #endif