]> git.mxchange.org Git - flightgear.git/commitdiff
JSBSim updates, including MSVC fixes from Bernie Bright
authortony <tony>
Tue, 30 Apr 2002 13:42:26 +0000 (13:42 +0000)
committertony <tony>
Tue, 30 Apr 2002 13:42:26 +0000 (13:42 +0000)
21 files changed:
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAerodynamics.h
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGAtmosphere.h
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGCoefficient.h
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGFactorGroup.cpp
src/FDM/JSBSim/FGFactorGroup.h
src/FDM/JSBSim/FGGroundReactions.cpp
src/FDM/JSBSim/FGInertial.cpp
src/FDM/JSBSim/FGMassBalance.cpp
src/FDM/JSBSim/FGPropertyManager.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGTranslation.cpp
src/FDM/JSBSim/FGTrim.cpp
src/FDM/JSBSim/FGTrimAxis.cpp

index 8cc13af2172d64bcc05fb1dac9dc4f99cc613a27..a379b20764372b0a094cb32169c48429d2901d06 100644 (file)
@@ -225,24 +225,26 @@ string FGAerodynamics::GetCoefficientValues(void)
 
 void FGAerodynamics::bind(void)
 {
+  typedef double (FGAerodynamics::*PMF)(int) const;
+
   PropertyManager->Tie("forces/fbx-aero-lbs", this,1,
-                       &FGAerodynamics::GetForces);
+                       (PMF)&FGAerodynamics::GetForces);
   PropertyManager->Tie("forces/fby-aero-lbs", this,2,
-                       &FGAerodynamics::GetForces);
+                       (PMF)&FGAerodynamics::GetForces);
   PropertyManager->Tie("forces/fbz-aero-lbs", this,3,
-                       &FGAerodynamics::GetForces);
+                       (PMF)&FGAerodynamics::GetForces);
   PropertyManager->Tie("moments/l-aero-lbsft", this,1,
-                       &FGAerodynamics::GetMoments);
+                       (PMF)&FGAerodynamics::GetMoments);
   PropertyManager->Tie("moments/m-aero-lbsft", this,2,
-                       &FGAerodynamics::GetMoments);
+                       (PMF)&FGAerodynamics::GetMoments);
   PropertyManager->Tie("moments/n-aero-lbsft", this,3,
-                       &FGAerodynamics::GetMoments);
+                       (PMF)&FGAerodynamics::GetMoments);
   PropertyManager->Tie("forces/fwx-aero-lbs", this,1,
-                       &FGAerodynamics::GetvFs);
+                       (PMF)&FGAerodynamics::GetvFs);
   PropertyManager->Tie("forces/fwy-aero-lbs", this,2,
-                       &FGAerodynamics::GetvFs);
+                       (PMF)&FGAerodynamics::GetvFs);
   PropertyManager->Tie("forces/fwz-aero-lbs", this,3,
-                       &FGAerodynamics::GetvFs);
+                       (PMF)&FGAerodynamics::GetvFs);
   PropertyManager->Tie("forces/lod-norm", this,
                        &FGAerodynamics::GetLoD);
   PropertyManager->Tie("aero/cl-squared-norm", this,
@@ -259,7 +261,7 @@ void FGAerodynamics::bindModel(void)
   node = PropertyManager->GetNode("aero/buildup",true);
   for (i=0;i<NAxes;i++) {
      node = node->GetNode( string(AxisNames[i]),true );
-     for (j=0; j < Coeff[i].size(); j++) { 
+     for (j=0; j < Coeff[i].size(); j++) {
        Coeff[i][j]->bind(node);
      } 
      node = (FGPropertyManager*)node->getParent();                                         
index 7c0eb7728e6969574b608f22da07ec4f8d7b1864..8119a2f089a5e331077e2de8e88de8b6a6fc8e80 100644 (file)
@@ -115,17 +115,17 @@ public:
   /** Gets the total aerodynamic force vector.
       @return a force vector reference. */
   FGColumnVector3& GetForces(void) {return vForces;}
-  inline double GetForces(int n) const {return vForces(n);}
+  double GetForces(int n) const {return vForces(n);}
 
   /** Gets the total aerodynamic moment vector.
       @return a moment vector reference. */
   FGColumnVector3& GetMoments(void) {return vMoments;}
-  inline double GetMoments(int n) const {return vMoments(n);}
+  double GetMoments(int n) const {return vMoments(n);}
 
-  inline FGColumnVector3& GetvLastFs(void) { return vLastFs; }
-  inline double GetvLastFs(int axis) const { return vLastFs(axis); }
-  inline FGColumnVector3& GetvFs(void) { return vFs; }
-  inline double GetvFs(int axis) const { return vFs(axis); }
+  FGColumnVector3& GetvLastFs(void) { return vLastFs; }
+  double GetvLastFs(int axis) const { return vLastFs(axis); }
+  FGColumnVector3& GetvFs(void) { return vFs; }
+  double GetvFs(int axis) const { return vFs(axis); }
   inline double GetLoD(void) const { return lod; }
   inline double GetClSquared(void) const { return clsq; } 
 
@@ -153,6 +153,8 @@ private:
   FGColumnVector3 vLastFs;
   FGColumnVector3 vDXYZcg;
   double clsq,lod;
+  
+  typedef double (FGAerodynamics::*PMF)(int) const;
 
   void Debug(int from);
 };
index 37f2efeb482d949e13e3a5227a25e3a7b2cedb6b..073afba3db159891200e37562e8478b5f44948fb 100644 (file)
@@ -281,6 +281,7 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
 
 void FGAircraft::bind(void)
 {
+  typedef double (FGAircraft::*PMF)(int) const;
   PropertyManager->Tie("metrics/Sw-sqft", this,
                        &FGAircraft::GetWingArea);
   PropertyManager->Tie("metrics/bw-ft", this,
@@ -306,29 +307,29 @@ void FGAircraft::bind(void)
   PropertyManager->Tie("metrics/vbarv-norm", this,
                        &FGAircraft::Getvbarv);
   PropertyManager->Tie("moments/l-total-lbsft", this,1,
-                       &FGAircraft::GetMoments);
+                       (PMF)&FGAircraft::GetMoments);
   PropertyManager->Tie("moments/m-total-lbsft", this,2,
-                       &FGAircraft::GetMoments);
+                       (PMF)&FGAircraft::GetMoments);
   PropertyManager->Tie("moments/n-total-lbsft", this,3,
-                       &FGAircraft::GetMoments);
+                       (PMF)&FGAircraft::GetMoments);
   PropertyManager->Tie("forces/fbx-total-lbs", this,1,
-                       &FGAircraft::GetForces);
+                       (PMF)&FGAircraft::GetForces);
   PropertyManager->Tie("forces/fby-total-lbs", this,2,
-                       &FGAircraft::GetForces);
+                       (PMF)&FGAircraft::GetForces);
   PropertyManager->Tie("forces/fbz-total-lbs", this,3,
-                       &FGAircraft::GetForces);
+                       (PMF)&FGAircraft::GetForces);
   PropertyManager->Tie("metrics/aero-rp-x-ft", this,1,
-                       &FGAircraft::GetXYZrp);
+                       (PMF)&FGAircraft::GetXYZrp);
   PropertyManager->Tie("metrics/aero-rp-y-ft", this,2,
-                       &FGAircraft::GetXYZrp);
+                       (PMF)&FGAircraft::GetXYZrp);
   PropertyManager->Tie("metrics/aero-rp-z-ft", this,3,
-                       &FGAircraft::GetXYZrp);
+                       (PMF)&FGAircraft::GetXYZrp);
   PropertyManager->Tie("metrics/eyepoint-x-ft", this,1,
-                       &FGAircraft::GetXYZep);
+                       (PMF)&FGAircraft::GetXYZep);
   PropertyManager->Tie("metrics/eyepoint-y-ft", this,2,
-                       &FGAircraft::GetXYZep);
+                       (PMF)&FGAircraft::GetXYZep);
   PropertyManager->Tie("metrics/eyepoint-z-ft", this,3,
-                       &FGAircraft::GetXYZep);
+                       (PMF)&FGAircraft::GetXYZep);
   PropertyManager->Tie("metrics/alpha-max-deg", this,
                        &FGAircraft::GetAlphaCLMax,
                        &FGAircraft::SetAlphaCLMax,
index 30c172cffd050fddc277e513419884a36885fcd9..c59fbc451b6ac84c4e714f2d8478411adfdb7a21 100644 (file)
@@ -36,6 +36,7 @@ HISTORY
 11/24/98   JSB   Created
 07/23/99   TP    Added implementation of 1959 Standard Atmosphere
                  Moved calculation of Mach number to FGTranslation
+                 Later updated to '76 model
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES,  and NOTES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -298,6 +299,7 @@ void FGAtmosphere::Turbulence(void)
 
 void FGAtmosphere::bind(void)
 {
+  typedef double (FGAtmosphere::*PMF)(int) const;
   PropertyManager->Tie("atmosphere/T-R", this,
                        &FGAtmosphere::GetTemperature);
   PropertyManager->Tie("atmosphere/rho-slugs_ft3", this,
@@ -325,11 +327,11 @@ void FGAtmosphere::bind(void)
   PropertyManager->Tie("atmosphere/psiw-rad", this,
                        &FGAtmosphere::GetWindPsi);
   PropertyManager->Tie("atmosphere/p-turb-rad_sec", this,1,
-                       &FGAtmosphere::GetTurbPQR);
+                       (PMF)&FGAtmosphere::GetTurbPQR);
   PropertyManager->Tie("atmosphere/q-turb-rad_sec", this,2,
-                       &FGAtmosphere::GetTurbPQR);
+                       (PMF)&FGAtmosphere::GetTurbPQR);
   PropertyManager->Tie("atmosphere/r-turb-rad_sec", this,3,
-                       &FGAtmosphere::GetTurbPQR);
+                       (PMF)&FGAtmosphere::GetTurbPQR);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index f4c6fcf448a9d32b702d91e80542faf992cccf7f..5dd820d34113cc94ac683e11022cf004afce4d82 100644 (file)
@@ -29,6 +29,7 @@ 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
  
  
 ********************************************************************************
