]> git.mxchange.org Git - flightgear.git/commitdiff
Syncing with most recent JSBSim.
authorcurt <curt>
Fri, 7 Dec 2001 17:10:17 +0000 (17:10 +0000)
committercurt <curt>
Fri, 7 Dec 2001 17:10:17 +0000 (17:10 +0000)
28 files changed:
src/FDM/JSBSim.cxx
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGColumnVector3.cpp
src/FDM/JSBSim/FGColumnVector3.h
src/FDM/JSBSim/FGColumnVector4.cpp
src/FDM/JSBSim/FGColumnVector4.h
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGForce.cpp
src/FDM/JSBSim/FGForce.h
src/FDM/JSBSim/FGGroundReactions.cpp
src/FDM/JSBSim/FGInertial.cpp
src/FDM/JSBSim/FGLGear.cpp
src/FDM/JSBSim/FGMassBalance.cpp
src/FDM/JSBSim/FGMassBalance.h
src/FDM/JSBSim/FGOutput.cpp
src/FDM/JSBSim/FGPiston.cpp
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropeller.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGPropulsion.h
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTranslation.cpp

index b952113c19bfb3a1c97eac95b9ed7af3c28793a8..d37caa6e769b97b14c3a5efd9bf545432d038bca 100644 (file)
@@ -263,7 +263,7 @@ bool FGJSBsim::update( int multiloop ) {
         fdmex->Run();
     }
 