index de8230b1c064e933a2f0ad302b9939152eee192d..698c7faab654b4bf97aac98e4f0328a8ef9e45e9 100644 (file)
@@ -199,6 +199,7 @@ double FGAuxiliary::GetCrossWind(void)
 
 void FGAuxiliary::bind(void)
 {
+  typedef double (FGAuxiliary::*PMF)(int) const;
   PropertyManager->Tie("velocities/vc-fps", this,
                        &FGAuxiliary::GetVcalibratedFPS);
   PropertyManager->Tie("velocities/vc-kts", this,
@@ -208,17 +209,17 @@ void FGAuxiliary::bind(void)
   PropertyManager->Tie("velocities/ve-kts", this,
                        &FGAuxiliary::GetVequivalentKTS);
   PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
-                       &FGAuxiliary::GetPilotAccel);
+                       (PMF)&FGAuxiliary::GetPilotAccel);
   PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
-                       &FGAuxiliary::GetPilotAccel);
+                       (PMF)&FGAuxiliary::GetPilotAccel);
   PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
-                       &FGAuxiliary::GetPilotAccel);
+                       (PMF)&FGAuxiliary::GetPilotAccel);
   PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
-                       &FGAuxiliary::GetNpilot);
+                       (PMF)&FGAuxiliary::GetNpilot);
   PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