-    struct FGJSBBase::Message* msg;
+    FGJSBBase::Message* msg;
     while (fdmex->ReadMessage()) {
       msg = fdmex->ProcessMessage();
       switch (msg->type) {
index 523c73fc2dbf0da3f9a2b8a29bbb74b6121846a8..10e0b18bae87c8494d86bcec9b4a04ab6b0a8395 100644 (file)
@@ -48,12 +48,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGAerodynamics::FGAerodynamics(FGFDMExec* FDMExec) : FGModel(FDMExec),
-    vFs(3),
-    vForces(3),
-    vMoments(3),
-    vLastFs(3),
-    vDXYZcg(3)
+FGAerodynamics::FGAerodynamics(FGFDMExec* FDMExec) : FGModel(FDMExec)
 {
   Name = "FGAerodynamics";
 
index 214dd844641626b5717915b7e0d50936f64e115e..52c8ef5ab71c6549e1223285f2a7fdcd4a60556b 100644 (file)
@@ -98,15 +98,7 @@ static const char *IdHdr = ID_AIRCRAFT;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex),
-    vMoments(3),
-    vForces(3),
-    vXYZrp(3),
-    vXYZep(3),
-    vDXYZcg(3),
-    vBodyAccel(3),
-    vNcg(3),
-    vNwcg(3)
+FGAircraft::FGAircraft(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGAircraft";
   alphaclmin = alphaclmax = 0;
@@ -237,8 +229,9 @@ bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
 {
   string token = "";
   string parameter;
-  double EW, bixx, biyy, bizz, bixz, biyz;
-  FGColumnVector3 vbaseXYZcg(3);
+  double EW, bixx, biyy, bizz, bixy, bixz;
+  double pmWt, pmX, pmY, pmZ;
+  FGColumnVector3 vbaseXYZcg;
 
   AC_cfg->GetNextConfigLine();
 
@@ -280,14 +273,14 @@ bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
       *AC_cfg >> bizz;
       if (debug_lvl > 0) cout << "    baseIzz: " << bizz << endl;
       MassBalance->SetBaseIzz(bizz);
+    } else if (parameter == "AC_IXY") {
+      *AC_cfg >> bixy;
+      if (debug_lvl > 0) cout << "    baseIxy: " << bixy  << endl;
+      MassBalance->SetBaseIxy(bixy);
     } else if (parameter == "AC_IXZ") {
       *AC_cfg >> bixz;
       if (debug_lvl > 0) cout << "    baseIxz: " << bixz  << endl;
       MassBalance->SetBaseIxz(bixz);
-    } else if (parameter == "AC_IYZ") {
-      *AC_cfg >> biyz;
-      if (debug_lvl > 0) cout << "    baseIyz: " << biyz  << endl;
-      MassBalance->SetBaseIyz(biyz);
     } else if (parameter == "AC_EMPTYWT") {
       *AC_cfg >> EW;
       MassBalance->SetEmptyWeight(EW);
@@ -307,6 +300,11 @@ bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
       if (debug_lvl > 0) cout << "    Maximum Alpha: " << alphaclmax
              << "    Minimum Alpha: " << alphaclmin
              << endl;
+    } else if (parameter == "AC_POINTMASS") {
+      *AC_cfg >> pmWt >> pmX >> pmY >> pmZ;
+      if (debug_lvl > 0) cout << "    Point Mass Object: " << pmWt << " lbs. at "
+                         << "X, Y, Z (in.): " << pmX << "  " << pmY << "  " << pmZ
+                         << endl;
     }
   }
   
index 9d677b55e8a849bfa75e73a00f55c76996604d3e..318516a5f318394a27074695cdba49faae014174 100644 (file)
@@ -68,15 +68,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGAtmosphere::FGAtmosphere(FGFDMExec* fdmex) : FGModel(fdmex),
-                                               vDirectiondAccelDt(3),
-                                               vDirectionAccel(3),
-                                               vDirection(3),
-                                               vTurbulence(3),
-                                               vTurbulenceGrad(3),
-                                               vBodyTurbGrad(3),
-                                               vTurbPQR(3),
-                                               vWindNED(3)
+FGAtmosphere::FGAtmosphere(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGAtmosphere";
   lastIndex=0;
index 46f157545c833f24a6c346f4c58306d7410a02ad..65c9fd755a023742d97a675848757bf2f550d831 100644 (file)
@@ -63,9 +63,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex),
-  vPilotAccel(3),
-  vToEyePt(3)
+FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGAuxiliary";
   vcas = veas = mach = qbar = pt = 0;
index 0c27fa4d056eabff7ec20f2838a33fa1436e7485..b974bea86b36ad7c3276e37ad6193a1876ae6482 100644 (file)
@@ -1,9 +1,9 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Module: FGMatrix33.cpp
+Module: FGColumnVector3.cpp
 Author: Originally by Tony Peden [formatted here (and broken??) by JSB]
 Date started: 1998
-Purpose: FGMatrix33 class
+Purpose: FGColumnVector3 class
 Called by: Various
 
 FUNCTIONAL DESCRIPTION
@@ -19,8 +19,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGColumnVector3.h"
-#include "FGMatrix33.h"
-
 
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_COLUMNVECTOR3;
@@ -39,10 +37,10 @@ FGColumnVector3::FGColumnVector3(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector3::FGColumnVector3(int m)
+FGColumnVector3::FGColumnVector3(double X, double Y, double Z)
 {
   rowCtr = 1;
-  data[0]=0; data[1]=0; data[2]=0; data[3]=0;
+  data[0] = 0; data[eX] = X; data[eY] = Y; data[eZ] = Z;
 
   if (debug_lvl & 2) cout << "Instantiated: FGColumnVector3" << endl;
 }
@@ -81,29 +79,6 @@ FGColumnVector3 FGColumnVector3::operator=(const FGColumnVector3& b)
   return *this;
 }
 
-
-/* //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-double& FGColumnVector3::operator()(int m) const
-{
-  return data[m];
-}
- */
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-/* FGColumnVector3 operator*(const FGMatrix33& Mat, FGColumnVector3& Col)
-{
-  FGColumnVector3 Product;
-
-  Product(1) = Col(1)*Mat(1,1) + Col(2)*Mat(1,2) + Col(3)*Mat(1,3);
-  Product(2) = Col(1)*Mat(2,1) + Col(2)*Mat(2,2) + Col(3)*Mat(2,3);
-  Product(3) = Col(1)*Mat(3,1) + Col(2)*Mat(3,2) + Col(3)*Mat(3,3);
-
-  return Product;
-}
- */
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGColumnVector3 FGColumnVector3::operator+(const FGColumnVector3& C)
@@ -292,13 +267,6 @@ FGColumnVector3 FGColumnVector3::multElementWise(const FGColumnVector3& V)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGColumnVector3::Debug(void)
-{
-    //TODO: Add your source code here
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 ostream& operator<<(ostream& os, const FGColumnVector3& col)
 {
   os << col(1) << " , " << col(2) << " , " << col(3);
@@ -314,3 +282,11 @@ FGColumnVector3& FGColumnVector3::operator<<(const double ff)
       rowCtr = 1;
   return *this;
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGColumnVector3::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 6c61b3ec65af65976b2c9e64244d2e4dd6f80a3d..20572e427547905fda282c588a8fd7c101b88523 100644 (file)
@@ -1,13 +1,11 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Header: FGMatrix33.h
+Header: FGColumnVector3.h
 Author: Originally by Tony Peden [formatted and adapted here by Jon Berndt]
 Date started: Unknown
 
 HISTORY
 --------------------------------------------------------------------------------
-??/??/??   TP   Created
-03/16/2000 JSB  Added exception throwing
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
@@ -54,7 +52,6 @@ INCLUDES
    using std::string;
 #endif
 
-#include "FGMatrix33.h"
 #include "FGJSBBase.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -67,8 +64,6 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGMatrix33;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DECLARATION: FGColumnVector3
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -77,7 +72,7 @@ class FGColumnVector3 : public FGJSBBase
 {
 public:
   FGColumnVector3(void);
-  FGColumnVector3(int m);
+  FGColumnVector3(double X, double Y, double Z);
   FGColumnVector3(const FGColumnVector3& b);
   ~FGColumnVector3(void);
   
@@ -104,7 +99,6 @@ public:
   FGColumnVector3 Normalize(void);
 
   friend FGColumnVector3 operator*(const double scalar, const FGColumnVector3& A);
-  //friend FGColumnVector3 operator*(const FGMatrix33& M, FGColumnVector3& V);
 
   friend ostream& operator<<(ostream& os, const FGColumnVector3& col);
 
index 1a1b6f26c8ce3fef1b410386a920e9f3f52f45b3..6f76cdc24e9c6b94454f14329162af9e5758899d 100644 (file)
@@ -30,17 +30,18 @@ CLASS IMPLEMENTATION
 FGColumnVector4::FGColumnVector4(void)
 {
   rowCtr = 1;
-  //cout << "Allocated: " <<  data << endl;
+  data[1]=0;data[2]=0;data[3]=0;data[4]=0;
+
   if (debug_lvl & 2) cout << "Instantiated: FGColumnVector4" << endl;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector4::FGColumnVector4(int m)
+FGColumnVector4::FGColumnVector4(double A, double B, double C, double D)
 {
   rowCtr = 1;
   data[1]=0;data[2]=0;data[3]=0;data[4]=0;
-  //cout << "Allocated: " <<  data << endl;
+
   if (debug_lvl & 2) cout << "Instantiated: FGColumnVector4" << endl;
 }
 
@@ -48,7 +49,6 @@ FGColumnVector4::FGColumnVector4(int m)
 
 FGColumnVector4::~FGColumnVector4(void)
 {
-  //cout << "Freed: " << data << endl;
   if (debug_lvl & 2) cout << "Destroyed:    FGColumnVector4" << endl;
 }
 
@@ -240,34 +240,6 @@ FGColumnVector4 FGColumnVector4::Normalize(void)
   return *this;
 }
 
-/* //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-FGColumnVector4 FGColumnVector4::operator*(const FGColumnVector4& V)
-{
-  FGColumnVector4 Product;
-  
-  Product(1) = data[2] * V(3) - data[3] * V(2);
-  Product(2) = data[3] * V(1) - data[1] * V(3);
-  Product(3) = data[1] * V(2) - data[2] * V(1);
-
-  return Product;
-} */
-
-
-/* //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-void FGColumnVector4::operator*=(const FGColumnVector4& V)
-{
-  double a,b,c;
-  a = data[1]; b=data[2]; c=data[3];
-  
-  data[1] = b * V(3) - c * V(2);
-  data[2] = c * V(1) - a * V(3);
-  data[3] = a * V(2) - b * V(1);
-
-}
- */
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGColumnVector4 FGColumnVector4::multElementWise(const FGColumnVector4& V)
@@ -284,13 +256,6 @@ FGColumnVector4 FGColumnVector4::multElementWise(const FGColumnVector4& V)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGColumnVector4::Debug(void)
-{
-    //TODO: Add your source code here
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 ostream& operator<<(ostream& os, FGColumnVector4& col)
 {
   os << col(1) << " , " << col(2) << " , " << col(3) << " , " << col(4);
@@ -302,8 +267,14 @@ ostream& operator<<(ostream& os, FGColumnVector4& col)
 FGColumnVector4& FGColumnVector4::operator<<(const double ff)
 {
   data[rowCtr] = ff;
-  if (++rowCtr > 4 )
-      rowCtr = 1;
+  if (++rowCtr > 4) rowCtr = 1;
   return *this;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGColumnVector4::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 1a47539d15f2f595154dc43223c275cd27477552..db311dfcbb284cdf0d034b2c679f7552ab92b9ee 100644 (file)
@@ -1,13 +1,11 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Header: FGMatrix33.h
+Header: FGColumnVector4.h
 Author: Originally by Tony Peden [formatted and adapted here by Jon Berndt]
 Date started: Unknown
 
 HISTORY
 --------------------------------------------------------------------------------
-??/??/??   TP   Created
-03/16/2000 JSB  Added exception throwing
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
@@ -74,21 +72,19 @@ class FGColumnVector4 : public FGJSBBase
 {
 public:
   FGColumnVector4(void);
-  FGColumnVector4(int m);
+  FGColumnVector4(double A, double B, double C, double D);
   FGColumnVector4(const FGColumnVector4& b);
   ~FGColumnVector4(void);
   
   FGColumnVector4 operator=(const FGColumnVector4& b);
   
   FGColumnVector4 operator*(const double scalar);
-  //FGColumnVector4 operator*(const FGColumnVector4& V);   // Cross product operator
   FGColumnVector4 operator/(const double scalar);
   FGColumnVector4 operator+(const FGColumnVector4& B); // must not return reference
   FGColumnVector4 operator-(const FGColumnVector4& B);
   
   void operator-=(const FGColumnVector4 &B);
   void operator+=(const FGColumnVector4 &B);
-  //void operator*=(const FGColumnVector4 &B);
   void operator*=(const double scalar);
   void operator/=(const double scalar);
   
@@ -97,8 +93,8 @@ public:
   
   FGColumnVector4& operator<<(const double ff);
 
-  inline void InitMatrix(void) { data[1]=0; data[2]=0; data[3]=0; }
-  inline void InitMatrix(double ff) { data[1]=ff; data[2]=ff; data[3]=ff; }
+  inline void InitMatrix(void) { data[1]=0; data[2]=0; data[3]=0; data[4]=0; }
+  inline void InitMatrix(double ff) { data[1]=ff; data[2]=ff; data[3]=ff; data[4]=ff;}
 
   double Magnitude(void);
   FGColumnVector4 Normalize(void);
@@ -118,3 +114,4 @@ private:
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+
index a2fdd683e001c3ea72a4d669e13f562284cee3d8..5666b2ef0e67bd39f5fc79c72661fdd5ccaa41e6 100644 (file)
@@ -583,8 +583,6 @@ bool FGFDMExec::LoadScript(string script)
     cerr << "Aircraft file " << aircraft << " was not found" << endl;
          exit(-1);
   }
-  if ( ! State->Reset("aircraft", aircraft, initialize))
-                 State->Initialize(2000,0,0,0,0,0,0.5,0.5,40000,0,0,0);
 
   return true;
 }
@@ -640,6 +638,7 @@ void FGFDMExec::RunScript(void)
             iC->newValue[i] = iC->OriginalValue[i] + iC->SetValue[i];
             break;
           case FG_BOOL:
+            iC->newValue[i] = iC->SetValue[i];
             break;
           default:
             cerr << "Invalid Type specified" << endl;
@@ -651,7 +650,7 @@ void FGFDMExec::RunScript(void)
 
         switch (iC->Action[i]) {
         case FG_RAMP:
-          newSetValue = (currentTime - iC->StartTime[i])/(iC->TC[i])
+        newSetValue = (currentTime - iC->StartTime[i])/(iC->TC[i])
                       * (iC->newValue[i] - iC->OriginalValue[i]) + iC->OriginalValue[i];
           if (newSetValue > iC->newValue[i]) newSetValue = iC->newValue[i];
           break;
@@ -667,9 +666,6 @@ void FGFDMExec::RunScript(void)
           break;
         }
         State->SetParameter(iC->SetParam[i], newSetValue);
-        if ((unsigned long int)Propulsion->GetTank(0) == 0) {
-          cout << "Param # getting set: " << iC->SetParam[i] << " Value: " << newSetValue << endl;
-        }
       }
     }
     iC++;
index 3125e7936f270b9e37f4cf06ff1afd844737e6fe..9fde7b6a91df568e43310b3daf74d047cde3f1b0 100644 (file)
@@ -294,18 +294,18 @@ private:
   struct condition {
     vector <eParam>  TestParam;
     vector <eParam>  SetParam;
-    vector <double>   TestValue;
-    vector <double>   SetValue;
+    vector <double>  TestValue;
+    vector <double>  SetValue;
     vector <string>  Comparison;
-    vector <double>   TC;
+    vector <double>  TC;
     vector <bool>    Persistent;
     vector <eAction> Action;
     vector <eType>   Type;
     vector <bool>    Triggered;
-    vector <double>   newValue;
-    vector <double>   OriginalValue;
-    vector <double>   StartTime;
-    vector <double>   EndTime;
+    vector <double>  newValue;
+    vector <double>  OriginalValue;
+    vector <double>  StartTime;
+    vector <double>  EndTime;
 
     condition() {
     }
index b3352851bff2dc6878ae466bd85be17a8332f4c3..a1bd2172f2be04ea1ad70eef6cd731971a0fbf40 100644 (file)
@@ -54,18 +54,8 @@ static const char *IdHdr = ID_FORCE;
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGForce::FGForce(FGFDMExec *FDMExec) :
-    ttype(tNone),
-    fdmex(FDMExec),
-    vFn(3),
-    vMn(3),
-    vH(3),
-    vFb(3),
-    vM(3),
-    vXYZn(3),
-    vDXYZ(3),
-    vSense(3),
-    mT(3,3)
-    
+                 ttype(tNone),
+                 fdmex(FDMExec)
 {
   mT(1,1) = 1; //identity matrix
   mT(2,2) = 1;
@@ -83,15 +73,17 @@ FGForce::~FGForce()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector3& FGForce::GetBodyForces(void) {
-
+FGColumnVector3& FGForce::GetBodyForces(void)
+{
   vFb = Transform()*(vFn.multElementWise(vSense));
 
-  //find the distance from this vector's location to the cg
-  //needs to be done like this to convert from structural to body coords
-  vDXYZ(1) = -(vXYZn(1) - fdmex->GetMassBalance()->GetXYZcg(1))*inchtoft;
-  vDXYZ(2) =  (vXYZn(2) - fdmex->GetMassBalance()->GetXYZcg(2))*inchtoft;  //cg and rp values are in inches
-  vDXYZ(3) = -(vXYZn(3) - fdmex->GetMassBalance()->GetXYZcg(3))*inchtoft;
+  // Find the distance from this vector's acting location to the cg; this
+  // needs to be done like this to convert from structural to body coords.
+  // CG and RP values are in inches
+
+  vDXYZ(eX) = -(vActingXYZn(eX) - fdmex->GetMassBalance()->GetXYZcg(eX))*inchtoft;
+  vDXYZ(eY) =  (vActingXYZn(eY) - fdmex->GetMassBalance()->GetXYZcg(eY))*inchtoft;
+  vDXYZ(eZ) = -(vActingXYZn(eZ) - fdmex->GetMassBalance()->GetXYZcg(eZ))*inchtoft;
 
   vM = vMn + vDXYZ*vFb;
 
@@ -100,7 +92,8 @@ FGColumnVector3& FGForce::GetBodyForces(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGMatrix33 FGForce::Transform(void) {
+FGMatrix33 FGForce::Transform(void)
+{
   switch(ttype) {
   case tWindBody:
     return fdmex->GetState()->GetTs2b();
@@ -118,9 +111,9 @@ FGMatrix33 FGForce::Transform(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGForce::SetAnglesToBody(double broll, double bpitch, double byaw) {
-
-  if(ttype == tCustom) {
+void FGForce::SetAnglesToBody(double broll, double bpitch, double byaw)
+{
+  if (ttype == tCustom) {
     double cp,sp,cr,sr,cy,sy;
 
     cp=cos(bpitch); sp=sin(bpitch);
@@ -139,7 +132,6 @@ void FGForce::SetAnglesToBody(double broll, double bpitch, double byaw) {
     mT(3,2)=cr*sp*sy-sr*cy;
     mT(3,3)=cr*cp;
   }
-
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 661434480acba231642c7294b33716d6fd0aad94..595667574099b820d21aae1d7d8a4369981d0845 100644 (file)
@@ -244,27 +244,49 @@ public:
   inline FGColumnVector3& GetNativeForces(void) { return vFn; }
   inline FGColumnVector3& GetNativeMoments(void) { return vMn; }
 
-
   FGColumnVector3& GetBodyForces(void);
 
   inline FGColumnVector3& GetMoments(void) { return vM; }
 
-  //point of application, JSBsim structural coords
-  //(inches, x +back, y +right, z +up)
+  // Normal point of application, JSBsim structural coords
+  // (inches, x +back, y +right, z +up)
   inline void SetLocation(double x, double y, double z) {
-    vXYZn(1) = x;
-    vXYZn(2) = y;
-    vXYZn(3) = z;
+    vXYZn(eX) = x;
+    vXYZn(eY) = y;
+    vXYZn(eZ) = z;
+    SetActingLocation(x, y, z);
+  }
+  
+  /** Acting point of application.
+      JSBsim structural coords used (inches, x +back, y +right, z +up).
+      This function sets the point at which the force acts - this may
+      not be the same as where the object resides. One area where this
+      is true is P-Factor modeling.
+      @param x acting location of force
+      @param y acting location of force
+      @param z acting location of force    */
+  inline void SetActingLocation(double x, double y, double z) {
+    vActingXYZn(eX) = x;
+    vActingXYZn(eY) = y;
+    vActingXYZn(eZ) = z;
   }
-  inline void SetLocationX(double x) {vXYZn(1) = x;}
-  inline void SetLocationY(double y) {vXYZn(2) = y;}
-  inline void SetLocationZ(double z) {vXYZn(3) = z;}
-  inline void SetLocation(FGColumnVector3 vv) { vXYZn = vv; }
+  inline void SetLocationX(double x) {vXYZn(eX) = x; vActingXYZn(eX) = x;}
+  inline void SetLocationY(double y) {vXYZn(eY) = y; vActingXYZn(eY) = y;}
+  inline void SetLocationZ(double z) {vXYZn(eZ) = z; vActingXYZn(eZ) = z;}
+  inline double SetActingLocationX(double x) {vActingXYZn(eX) = x; return x;}
+  inline double SetActingLocationY(double y) {vActingXYZn(eY) = y; return y;}
+  inline double SetActingLocationZ(double z) {vActingXYZn(eZ) = z; return z;}
+  inline void SetLocation(FGColumnVector3 vv) { vXYZn = vv; SetActingLocation(vv);}
+  inline void SetActingLocation(FGColumnVector3 vv) { vActingXYZn = vv; }
   
-  inline double GetLocationX( void ) { return vXYZn(1);}
-  inline double GetLocationY( void ) { return vXYZn(2);}
-  inline double GetLocationZ( void ) { return vXYZn(3);}
+  inline double GetLocationX( void ) { return vXYZn(eX);}
+  inline double GetLocationY( void ) { return vXYZn(eY);}
+  inline double GetLocationZ( void ) { return vXYZn(eZ);}
+  inline double GetActingLocationX( void ) { return vActingXYZn(eX);}
+  inline double GetActingLocationY( void ) { return vActingXYZn(eY);}
+  inline double GetActingLocationZ( void ) { return vActingXYZn(eZ);}
   FGColumnVector3& GetLocation(void) { return vXYZn; }
+  FGColumnVector3& GetActingLocation(void) { return vActingXYZn; }
 
   //these angles are relative to body axes, not earth!!!!!
   //I'm using these because pitch, roll, and yaw are easy to visualize,
@@ -274,9 +296,11 @@ public:
   //They are in radians.
 
   void SetAnglesToBody(double broll, double bpitch, double byaw);
-  inline void  SetAnglesToBody(FGColumnVector3 vv) { SetAnglesToBody(vv(1), vv(2), vv(3));}
+  inline void  SetAnglesToBody(FGColumnVector3 vv) {
+    SetAnglesToBody(vv(eRoll), vv(ePitch), vv(eYaw));
+  }
 
-  inline void SetSense(double x, double y, double z) { vSense(1)=x, vSense(2)=y, vSense(3)=z; }
+  inline void SetSense(double x, double y, double z) { vSense(eX)=x, vSense(eY)=y, vSense(eZ)=z; }
   inline void SetSense(FGColumnVector3 vv) { vSense=vv; }
 
   inline FGColumnVector3& GetSense(void) { return vSense; }
@@ -298,6 +322,7 @@ private:
   FGColumnVector3 vFb;
   FGColumnVector3 vM;
   FGColumnVector3 vXYZn;
+  FGColumnVector3 vActingXYZn;
   FGColumnVector3 vDXYZ;
   FGColumnVector3 vSense;
 
index 794225aa9b362a7abb410a6d01400ef5205ddf24..9156f28e4a6481dc7c0c875f92edc50ae72abff6 100644 (file)
@@ -45,11 +45,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGGroundReactions::FGGroundReactions(FGFDMExec* fgex) : FGModel(fgex),
-                                                        vForces(3),
-                                                        vMoments(3),
-                                                        vMaxStaticGrip(3),
-                                                        vMaxMomentResist(3)
+FGGroundReactions::FGGroundReactions(FGFDMExec* fgex) : FGModel(fgex)
 {
   Name = "FGGroundReactions";
 
index c2632e3d5d0d221fa5465c49c575898ed515b531..f5189108fc8cb6a62f2890ecc20c00e121c61d77 100644 (file)
@@ -47,11 +47,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGInertial::FGInertial(FGFDMExec* fgex) : FGModel(fgex),
-    vOmegaLocal(3),
-    vForces(3),
-    vRadius(3),
-    vGravity(3)
+FGInertial::FGInertial(FGFDMExec* fgex) : FGModel(fgex)
 {
   Name = "FGInertial";
 
index 4826990ded172d84f4956ca4a4c7fdaa820ff9f1..eb42ff08a8a6cbf882efa1109163b60b15687f23 100644 (file)
@@ -57,13 +57,7 @@ static const char *IdHdr = ID_LGEAR;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3),
-                                                           vMoment(3),
-                                                           vWhlBodyVec(3),
-                                                           vForce(3),
-                                                           vLocalForce(3),
-                                                           vWhlVelVec(3),
-                                                           Exec(fdmex)
+FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : Exec(fdmex)
 {
   string tmp;
   string Retractable;
@@ -202,19 +196,24 @@ FGColumnVector3& FGLGear::Force(void)
 {
   vForce.InitMatrix();
   vMoment.InitMatrix();
-  if(isRetractable ) {
-    if( FCS->GetGearPos() < 0.01 ) {
-      GearUp=true;GearDown=false;
-     } else if(FCS->GetGearPos() > 0.99) {
-      GearDown=true;GearUp=false;
+
+  if (isRetractable) {
+    if (FCS->GetGearPos() < 0.01) {
+      GearUp   = true;
+      GearDown = false;
+     } else if (FCS->GetGearPos() > 0.99) {
+      GearDown = true;
+      GearUp   = false;
      } else {
-      GearUp=false; GearDown=false;
+      GearUp   = false;
+      GearDown = false;
      }
   } else {
-      GearUp=false; GearDown=true;
+      GearUp   = false;
+      GearDown = true;
   }         
       
-  if( GearDown ) {
+  if (GearDown) {
     double SteerGain = 0;
     double SinWheel, CosWheel, SideWhlVel, RollingWhlVel;
     double RollingForce, SideForce, FCoeff;
index f6f87391d856c9401b1c17cefe68a0afe44baa01..a7f2eb93bf40196047693733252e405b4a1de1fc 100644 (file)
@@ -68,20 +68,22 @@ bool FGMassBalance::Run(void)
 {
   if (!FGModel::Run()) {
 
-    Weight = EmptyWeight + Propulsion->GetTanksWeight();
+    Weight = EmptyWeight + Propulsion->GetTanksWeight() + GetPointMassWeight();
 
     Mass = Weight / Inertial->gravity();
 
 // Calculate new CG here.
 
-    vXYZcg = (Propulsion->GetTanksCG() + EmptyWeight*vbaseXYZcg) / Weight;
+    vXYZcg = (Propulsion->GetTanksCG() + EmptyWeight*vbaseXYZcg
+                                       + GetPointMassCG()       ) / Weight;
 
 // Calculate new moments of inertia here
 
-    Ixx = baseIxx + Propulsion->GetTanksIxx(vXYZcg);
-    Iyy = baseIyy + Propulsion->GetTanksIyy(vXYZcg);
-    Izz = baseIzz + Propulsion->GetTanksIzz(vXYZcg);
-    Ixz = baseIxz + Propulsion->GetTanksIxz(vXYZcg);
+    Ixx = baseIxx + Propulsion->GetTanksIxx(vXYZcg) + GetPMIxx();
+    Iyy = baseIyy + Propulsion->GetTanksIyy(vXYZcg) + GetPMIyy();
+    Izz = baseIzz + Propulsion->GetTanksIzz(vXYZcg) + GetPMIzz();
+    Ixy = baseIxy + Propulsion->GetTanksIxy(vXYZcg) + GetPMIxy();
+    Ixz = baseIxz + Propulsion->GetTanksIxz(vXYZcg) + GetPMIxz();
 
     if (debug_lvl > 1) Debug();
 
@@ -93,6 +95,98 @@ bool FGMassBalance::Run(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+void FGMassBalance::AddPointMass(double weight, double X, double Y, double Z)
+{
+  PointMassLoc.push_back(*(new FGColumnVector3(X, Y, Z)));
+  PointMassWeight.push_back(weight);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGMassBalance::GetPointMassWeight(void)
+{
+  double PM_total_weight = 0.0;
+
+  for (unsigned int i=0; i<PointMassWeight.size(); i++) {
+    PM_total_weight += PointMassWeight[i];
+  }
+  return PM_total_weight;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGColumnVector3& FGMassBalance::GetPointMassCG(void)
+{
+  PointMassCG.InitMatrix();
+
+  for (unsigned int i=0; i<PointMassLoc.size(); i++) {
+    PointMassCG += PointMassWeight[i]*PointMassLoc[i];
+  }
+  return PointMassCG;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGMassBalance::GetPMIxx(void)
+{
+  double I = 0.0;
+  for (unsigned int i=0; i<PointMassLoc.size(); i++) {
+    I += PointMassLoc[i](eX)*PointMassLoc[i](eX)*PointMassWeight[i];
+  }
+  I /= (144.0*Inertial->gravity());
+  return I;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGMassBalance::GetPMIyy(void)
+{
+  double I = 0.0;
+  for (unsigned int i=0; i<PointMassLoc.size(); i++) {
+    I += PointMassLoc[i](eY)*PointMassLoc[i](eY)*PointMassWeight[i];
+  }
+  I /= (144.0*Inertial->gravity());
+  return I;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGMassBalance::GetPMIzz(void)
+{
+  double I = 0.0;
+  for (unsigned int i=0; i<PointMassLoc.size(); i++) {
+    I += PointMassLoc[i](eZ)*PointMassLoc[i](eZ)*PointMassWeight[i];
+  }
+  I /= (144.0*Inertial->gravity());
+  return I;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGMassBalance::GetPMIxy(void)
+{
+  double I = 0.0;
+  for (unsigned int i=0; i<PointMassLoc.size(); i++) {
+    I += PointMassLoc[i](eX)*PointMassLoc[i](eY)*PointMassWeight[i];
+  }
+  I /= (144.0*Inertial->gravity());
+  return I;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGMassBalance::GetPMIxz(void)
+{
+  double I = 0.0;
+  for (unsigned int i=0; i<PointMassLoc.size(); i++) {
+    I += PointMassLoc[i](eX)*PointMassLoc[i](eZ)*PointMassWeight[i];
+  }
+  I /= (144.0*Inertial->gravity());
+  return I;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGMassBalance::Debug(void)
 {
   if (debug_lvl & 16) { // Sanity check variables
index d59fbb16ef4ae51ada69baca3553ffb42d8be444..5efda6698cf38f3ea1602a381c794f763455a198 100644 (file)
@@ -44,6 +44,7 @@ INCLUDES
 
 #include "FGModel.h"
 #include "FGPropulsion.h"
+#include <vector>
 
 #define ID_MASSBALANCE "$Id$"
 
@@ -65,8 +66,8 @@ public:
   inline double GetIxx(void) {return Ixx;}
   inline double GetIyy(void) {return Iyy;}
   inline double GetIzz(void) {return Izz;}
+  inline double GetIxy(void) {return Ixy;}
   inline double GetIxz(void) {return Ixz;}
-  inline double GetIyz(void) {return Iyz;}
   inline FGColumnVector3& GetXYZcg(void) {return vXYZcg;}
   inline double GetXYZcg(int axis) {return vXYZcg(axis);}
 
@@ -74,9 +75,18 @@ public:
   inline void SetBaseIxx(double bixx)   { baseIxx = bixx;}
   inline void SetBaseIyy(double biyy)   { baseIyy = biyy;}
   inline void SetBaseIzz(double bizz)   { baseIzz = bizz;}
+  inline void SetBaseIxy(double bixy)   { baseIxy = bixy;}
   inline void SetBaseIxz(double bixz)   { baseIxz = bixz;}
-  inline void SetBaseIyz(double biyz)   { baseIyz = biyz;}
   inline void SetBaseCG(const FGColumnVector3& CG) {vbaseXYZcg = CG;}
+  
+  void AddPointMass(double weight, double X, double Y, double Z);
+  double GetPointMassWeight(void);
+  FGColumnVector3& GetPointMassCG(void);
+  double GetPMIxx(void);
+  double GetPMIyy(void);
+  double GetPMIzz(void);
+  double GetPMIxy(void);
+  double GetPMIxz(void);
 
 private:
   double Weight;
@@ -85,16 +95,19 @@ private:
   double Ixx;
   double Iyy;
   double Izz;
+  double Ixy;
   double Ixz;
-  double Iyz;
   double baseIxx;
   double baseIyy;
   double baseIzz;
+  double baseIxy;
   double baseIxz;
-  double baseIyz;
   FGColumnVector3 vXYZcg;
   FGColumnVector3 vXYZtank;
   FGColumnVector3 vbaseXYZcg;
+  vector <FGColumnVector3> PointMassLoc;
+  vector <double> PointMassWeight;
+  FGColumnVector3 PointMassCG;
   void Debug(void);
 };
 
index 19bf7236a2ef327e9d96420a35078abe5fe666ae..aff96cc482feaf0d80346daf518337c6828acf84 100644 (file)
@@ -195,6 +195,7 @@ void FGOutput::DelimitedOutput(string fname)
       outstream << "Altitude, ";
       outstream << "Phi, Tht, Psi, ";
       outstream << "Alpha, ";
+      outstream << "Beta, ";
       outstream << "Latitude, ";
       outstream << "Longitude, ";
       outstream << "Distance AGL, ";
@@ -269,6 +270,7 @@ void FGOutput::DelimitedOutput(string fname)
     outstream << Position->Geth() << ", ";
     outstream << Rotation->GetEuler() << ", ";
     outstream << Translation->Getalpha() << ", ";
+    outstream << Translation->Getbeta() << ", ";
     outstream << Position->GetLatitude() << ", ";
     outstream << Position->GetLongitude() << ", ";
     outstream << Position->GetDistanceAGL() << ", ";
index 58485a2e44bbef4e0d927a3b43e4065a5e285103..de5b7db5f3a069b0975c74fb9f4be91c5f8339d0 100644 (file)
@@ -68,9 +68,7 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg)
   Cycles=2;
   IdleRPM=600;
   // Set constants
-  
-  
+
   Name = Eng_cfg->GetValue("NAME");
   Eng_cfg->GetNextConfigLine();
   while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
index 1b30295f56f607f0133a3ab6511147da5cf2dc7c..cc3a95cef237c5a8015a56bee3b92546b3f29fb4 100644 (file)
@@ -95,10 +95,7 @@ extern double globalTriNormal[3];
 extern double globalSceneryAltitude;
 extern double globalSeaLevelRadius;
 
-FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex),
-    vVel(3),
-    vVelDot(3),
-    vRunwayNormal(3)
+FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGPosition";
   LongitudeDot = LatitudeDot = RadiusDot = 0.0;
index f5dad334f556269c6be08977fb4cf658d7ebb8a8..9ae5abcddb71cc66a42dbd324bc489c426fbaa5a 100644 (file)
@@ -105,6 +105,7 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
 
   Type = ttPropeller;
   RPM = 0;
+  vTorque.InitMatrix();
 
   if (debug_lvl & 2) cout << "Instantiated: FGPropeller" << endl;
 }
@@ -155,8 +156,8 @@ double FGPropeller::Calculate(double PowerAvailable)
   if (P_Factor > 0.0001) {
     alpha = fdmex->GetTranslation()->Getalpha();
     beta  = fdmex->GetTranslation()->Getbeta();
-    SetLocationY( GetLocationY() + P_Factor*alpha*fabs(Sense)/Sense);
-    SetLocationZ( GetLocationZ() + P_Factor*beta*fabs(Sense)/Sense);
+    SetActingLocationY( GetLocationY() + P_Factor*alpha*fabs(Sense)/Sense);
+    SetActingLocationZ( GetLocationZ() + P_Factor*beta*fabs(Sense)/Sense);
   } else if (P_Factor < 0.000) {
     cerr << "P-Factor value in config file must be greater than zero" << endl;
   }
@@ -175,10 +176,10 @@ double FGPropeller::Calculate(double PowerAvailable)
 
   if (omega <= 5) omega = 1.0;
 
-  Torque = PowerAvailable / omega;
-  RPM = (RPS + ((Torque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
+  ExcessTorque = PowerAvailable / omega;
+  RPM = (RPS + ((ExcessTorque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
 
-  vMn = fdmex->GetRotation()->GetPQR()*vH + Torque*Sense;
+  vMn = fdmex->GetRotation()->GetPQR()*vH + vTorque*Sense;
 
   return Thrust; // return thrust in pounds
 }
@@ -216,6 +217,8 @@ double FGPropeller::GetPowerRequired(void)
 
   PowerRequired = cPReq*RPS*RPS*RPS*Diameter*Diameter*Diameter*Diameter
                                                        *Diameter*rho;
+  vTorque(eX) = PowerRequired / ((RPM/60)*2.0*M_PI);
+
   return PowerRequired;
 }
 
index 3c0d92f0a767e1b5e7963c1385735f5a53e583c5..23c9aaadc62484123e1032c74fd230ce5e4a5907 100644 (file)
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- Header:       FGPropeller.h
- Author:       Jon S. Berndt
- Date started: 08/24/00
-
- ------------- Copyright (C) 2000  Jon S. Berndt (jsb@hal-pc.org) -------------
-
- This program is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free Software
- Foundation; either version 2 of the License, or (at your option) any later
- version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- details.
-
- You should have received a copy of the GNU General Public License along with
- this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- Place - Suite 330, Boston, MA  02111-1307, USA.
-
- Further information about the GNU General Public License can also be found on
- the world wide web at http://www.gnu.org.
-
-HISTORY
---------------------------------------------------------------------------------
-08/24/00  JSB  Created
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-SENTRY
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-#ifndef FGPROPELLER_H
-#define FGPROPELLER_H
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-INCLUDES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-#include "FGThruster.h"
-#include "FGTable.h"
-#include "FGTranslation.h"
-#include "FGRotation.h"
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINITIONS
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-#define ID_PROPELLER "$Id$"
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-FORWARD DECLARATIONS
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-CLASS DOCUMENTATION
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-/** Propeller modeling class.
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+\r
+ Header:       FGPropeller.h\r
+ Author:       Jon S. Berndt\r
+ Date started: 08/24/00\r
+\r
+ ------------- Copyright (C) 2000  Jon S. Berndt (jsb@hal-pc.org) -------------\r
+\r
+ This program is free software; you can redistribute it and/or modify it under\r
+ the terms of the GNU General Public License as published by the Free Software\r
+ Foundation; either version 2 of the License, or (at your option) any later\r
+ version.\r
+\r
+ This program is distributed in the hope that it will be useful, but WITHOUT\r
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+ FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+ details.\r
+\r
+ You should have received a copy of the GNU General Public License along with\r
+ this program; if not, write to the Free Software Foundation, Inc., 59 Temple\r
+ Place - Suite 330, Boston, MA  02111-1307, USA.\r
+\r
+ Further information about the GNU General Public License can also be found on\r
+ the world wide web at http://www.gnu.org.\r
+\r
+HISTORY\r
+--------------------------------------------------------------------------------\r
+08/24/00  JSB  Created\r
+\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+SENTRY\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+#ifndef FGPROPELLER_H\r
+#define FGPROPELLER_H\r
+\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+INCLUDES\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+#include "FGThruster.h"\r
+#include "FGTable.h"\r
+#include "FGTranslation.h"\r
+#include "FGRotation.h"\r
+\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+DEFINITIONS\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+#define ID_PROPELLER "$Id$"\r
+\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+FORWARD DECLARATIONS\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+CLASS DOCUMENTATION\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+/** Propeller modeling class.\r
     FGPropeller models a propeller given the tabular data for Ct and Cp\r
     indexed by advance ratio "J". The data for the propeller is\r
-    stored in a config file named "prop_name.xml". The propeller config file
-    is referenced from the main aircraft config file in the "Propulsion" section.
-    See the constructor for FGPropeller to see what is read in and what should
-    be stored in the config file.<br>
-    Several references were helpful, here:<ul>
-    <li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
-     Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
-    <li>Edwin Hartman, David Biermann, "The Aerodynamic Characteristics of
-    Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6
-    Airfoil Sections", NACA Report TN-640, 1938 (?)</li>
-    <li>Various NACA Technical Notes and Reports</li>
-    <ul>
-    @author Jon S. Berndt
-    @version $Id$
-    @see FGEngine
-    @see FGThruster
-    @see FGTable
-*/
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-CLASS DECLARATION
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
-class FGPropeller : public FGThruster {
-
-public:
-  /** Constructor for FGPropeller.
-      @param exec a pointer to the main executive object
-      @param AC_cfg a pointer to the main aircraft config file object */
-  FGPropeller(FGFDMExec* exec, FGConfigFile* AC_cfg);
-
-  /// Destructor for FGPropeller - deletes the FGTable objects
-  ~FGPropeller();
-
-  /** Sets the Revolutions Per Minute for the propeller. Normally the propeller
-      instance will calculate its own rotational velocity, given the Torque
-      produced by the engine and integrating over time using the standard
-      equation for rotational acceleration "a": a = Q/I , where Q is Torque and
-      I is moment of inertia for the propeller.
-      @param rpm the rotational velocity of the propeller */
-  void SetRPM(double rpm) {RPM = rpm;}
-
-  /** This commands the pitch of the blade to change to the value supplied.
-      This call is meant to be issued either from the cockpit or by the flight
-      control system (perhaps to maintain constant RPM for a constant-speed
-      propeller). This value will be limited to be within whatever is specified
-      in the config file for Max and Min pitch. It is also one of the lookup
+    stored in a config file named "prop_name.xml". The propeller config file\r
+    is referenced from the main aircraft config file in the "Propulsion" section.\r
+    See the constructor for FGPropeller to see what is read in and what should\r
+    be stored in the config file.<br>\r
+    Several references were helpful, here:<ul>\r
+    <li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",\r
+     Wiley & Sons, 1979 ISBN 0-471-03032-5</li>\r
+    <li>Edwin Hartman, David Biermann, "The Aerodynamic Characteristics of\r
+    Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6\r
+    Airfoil Sections", NACA Report TN-640, 1938 (?)</li>\r
+    <li>Various NACA Technical Notes and Reports</li>\r
+    <ul>\r
+    @author Jon S. Berndt\r
+    @version $Id$\r
+    @see FGEngine\r
+    @see FGThruster\r
+    @see FGTable\r
+*/\r
+\r
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+CLASS DECLARATION\r
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
+\r
+class FGPropeller : public FGThruster {\r
+\r
+public:\r
+  /** Constructor for FGPropeller.\r
+      @param exec a pointer to the main executive object\r
+      @param AC_cfg a pointer to the main aircraft config file object */\r
+  FGPropeller(FGFDMExec* exec, FGConfigFile* AC_cfg);\r
+\r
+  /// Destructor for FGPropeller - deletes the FGTable objects\r
+  ~FGPropeller();\r
+\r
+  /** Sets the Revolutions Per Minute for the propeller. Normally the propeller\r
+      instance will calculate its own rotational velocity, given the Torque\r
+      produced by the engine and integrating over time using the standard\r
+      equation for rotational acceleration "a": a = Q/I , where Q is Torque and\r
+      I is moment of inertia for the propeller.\r
+      @param rpm the rotational velocity of the propeller */\r
+  void SetRPM(double rpm) {RPM = rpm;}\r
+\r
+  /** This commands the pitch of the blade to change to the value supplied.\r
+      This call is meant to be issued either from the cockpit or by the flight\r
+      control system (perhaps to maintain constant RPM for a constant-speed\r
+      propeller). This value will be limited to be within whatever is specified\r
+      in the config file for Max and Min pitch. It is also one of the lookup\r
       indices to the power and thrust tables for variable-pitch propellers.\r
-      @param pitch the pitch of the blade in degrees. */
-  void SetPitch(double pitch) {Pitch = pitch;}
-  
-  void SetPFactor(double pf) {P_Factor = pf;}
-  
-  void SetSense(double s) { Sense = s;}
-
-  /// Retrieves the pitch of the propeller in degrees.
-  double GetPitch(void)         { return Pitch;         }
-  
-  /// Retrieves the RPMs of the propeller
-  double GetRPM(void)           { return RPM;           }
-  
-  /// Retrieves the propeller moment of inertia
-  double GetIxx(void)           { return Ixx;           }
-  
-  /// Retrieves the Torque in foot-pounds (Don't you love the English system?)
-  double GetTorque(void)        { return Torque;        }
-  
-  /** Retrieves the power required (or "absorbed") by the propeller -
-      i.e. the power required to keep spinning the propeller at the current
-      velocity, air density,  and rotational rate. */
-  double GetPowerRequired(void);
-  
-  /** Calculates and returns the thrust produced by this propeller.
-      Given the excess power available from the engine (in foot-pounds), the thrust is
-      calculated, as well as the current RPM. The RPM is calculated by integrating
-      the torque provided by the engine over what the propeller "absorbs"
-      (essentially the "drag" of the propeller).
-      @param PowerAvailable this is the excess power provided by the engine to
-      accelerate the prop. It could be negative, dictating that the propeller
-      would be slowed.
-      @return the thrust in pounds */
-  double Calculate(double PowerAvailable);
-
-private:
-  int   numBlades;
-  double RPM;
-  double Ixx;
-  double Diameter;
-  double MaxPitch;
-  double MinPitch;
-  double MinRPM;
-  double MaxRPM;
-  double P_Factor;
-  double Sense;
-  double Pitch;
-  double Torque;
-  FGTable *cThrust;
-  FGTable *cPower;
-  void Debug(void);
-};
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-#endif
-
+      @param pitch the pitch of the blade in degrees. */\r
+  void SetPitch(double pitch) {Pitch = pitch;}\r
+  \r
+  void SetPFactor(double pf) {P_Factor = pf;}\r
+  \r
+  void SetSense(double s) { Sense = s;}\r
+\r
+  /// Retrieves the pitch of the propeller in degrees.\r
+  double GetPitch(void)         { return Pitch;         }\r
+  \r
+  /// Retrieves the RPMs of the propeller\r
+  double GetRPM(void)           { return RPM;           }\r
+  \r
+  /// Retrieves the propeller moment of inertia\r
+  double GetIxx(void)           { return Ixx;           }\r
+  \r
+  /// Retrieves the Torque in foot-pounds (Don't you love the English system?)\r
+  double GetTorque(void)        { return vTorque(eX);    }\r
+  \r
+  /** Retrieves the power required (or "absorbed") by the propeller -\r
+      i.e. the power required to keep spinning the propeller at the current\r
+      velocity, air density,  and rotational rate. */\r
+  double GetPowerRequired(void);\r
+  \r
+  /** Calculates and returns the thrust produced by this propeller.\r
+      Given the excess power available from the engine (in foot-pounds), the thrust is\r
+      calculated, as well as the current RPM. The RPM is calculated by integrating\r
+      the torque provided by the engine over what the propeller "absorbs"\r
+      (essentially the "drag" of the propeller).\r
+      @param PowerAvailable this is the excess power provided by the engine to\r
+      accelerate the prop. It could be negative, dictating that the propeller\r
+      would be slowed.\r
+      @return the thrust in pounds */\r
+  double Calculate(double PowerAvailable);\r
+\r
+private:\r
+  int   numBlades;\r
+  double RPM;\r
+  double Ixx;\r
+  double Diameter;\r
+  double MaxPitch;\r
+  double MinPitch;\r
+  double MinRPM;\r
+  double MaxRPM;\r
+  double P_Factor;\r
+  double Sense;\r
+  double Pitch;\r
+  double ExcessTorque;\r
+  FGColumnVector3 vTorque;\r
+  FGTable *cThrust;\r
+  FGTable *cPower;\r
+  void Debug(void);\r
+};\r
+\r
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r
+#endif\r
+\r
index 9dcc78e6910763a961f92585dcf5892d60dd4c9c..e8a148e1f2bc21f12f6ead4a2ac3d5f2a9c8994d 100644 (file)
@@ -62,9 +62,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec),
-                                              Forces(3),
-                                              Moments(3)
+FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec)
 {
   Name = "FGPropulsion";
   numSelectedFuelTanks = numSelectedOxiTanks = 0;
@@ -90,16 +88,16 @@ bool FGPropulsion::Run(void)
   double PowerAvailable;
   dt = State->Getdt();
 
-  Forces.InitMatrix();
-  Moments.InitMatrix();
+  vForces.InitMatrix();
+  vMoments.InitMatrix();
 
   if (!FGModel::Run()) {
     for (unsigned int i=0; i<numEngines; i++) {
       Thrusters[i]->SetdeltaT(dt*rate);
       PowerAvailable = Engines[i]->Calculate(Thrusters[i]->GetPowerRequired());
       Thrusters[i]->Calculate(PowerAvailable);
-      Forces  += Thrusters[i]->GetBodyForces();  // sum body frame forces
-      Moments += Thrusters[i]->GetMoments();     // sum body frame moments
+      vForces  += Thrusters[i]->GetBodyForces();  // sum body frame forces
+      vMoments += Thrusters[i]->GetMoments();     // sum body frame moments
     }
     return false;
   } else {
@@ -117,8 +115,8 @@ bool FGPropulsion::GetSteadyState(void)
   int steady_count,j=0;
   bool steady=false;
 
-  Forces.InitMatrix();
-  Moments.InitMatrix();
+  vForces.InitMatrix();
+  vMoments.InitMatrix();
 
   if (!FGModel::Run()) {
     for (unsigned int i=0; i<numEngines; i++) {
@@ -138,8 +136,8 @@ bool FGPropulsion::GetSteadyState(void)
         }
         j++;    
       }
-      Forces  += Thrusters[i]->GetBodyForces();  // sum body frame forces
-      Moments += Thrusters[i]->GetMoments();     // sum body frame moments
+      vForces  += Thrusters[i]->GetBodyForces();  // sum body frame forces
+      vMoments += Thrusters[i]->GetMoments();     // sum body frame moments
       Engines[i]->SetTrimMode(false);
     }
 
@@ -158,8 +156,8 @@ bool FGPropulsion::ICEngineStart(void)
   int j;
   dt = State->Getdt();
 
-  Forces.InitMatrix();
-  Moments.InitMatrix();
+  vForces.InitMatrix();
+  vMoments.InitMatrix();
     
   for (unsigned int i=0; i<numEngines; i++) {
     Engines[i]->SetTrimMode(true);
@@ -170,8 +168,8 @@ bool FGPropulsion::ICEngineStart(void)
       Thrusters[i]->Calculate(PowerAvailable);
       j++;    
     }
-    Forces  += Thrusters[i]->GetBodyForces();  // sum body frame forces
-    Moments += Thrusters[i]->GetMoments();     // sum body frame moments
+    vForces  += Thrusters[i]->GetBodyForces();  // sum body frame forces
+    vMoments += Thrusters[i]->GetMoments();     // sum body frame moments
     Engines[i]->SetTrimMode(false);
   }
   return true;
index 0d41af38a13010e065a46fd2fe277e8594275686..6cb2342a84c70d48fe777d80a92b440d5d0b08ff 100644 (file)
@@ -168,10 +168,10 @@ public:
   string GetPropulsionStrings(void);
   string GetPropulsionValues(void);
 
-  inline FGColumnVector3& GetForces(void)  {return Forces; }
-  inline double GetForces(int n) { return Forces(n);}
-  inline FGColumnVector3& GetMoments(void) {return Moments;}
-  inline double GetMoments(int n) {return Moments(n);}
+  inline FGColumnVector3& GetForces(void)  {return vForces; }
+  inline double GetForces(int n) { return vForces(n);}
+  inline FGColumnVector3& GetMoments(void) {return vMoments;}
+  inline double GetMoments(int n) {return vMoments(n);}
   
   FGColumnVector3& GetTanksCG(void);
   double GetTanksWeight(void);
@@ -195,8 +195,8 @@ private:
   unsigned int numTanks;
   unsigned int numThrusters;
   double dt;
-  FGColumnVector3 Forces;
-  FGColumnVector3 Moments;
+  FGColumnVector3 vForces;
+  FGColumnVector3 vMoments;
   FGColumnVector3 vXYZtank;
   void Debug(void);
 };
index bd6c8d2c70c417ca31cb93cbf4eb7bd12f2fb303..d7a440040382dbd66599289bdde089db9faf0959 100644 (file)
@@ -75,14 +75,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex),
-        vPQR(3),
-        vAeroPQR(3),
-        vPQRdot(3),
-        vMoments(3),
-        vEuler(3),
-        vEulerRates(3),
-        vlastPQRdot(3)
+FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGRotation";
   cTht=cPhi=cPsi=1.0;
index 5adfb8757b81c2d16eca5c24b118b8572ddac74a..5e3996a199007c1de5e8a6eaaa247590c642892c 100644 (file)
@@ -73,19 +73,7 @@ CLASS IMPLEMENTATION
 // entry in the enum eParam definition in FGJSBBase.h. The ID is what must be used
 // in any config file entry which references that item.
 
-FGState::FGState(FGFDMExec* fdex) : 
-    mTb2l(3,3),
-    mTl2b(3,3),
-    mTs2b(3,3),
-    mTb2s(3,3),
-    vQtrn(4),
-    vlastQdot(4),
-    vQdot(4),
-    vUVW(3),
-    vLocalVelNED(3),
-    vLocalEuler(3),
-    vTmp(4),
-    vEuler(3)
+FGState::FGState(FGFDMExec* fdex)
 {
   FDMExec = fdex;
 
@@ -323,13 +311,17 @@ double FGState::GetParameter(string val_string) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-eParam FGState::GetParameterIndex(string val_string) {
+eParam FGState::GetParameterIndex(string val_string)
+{
   return coeffdef[val_string];
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::SetParameter(eParam val_idx, double val) {
+void FGState::SetParameter(eParam val_idx, double val)
+{
+  int i;
+
   switch(val_idx) {
   case FG_ELEVATOR_POS:
     FCS->SetDePos(val);
@@ -350,10 +342,22 @@ void FGState::SetParameter(eParam val_idx, double val) {
     FCS->SetDfPos(val);
     break;
   case FG_THROTTLE_POS:
-    FCS->SetThrottlePos(ActiveEngine,val);
+    if (ActiveEngine == -1) {
+      for (i=0; i<Propulsion->GetNumEngines(); i++) {
+        FCS->SetThrottlePos(i,val);
+           }
+         } else {
+      FCS->SetThrottlePos(ActiveEngine,val);
+         }
     break;
   case FG_MIXTURE_POS:
-    FCS->SetMixturePos(ActiveEngine,val);
+    if (ActiveEngine == -1) {
+      for (i=0; i<Propulsion->GetNumEngines(); i++) {
+        FCS->SetMixturePos(i,val);
+           }
+         } else {
+      FCS->SetMixturePos(ActiveEngine,val);
+         }
     break;
 
   case FG_ELEVATOR_CMD:
@@ -375,19 +379,43 @@ void FGState::SetParameter(eParam val_idx, double val) {
     FCS->SetDfCmd(val);
     break;
   case FG_THROTTLE_CMD:
-    FCS->SetThrottleCmd(ActiveEngine,val);
+    if (ActiveEngine == -1) {
+      for (i=0; i<Propulsion->GetNumEngines(); i++) {
+        FCS->SetThrottleCmd(i,val);
+           }
+         } else {
+      FCS->SetThrottleCmd(ActiveEngine,val);
+         }
     break;
   case FG_MIXTURE_CMD:
-    FCS->SetMixtureCmd(ActiveEngine,val);
+    if (ActiveEngine == -1) {
+      for (i=0; i<Propulsion->GetNumEngines(); i++) {
+        FCS->SetMixtureCmd(i,val);
+           }
+         } else {
+      FCS->SetMixtureCmd(ActiveEngine,val);
+         }
     break;
   case FG_MAGNETO_CMD:
-    Propulsion->GetEngine(ActiveEngine)->SetMagnetos((int)val); // need to account for -1
+    if (ActiveEngine == -1) {
+      for (i=0; i<Propulsion->GetNumEngines(); i++) {
+        Propulsion->GetEngine(i)->SetMagnetos((int)val);
+      }
+    } else {
+      Propulsion->GetEngine(ActiveEngine)->SetMagnetos((int)val);
+    }
     break;
   case FG_STARTER_CMD:
-    if      (val < 0.001) 
-      Propulsion->GetEngine(ActiveEngine)->SetStarter(false); // need to account for -1
-    else if (val >=  0.001)
-      Propulsion->GetEngine(ActiveEngine)->SetStarter(true); // need to account for -1
+    if (ActiveEngine == -1) {
+      for (i=0; i<Propulsion->GetNumEngines(); i++) {
+        if (val < 0.001) 
+          Propulsion->GetEngine(i)->SetStarter(false);
+        else if (val >=  0.001)
+          Propulsion->GetEngine(i)->SetStarter(true);
+      }
+    } else {
+      Propulsion->GetEngine(ActiveEngine)->SetStarter(true);
+    }
     break;
   case FG_ACTIVE_ENGINE:
     ActiveEngine = (int)val;
index f56da337c5b29da29e1212c18e5fe05b86caff76..5c76642f82f839d5a1e6f3b906c3c18295342147 100644 (file)
@@ -77,12 +77,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
-FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex),
-    vUVW(3),
-    vUVWdot(3),
-    vlastUVWdot(3),
-    mVel(3,3),
-    vAeroUVW(3)
+FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex)
 {
   Name = "FGTranslation";
   qbar = 0;