-                       &FGAuxiliary::GetNpilot);
+                       (PMF)&FGAuxiliary::GetNpilot);
   PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
-                       &FGAuxiliary::GetNpilot);
+                       (PMF)&FGAuxiliary::GetNpilot);
   PropertyManager->Tie("position/epa-rad", this,
                        &FGAuxiliary::GetEarthPositionAngle);
   /* PropertyManager->Tie("atmosphere/headwind-fps", this,
index f447e229703cebc8591a19387056f6137e23a6e9..1a076907dc8092e61ae58596441111bf10591dd5 100644 (file)
@@ -133,14 +133,14 @@ public:
 
 protected:
   FGFDMExec* FDMExec;
-  string description;
-  string name;
-  FGPropertyManager *node;
+  
 
 private:
   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
 
   int numInstances;
+  string description;
+  string name;
   string filename;
   string method;
   string multparms;
@@ -154,6 +154,8 @@ private:
   double bias,gain;
   FGPropertyManager *LookupR, *LookupC;
   
+  FGPropertyManager *node; // must be private!!
+  
   MultVec multipliers;
   int rows, columns;
   Type type;
index ddc102772f38a080e959d7d221df0987fc811d3b..9b5e5a6d57d7656323c2333a7481848bfcc16569 100644 (file)
@@ -605,32 +605,39 @@ void FGFCS::bind(void)
 void FGFCS::bindModel(void)
 {
   unsigned i;
-
+  char tmp[80];
+  
   for (i=0; i<ThrottleCmd.size(); i++) {
-    PropertyManager->Tie("fcs/throttle-cmd-norm",this,i,
+    snprintf(tmp,80,"fcs/throttle-cmd-norm[%u]",i);
+    PropertyManager->Tie( tmp,this,i,
                           &FGFCS::GetThrottleCmd,
                           &FGFCS::SetThrottleCmd,
                           true );
-    PropertyManager->Tie("fcs/throttle-pos-norm",this,i,
+    snprintf(tmp,80,"fcs/throttle-pos-norm[%u]",i);                      
+    PropertyManager->Tie( tmp,this,i,
                           &FGFCS::GetThrottlePos,
                           &FGFCS::SetThrottlePos,
                           true );
     if ( MixtureCmd.size() > i ) {
-      PropertyManager->Tie("fcs/mixture-cmd-norm",this,i,
+      snprintf(tmp,80,"fcs/mixture-cmd-norm[%u]",i); 
+      PropertyManager->Tie( tmp,this,i,
                             &FGFCS::GetMixtureCmd,
                             &FGFCS::SetMixtureCmd,
                             true );
-      PropertyManager->Tie("fcs/mixture-pos-norm",this,i,
+      snprintf(tmp,80,"fcs/mixture-pos-norm[%u]",i);                    
+      PropertyManager->Tie( tmp,this,i,
                             &FGFCS::GetMixturePos,
                             &FGFCS::SetMixturePos,
                             true );
     }
     if ( PropAdvanceCmd.size() > i ) {
-      PropertyManager->Tie("fcs/advance-cmd-norm",this,i,
+      snprintf(tmp,80,"fcs/advance-cmd-norm[%u]",i); 
+      PropertyManager->Tie( tmp,this,i,
                             &FGFCS::GetPropAdvanceCmd,
                             &FGFCS::SetPropAdvanceCmd,
                             true );
-      PropertyManager->Tie("fcs/advance-pos-norm",this,i,
+      snprintf(tmp,80,"fcs/advance-pos-norm[%u]",i);                       
+      PropertyManager->Tie( tmp,this,i,
                             &FGFCS::GetPropAdvance,
                             &FGFCS::SetPropAdvance,
                             true );
index 84945690ddcc0506ff9d529ed33fe7615f0b3533..72badc4a55a99b85dc7d29cd963e47187ea68c74 100644 (file)
@@ -117,7 +117,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* root)
 
   IdFDM = FDMctr;
   FDMctr++;
-
+  
   try {
     char* num = getenv("JSBSIM_DEBUG");
     if (!num) debug_lvl = 1;
@@ -154,7 +154,7 @@ FGFDMExec::~FGFDMExec()
     cout << "Caught error: " << msg << endl;
   }    
 
-  for (int i=1; i<SlaveFDMList.size(); i++) delete SlaveFDMList[i]->exec;
+  for (unsigned int i=1; i<SlaveFDMList.size(); i++) delete SlaveFDMList[i]->exec;
   SlaveFDMList.clear();
  
   Debug(1);
@@ -332,7 +332,7 @@ bool FGFDMExec::Run(void)
 
   Debug(2);
 
-  for (int i=0; i<SlaveFDMList.size(); i++) {
+  for (unsigned int i=0; i<SlaveFDMList.size(); i++) {
     // TransferState(i);
     // Run(i)
   }
@@ -344,7 +344,6 @@ bool FGFDMExec::Run(void)
 
   frame = Frame++;
   State->IncrTime();
-
   return true;
 }
 
@@ -377,7 +376,7 @@ vector <string> FGFDMExec::EnumerateFDMs(void)
 
   FDMList.push_back(Aircraft->GetAircraftName());
 
-  for (int i=1; i<SlaveFDMList.size(); i++) {
+  for (unsigned int i=1; i<SlaveFDMList.size(); i++) {
     FDMList.push_back(SlaveFDMList[i]->exec->GetAircraft()->GetAircraftName());
   }
 
index 5355aaab581825f7ef273487a4d806c52cf40f35..4a53c7f68956659824189849f2519784bbb9f362 100644 (file)
@@ -207,7 +207,7 @@ public:
   FGPropertyManager* GetPropertyManager(void);
   vector <string> EnumerateFDMs(void);
   void SetSlave(void) {IsSlave = true;}
-
+  
 private:
   FGModel* FirstModel;
 
@@ -221,7 +221,7 @@ private:
   bool IsSlave;
   static FGPropertyManager *master;
   FGPropertyManager *instance;
-
+  
   struct slaveData {
     FGFDMExec* exec;
     string info;
index 1562109352a04cd360ae3dbae4d53d2ecc186eea..9d96439eacb57bac824d5a36e3756d83607f465c 100644 (file)
@@ -147,7 +147,6 @@ void FGFactorGroup::bind(FGPropertyManager* parent)
 void FGFactorGroup::unbind(void)
 {
   unsigned i;
-  
   FGCoefficient::unbind();
   for (i=0; i < sum.size(); i++) { 
     sum[i]->unbind();
index dda152e01488a601db72a26f1e9fe2377004c0b8..5a6640cb1bebe76c000d2adef2c5f9c15743a667 100644 (file)
@@ -117,6 +117,9 @@ private:
   CoeffArray sum;
   double SDtotal;
   double totalValue;
+  string description;
+  string name;
+  FGPropertyManager *node;
   void Debug(int from);
 };
     
index 46602a049d5167aacd5c3c051745351fa271ff17..ee31e6fb32b52b2377438837acf9ec77f817c834 100644 (file)
@@ -166,21 +166,22 @@ string FGGroundReactions::GetGroundReactionValues(void)
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGGroundReactions::bind(void)
-{
+{ 
+  typedef double (FGGroundReactions::*PMF)(int) const;
   PropertyManager->Tie("gear/num-units", this,
                        &FGGroundReactions::GetNumGearUnits);  
   PropertyManager->Tie("moments/l-gear-lbsft", this,1,
-                       &FGGroundReactions::GetMoments);
+                       (PMF)&FGGroundReactions::GetMoments);
   PropertyManager->Tie("moments/m-gear-lbsft", this,2,
-                       &FGGroundReactions::GetMoments);
+                       (PMF)&FGGroundReactions::GetMoments);
   PropertyManager->Tie("moments/n-gear-lbsft", this,3,
-                       &FGGroundReactions::GetMoments);
+                       (PMF)&FGGroundReactions::GetMoments);
   PropertyManager->Tie("forces/fbx-gear-lbs", this,1,
-                       &FGGroundReactions::GetForces);
+                       (PMF)&FGGroundReactions::GetForces);
   PropertyManager->Tie("forces/fby-gear-lbs", this,2,
-                       &FGGroundReactions::GetForces);
+                       (PMF)&FGGroundReactions::GetForces);
   PropertyManager->Tie("forces/fbz-gear-lbs", this,3,
-                       &FGGroundReactions::GetForces);
+                       (PMF)&FGGroundReactions::GetForces);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index f76274036f68718ea2fc487cbe6386b006d5bb06..b3d3f598954c2d4658d48525bd44b5a5e077b94c 100644 (file)
@@ -129,12 +129,13 @@ bool FGInertial::LoadInertial(FGConfigFile* AC_cfg)
 
 void FGInertial::bind(void)
 {
+  typedef double (FGInertial::*PMF)(int) const;
   PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
-                       &FGInertial::GetForces);
+                       (PMF)&FGInertial::GetForces);
   PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
-                       &FGInertial::GetForces);
+                       (PMF)&FGInertial::GetForces);
   PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
-                       &FGInertial::GetForces);
+                       (PMF)&FGInertial::GetForces);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 54f39639ae30ac1b7e2c70e868eecd9ca9b488d6..053428829effd5ef82d90baacbcd552a3b52a81a 100644 (file)
@@ -191,7 +191,8 @@ double FGMassBalance::GetPMIxz(void)
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGMassBalance::bind(void)
-{
+{ 
+  typedef double (FGMassBalance::*PMF)(int) const;
   PropertyManager->Tie("inertia/mass-slugs", this,
                        &FGMassBalance::GetMass);
   PropertyManager->Tie("inertia/weight-lbs", this,
@@ -207,11 +208,11 @@ void FGMassBalance::bind(void)
   PropertyManager->Tie("inertia/ixz-lbsft2", this,
                        &FGMassBalance::GetIxz);
   PropertyManager->Tie("inertia/cg-x-ft", this,1,
-                       &FGMassBalance::GetXYZcg);
+                       (PMF)&FGMassBalance::GetXYZcg);
   PropertyManager->Tie("inertia/cg-y-ft", this,2,
-                       &FGMassBalance::GetXYZcg);
+                       (PMF)&FGMassBalance::GetXYZcg);
   PropertyManager->Tie("inertia/cg-z-ft", this,3,
-                       &FGMassBalance::GetXYZcg);
+                       (PMF)&FGMassBalance::GetXYZcg);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index cad5dc5ff34ba78c9e8b6ba52036ddfdd4521d1b..95001a307935a950f3399c28fbdcdaa451025326 100644 (file)
@@ -357,7 +357,6 @@ class FGPropertyManager:public SGPropertyNode {
     }
 
 
-    \f
     ////////////////////////////////////////////////////////////////////////
     // Convenience functions for setting property attributes.
     ////////////////////////////////////////////////////////////////////////
@@ -382,7 +381,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (node == 0)
         cout <<
               "Attempt to set archive flag for non-existant property "
-              << name;
+              << name << endl;
       else
         node->setAttribute(SGPropertyNode::ARCHIVE, state);
     }
@@ -407,7 +406,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (node == 0)
         cout <<
               "Attempt to set read flag for non-existant property "
-              << name;
+              << name << endl;
       else
         node->setAttribute(SGPropertyNode::READ, state);
     }
@@ -432,13 +431,12 @@ class FGPropertyManager:public SGPropertyNode {
       if (node == 0)
         cout <<
               "Attempt to set write flag for non-existant property "
-              << name;
+              << name << endl;
       else
         node->setAttribute(SGPropertyNode::WRITE, state);
     }
 
 
-    \f
     ////////////////////////////////////////////////////////////////////////
     // Convenience functions for tying properties, with logging.
     ////////////////////////////////////////////////////////////////////////
@@ -454,7 +452,7 @@ class FGPropertyManager:public SGPropertyNode {
     Untie (const string &name)
     {
       if (!untie(name.c_str()))
-        cout << "Failed to untie property " << name;
+        cout << "Failed to untie property " << name << endl;
     }
 
 
@@ -478,7 +476,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<bool>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -500,7 +498,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<int>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -522,7 +520,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<long>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -544,7 +542,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<float>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
 
@@ -566,7 +564,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValuePointer<double>(pointer),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to a pointer";
+              "Failed to tie property " << name << " to a pointer" << endl;
     }
 
     /* template <class V> void
@@ -610,7 +608,7 @@ class FGPropertyManager:public SGPropertyNode {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to functions";
+              "Failed to tie property " << name << " to functions" << endl;
     }
 
 
@@ -643,7 +641,7 @@ class FGPropertyManager:public SGPropertyNode {
                                                                   setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to indexed functions";
+              "Failed to tie property " << name << " to indexed functions" << endl;
     }
 
 
@@ -675,7 +673,7 @@ class FGPropertyManager:public SGPropertyNode {
                                     SGRawValueMethods<T,V>(*obj, getter, setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to object methods";
+              "Failed to tie property " << name << " to object methods" << endl;
     }
 
 
@@ -711,11 +709,10 @@ class FGPropertyManager:public SGPropertyNode {
                                                                   setter),
                                     useDefault))
         cout <<
-              "Failed to tie property " << name << " to indexed object methods";
+              "Failed to tie property " << name << " to indexed object methods" << endl;
     }
 
 };        
 
-
 #endif // FGPROPERTYMANAGER_H
 
index 7a31a46aafa53008e3ff71e33b724e62d5e3799d..4a97bdd94d15a48d9349d4d7c88db9b9429e9a85 100644 (file)
@@ -550,6 +550,7 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
 
 void FGPropulsion::bind(void)
 {
+  typedef double (FGPropulsion::*PMF)(int) const;
   /* PropertyManager->Tie("propulsion/num-engines", this,
                        &FGPropulsion::GetNumEngines);
   PropertyManager->Tie("propulsion/num-tanks", this,
@@ -559,17 +560,17 @@ void FGPropulsion::bind(void)
   PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
                        &FGPropulsion::GetnumSelectedOxiTanks);
   PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
-                       &FGPropulsion::GetForces);
+                       (PMF)&FGPropulsion::GetForces);
   PropertyManager->Tie("forces/fby-prop-lbs", this,2,
-                       &FGPropulsion::GetForces);
+                       (PMF)&FGPropulsion::GetForces);
   PropertyManager->Tie("forces/fbz-prop-lbs", this,3,
-                       &FGPropulsion::GetForces);
+                       (PMF)&FGPropulsion::GetForces);
   PropertyManager->Tie("moments/l-prop-lbsft", this,1,
-                       &FGPropulsion::GetMoments);
+                       (PMF)&FGPropulsion::GetMoments);
   PropertyManager->Tie("moments/m-prop-lbsft", this,2,
-                       &FGPropulsion::GetMoments);
+                       (PMF)&FGPropulsion::GetMoments);
   PropertyManager->Tie("moments/n-prop-lbsft", this,3,
-                       &FGPropulsion::GetMoments);
+                       (PMF)&FGPropulsion::GetMoments);
   //PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
   //                     &FGPropulsion::GetTanksWeight);
 }
index 18ce859aed1f707b57a680c5faf5438befb6f7ba..aa48af0e121b5a80ef02899ae963caec90661683 100644 (file)
@@ -158,36 +158,37 @@ void FGRotation::GetState(void)
 
 void FGRotation::bind(void)
 {
+  typedef double (FGRotation::*PMF)(int) const;
   PropertyManager->Tie("velocities/p-rad_sec", this,1,
-                       &FGRotation::GetPQR);
+                       (PMF)&FGRotation::GetPQR);
   PropertyManager->Tie("velocities/q-rad_sec", this,2,
-                       &FGRotation::GetPQR);
+                       (PMF)&FGRotation::GetPQR);
   PropertyManager->Tie("velocities/r-rad_sec", this,3,
-                       &FGRotation::GetPQR);
+                       (PMF)&FGRotation::GetPQR);
   PropertyManager->Tie("velocities/p-aero-rad_sec", this,1,
-                       &FGRotation::GetAeroPQR);
+                       (PMF)&FGRotation::GetAeroPQR);
   PropertyManager->Tie("velocities/q-aero-rad_sec", this,2,
-                       &FGRotation::GetAeroPQR);
+                       (PMF)&FGRotation::GetAeroPQR);
   PropertyManager->Tie("velocities/r-aero-rad_sec", this,3,
-                       &FGRotation::GetAeroPQR);
+                       (PMF)&FGRotation::GetAeroPQR);
   PropertyManager->Tie("accelerations/pdot-rad_sec", this,1,
-                       &FGRotation::GetPQRdot);
+                       (PMF)&FGRotation::GetPQRdot);
   PropertyManager->Tie("accelerations/qdot-rad_sec", this,2,
-                       &FGRotation::GetPQRdot);
+                       (PMF)&FGRotation::GetPQRdot);
   PropertyManager->Tie("accelerations/rdot-rad_sec", this,3,
-                       &FGRotation::GetPQRdot);
+                       (PMF)&FGRotation::GetPQRdot);
   PropertyManager->Tie("attitude/roll-rad", this,1,
-                       &FGRotation::GetEuler);
+                       (PMF)&FGRotation::GetEuler);
   PropertyManager->Tie("attitude/pitch-rad", this,2,
-                       &FGRotation::GetEuler);
+                       (PMF)&FGRotation::GetEuler);
   PropertyManager->Tie("attitude/heading-true-rad", this,3,
-                       &FGRotation::GetEuler);
+                       (PMF)&FGRotation::GetEuler);
   PropertyManager->Tie("velocities/phidot-rad_sec", this,1,
-                       &FGRotation::GetEulerRates);
+                       (PMF)&FGRotation::GetEulerRates);
   PropertyManager->Tie("velocities/thetadot-rad_sec", this,2,
-                       &FGRotation::GetEulerRates);
+                       (PMF)&FGRotation::GetEulerRates);
   PropertyManager->Tie("velocities/psidot-rad_sec", this,3,
-                       &FGRotation::GetEulerRates);
+                       (PMF)&FGRotation::GetEulerRates);
   PropertyManager->Tie("attitude/phi-rad", this,
                        &FGRotation::Getphi);
   PropertyManager->Tie("attitude/theta-rad", this,
index 4223e557a24151280d905660647d4adc3852b929..268af3aced03bec71d5ee2c3b3504ec3fef60e2c 100644 (file)
@@ -165,30 +165,31 @@ bool FGTranslation::Run(void)
 
 void FGTranslation::bind(void)
 {
+  typedef double (FGTranslation::*PMF)(int) const;
   PropertyManager->Tie("velocities/u-fps", this,1,
-                       &FGTranslation::GetUVW /*,
+                       (PMF)&FGTranslation::GetUVW /*,
                        &FGTranslation::SetUVW,
                        true */);
   PropertyManager->Tie("velocities/v-fps", this,2,
-                       &FGTranslation::GetUVW /*,
+                       (PMF)&FGTranslation::GetUVW /*,
                        &FGTranslation::SetUVW,
                        true*/);
   PropertyManager->Tie("velocities/w-fps", this,3,
-                       &FGTranslation::GetUVW /*,
+                       (PMF)&FGTranslation::GetUVW /*,
                        &FGTranslation::SetUVW,
                        true*/);
   PropertyManager->Tie("accelerations/udot-fps", this,1,
-                       &FGTranslation::GetUVWdot);
+                       (PMF)&FGTranslation::GetUVWdot);
   PropertyManager->Tie("accelerations/vdot-fps", this,2,
-                       &FGTranslation::GetUVWdot);
+                       (PMF)&FGTranslation::GetUVWdot);
   PropertyManager->Tie("accelerations/wdot-fps", this,3,
-                       &FGTranslation::GetUVWdot);
+                       (PMF)&FGTranslation::GetUVWdot);
   PropertyManager->Tie("velocities/u-aero-fps", this,1,
-                       &FGTranslation::GetAeroUVW);
+                       (PMF)&FGTranslation::GetAeroUVW);
   PropertyManager->Tie("velocities/v-aero-fps", this,2,
-                       &FGTranslation::GetAeroUVW);
+                       (PMF)&FGTranslation::GetAeroUVW);
   PropertyManager->Tie("velocities/w-aero-fps", this,3,
-                       &FGTranslation::GetAeroUVW);
+                       (PMF)&FGTranslation::GetAeroUVW);
   PropertyManager->Tie("aero/alpha-rad", this,
                        &FGTranslation::Getalpha,
                        &FGTranslation::Setalpha,
index 3b974f61a4582e54a5a8de0bd35723d416300cb5..e4a5c2ea658f412a824859a11780eec0637b8157 100644 (file)
@@ -610,23 +610,26 @@ void FGTrim::setupTurn(void){
     g = fdmex->GetInertial()->gravity(); 
     psidot = g*tan(phi) / fgic->GetUBodyFpsIC();
     cout << targetNlf << ", " << psidot << endl;
-  }  
+  }
+   
 }  
 
 void FGTrim::updateRates(void){
   if( mode == tTurn ) {
     double phi = fgic->GetRollAngleRadIC();
     double g = fdmex->GetInertial()->gravity(); 
+    double p,q,r,theta;
     if(fabs(phi) > 0.001 && fabs(phi) < 1.56 ) {
-      double p,q,r,theta,phi;
       theta=fgic->GetPitchAngleRadIC();
       phi=fgic->GetRollAngleRadIC();
       psidot = g*tan(phi) / fgic->GetUBodyFpsIC();
       p=-psidot*sin(theta);
       q=psidot*cos(theta)*sin(phi);
       r=psidot*cos(theta)*cos(phi);
-      fdmex->GetRotation()->SetPQR(p,q,r);
-    }
+    } else {
+      p=q=r=0;
+    }      
+    fdmex->GetRotation()->SetPQR(p,q,r);
   } else if( mode == tPullup && fabs(targetNlf-1) > 0.01) {
       float g,q,cgamma;
       FGColumnVector3 vPQR;
index f8417f8c57a22f6890c61ce26d7ad183cb1e0ff1..eca04970aca08c373393e13c0ec8a29b5827921d 100644 (file)
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#ifdef _MSC_VER
+#  pragma warning (disable : 4786)
+#endif
+
 #include <string>
 #include <stdlib.h>