]> git.mxchange.org Git - flightgear.git/commitdiff
Latest JSBSim changes.
authordavid <david>
Tue, 16 Apr 2002 13:15:29 +0000 (13:15 +0000)
committerdavid <david>
Tue, 16 Apr 2002 13:15:29 +0000 (13:15 +0000)
31 files changed:
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAerodynamics.h
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGCoefficient.h
src/FDM/JSBSim/FGConfigFile.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/FGMatrix33.cpp
src/FDM/JSBSim/FGModel.cpp
src/FDM/JSBSim/FGModel.h
src/FDM/JSBSim/FGOutput.cpp
src/FDM/JSBSim/FGPiston.cpp
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTable.cpp
src/FDM/JSBSim/FGTable.h
src/FDM/JSBSim/FGTranslation.cpp
src/FDM/JSBSim/JSBSim.hxx
src/FDM/JSBSim/Makefile.am
src/FDM/JSBSim/filtersjb/FGKinemat.cpp
src/FDM/JSBSim/filtersjb/FGSummer.cpp

index 9ec9edc8948ef417c69c5e3b69da192f266b7d7d..8cc13af2172d64bcc05fb1dac9dc4f99cc613a27 100644 (file)
@@ -112,7 +112,7 @@ bool FGAerodynamics::Run(void)
     }
     //correct signs of drag and lift to wind axes convention
     //positive forward, right, down
-    if( Translation->Getqbar() > 0) {
+    if ( Translation->Getqbar() > 0) {
       clsq = vFs(eLift) / (Aircraft->GetWingArea()*Translation->Getqbar());
       clsq *= clsq;
     }
@@ -161,7 +161,7 @@ bool FGAerodynamics::Load(FGConfigFile* AC_cfg)
       axis = AC_cfg->GetValue("NAME");
       AC_cfg->GetNextConfigLine();
       while ((token = AC_cfg->GetValue()) != string("/AXIS")) {
-        if( token == "COEFFICIENT" ) {
+        if ( token == "COEFFICIENT" ) {
           ca.push_back( new FGCoefficient(FDMExec) );
           ca.back()->Load(AC_cfg);
         } else if ( token == "GROUP" ) {
@@ -223,8 +223,8 @@ string FGAerodynamics::GetCoefficientValues(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGAerodynamics::bind(void){
-  
+void FGAerodynamics::bind(void)
+{
   PropertyManager->Tie("forces/fbx-aero-lbs", this,1,
                        &FGAerodynamics::GetForces);
   PropertyManager->Tie("forces/fby-aero-lbs", this,2,
@@ -251,24 +251,25 @@ void FGAerodynamics::bind(void){
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGAerodynamics::bindModel(void) { 
+void FGAerodynamics::bindModel(void)
+{ 
   unsigned i,j;
   FGPropertyManager* node;
   string axis_node_name;
   node = PropertyManager->GetNode("aero/buildup",true);
-  for(i=0;i<NAxes;i++) {
-     node=node->GetNode( string(AxisNames[i]),true );
+  for (i=0;i<NAxes;i++) {
+     node = node->GetNode( string(AxisNames[i]),true );
      for (j=0; j < Coeff[i].size(); j++) { 
        Coeff[i][j]->bind(node);
      } 
-     node=(FGPropertyManager*)node->getParent();                                         
+     node = (FGPropertyManager*)node->getParent();                                         
   }
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGAerodynamics::unbind(void){
+void FGAerodynamics::unbind(void)
+{
   unsigned i,j;
 
   PropertyManager->Untie("forces/fbx-aero-lbs");
@@ -283,7 +284,7 @@ void FGAerodynamics::unbind(void){
   PropertyManager->Untie("forces/lod-norm");
   PropertyManager->Untie("aero/cl-squared-norm");  
   
-  for( i=0; i<NAxes; i++ ) {
+  for ( i=0; i<NAxes; i++ ) {
      for ( j=0; j < Coeff[i].size(); j++ ) {
        Coeff[i][j]->unbind();
        
index 0fa843abf73bd78d754d0a75356af6d55325df80..7c0eb7728e6969574b608f22da07ec4f8d7b1864 100644 (file)
@@ -115,17 +115,17 @@ public:
   /** Gets the total aerodynamic force vector.
       @return a force vector reference. */
   FGColumnVector3& GetForces(void) {return vForces;}
-  double GetForces(int n) const {return vForces(n);}
+  inline double GetForces(int n) const {return vForces(n);}
 
   /** Gets the total aerodynamic moment vector.
       @return a moment vector reference. */
   FGColumnVector3& GetMoments(void) {return vMoments;}
-  double GetMoments(int n) const {return vMoments(n);}
+  inline double GetMoments(int n) const {return vMoments(n);}
 
-  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 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); }
   inline double GetLoD(void) const { return lod; }
   inline double GetClSquared(void) const { return clsq; } 
 
index c8dea78b7299328e2e5ed9f3c5400e69e7c5fd9a..30c172cffd050fddc277e513419884a36885fcd9 100644 (file)
@@ -175,13 +175,13 @@ void FGAtmosphere::Calculate(double altitude)
        i = lastIndex-1;
        while (htab[i] > altitude) i--;
     }   
-  } else if (altitude > htab[lastIndex+1]){
-    if (altitude >= htab[7]){
+  } else if (altitude > htab[lastIndex+1]) {
+    if (altitude >= htab[7]) {
       i = 7;
       altitude = htab[7];
     } else {
       i = lastIndex+1;
-      while(htab[i+1] < altitude) i++;
+      while (htab[i+1] < altitude) i++;
     }  
   } 
 
index 8bdcaffe3af37a33287790f0a2c4a9491950c4c1..de8230b1c064e933a2f0ad302b9939152eee192d 100644 (file)
@@ -150,7 +150,7 @@ bool FGAuxiliary::Run()
     // The radius R is calculated below in the vector vToEyePt.
     
     vPilotAccel.InitMatrix();   
-    if( Translation->GetVt() > 1 ) {
+    if ( Translation->GetVt() > 1 ) {
       vToEyePt = Aircraft->GetXYZep() - MassBalance->GetXYZcg();
       vToEyePt *= inchtoft;
       vPilotAccel =  Aerodynamics->GetForces() 
@@ -197,6 +197,60 @@ double FGAuxiliary::GetCrossWind(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+void FGAuxiliary::bind(void)
+{
+  PropertyManager->Tie("velocities/vc-fps", this,
+                       &FGAuxiliary::GetVcalibratedFPS);
+  PropertyManager->Tie("velocities/vc-kts", this,
+                       &FGAuxiliary::GetVcalibratedKTS);
+  PropertyManager->Tie("velocities/ve-fps", this,
+                       &FGAuxiliary::GetVequivalentFPS);
+  PropertyManager->Tie("velocities/ve-kts", this,
+                       &FGAuxiliary::GetVequivalentKTS);
+  PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
+                       &FGAuxiliary::GetPilotAccel);
+  PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
+                       &FGAuxiliary::GetPilotAccel);
+  PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
+                       &FGAuxiliary::GetPilotAccel);
+  PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
+                       &FGAuxiliary::GetNpilot);
+  PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
+                       &FGAuxiliary::GetNpilot);
+  PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
+                       &FGAuxiliary::GetNpilot);
+  PropertyManager->Tie("position/epa-rad", this,
+                       &FGAuxiliary::GetEarthPositionAngle);
+  /* PropertyManager->Tie("atmosphere/headwind-fps", this,
+                       &FGAuxiliary::GetHeadWind,
+                       true);
+  PropertyManager->Tie("atmosphere/crosswind-fps", this,
+                       &FGAuxiliary::GetCrossWind,
+                       true); */
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGAuxiliary::unbind(void)
+{
+  PropertyManager->Untie("velocities/vc-fps");
+  PropertyManager->Untie("velocities/vc-kts");
+  PropertyManager->Untie("velocities/ve-fps");
+  PropertyManager->Untie("velocities/ve-kts");
+  PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
+  PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
+  PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
+  PropertyManager->Untie("accelerations/n-pilot-x-norm");
+  PropertyManager->Untie("accelerations/n-pilot-y-norm");
+  PropertyManager->Untie("accelerations/n-pilot-z-norm");
+  PropertyManager->Untie("position/epa-rad");
+  /* PropertyManager->Untie("atmosphere/headwind-fps");
+  PropertyManager->Untie("atmosphere/crosswind-fps"); */
+
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGAuxiliary::GetState(void)
 {
   qbar = Translation->Getqbar();
@@ -252,51 +306,3 @@ void FGAuxiliary::Debug(int from)
   }
 }
 
-void FGAuxiliary::bind(void){
-  PropertyManager->Tie("velocities/vc-fps", this,
-                       &FGAuxiliary::GetVcalibratedFPS);
-  PropertyManager->Tie("velocities/vc-kts", this,
-                       &FGAuxiliary::GetVcalibratedKTS);
-  PropertyManager->Tie("velocities/ve-fps", this,
-                       &FGAuxiliary::GetVequivalentFPS);
-  PropertyManager->Tie("velocities/ve-kts", this,
-                       &FGAuxiliary::GetVequivalentKTS);
-  PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
-                       &FGAuxiliary::GetPilotAccel);
-  PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
-                       &FGAuxiliary::GetPilotAccel);
-  PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
-                       &FGAuxiliary::GetPilotAccel);
-  PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
-                       &FGAuxiliary::GetNpilot);
-  PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
-                       &FGAuxiliary::GetNpilot);
-  PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
-                       &FGAuxiliary::GetNpilot);
-  PropertyManager->Tie("position/epa-rad", this,
-                       &FGAuxiliary::GetEarthPositionAngle);
-  /* PropertyManager->Tie("atmosphere/headwind-fps", this,
-                       &FGAuxiliary::GetHeadWind,
-                       true);
-  PropertyManager->Tie("atmosphere/crosswind-fps", this,
-                       &FGAuxiliary::GetCrossWind,
-                       true); */
-
-}
-
-void FGAuxiliary::unbind(void){
-  PropertyManager->Untie("velocities/vc-fps");
-  PropertyManager->Untie("velocities/vc-kts");
-  PropertyManager->Untie("velocities/ve-fps");
-  PropertyManager->Untie("velocities/ve-kts");
-  PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
-  PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
-  PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
-  PropertyManager->Untie("accelerations/n-pilot-x-norm");
-  PropertyManager->Untie("accelerations/n-pilot-y-norm");
-  PropertyManager->Untie("accelerations/n-pilot-z-norm");
-  PropertyManager->Untie("position/epa-rad");
-  /* PropertyManager->Untie("atmosphere/headwind-fps");
-  PropertyManager->Untie("atmosphere/crosswind-fps"); */
-
-}
index 11deb848a87f8d6d48efd96ff8e51a56fb6c41f5..e2bee88db92f49cf8d45e0b8fc3c3409f95832bc 100644 (file)
@@ -68,21 +68,31 @@ CLASS IMPLEMENTATION
 
 FGCoefficient::FGCoefficient( FGFDMExec* fdex )
 {
-
   FDMExec = fdex;
   State   = FDMExec->GetState();
   Table   = 0;
   
   PropertyManager = FDMExec->GetPropertyManager();
   
-  bias=0;
-  gain=1;
-  
+  Table = (FGTable*)0L;
   LookupR = LookupC = 0;
-  
-  totalValue = 0;
-
-  if (debug_lvl & 2) cout << "Instantiated: FGCoefficient" << endl;
+  numInstances = 0;
+  rows = columns = 0;
+
+  StaticValue  = 0.0;
+  totalValue   = 0.0;
+  bias = 0.0;
+  gain = 1.0;
+
+  filename.erase();
+  description.erase();
+  name.erase();
+  method.erase();
+  multparms.erase();
+  multparmsRow.erase();
+  multparmsCol.erase();
+
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -90,7 +100,7 @@ FGCoefficient::FGCoefficient( FGFDMExec* fdex )
 FGCoefficient::~FGCoefficient()
 {
   if (Table) delete Table;
-  if (debug_lvl & 2) cout << "Destroyed:    FGCoefficient" << endl;
+  Debug(1);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -284,23 +294,24 @@ string FGCoefficient::GetCoefficientValues(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGCoefficient::bind(FGPropertyManager *parent) {
+void FGCoefficient::bind(FGPropertyManager *parent)
+{
   string mult;
   unsigned i;
   
   node=parent->GetNode(name,true);
   
   node->SetString("description",description);
-  if(LookupR) node->SetString("row-parm",LookupR->getName() );
-  if(LookupC) node->SetString("column-parm",LookupC->getName() );
+  if (LookupR) node->SetString("row-parm",LookupR->getName() );
+  if (LookupC) node->SetString("column-parm",LookupC->getName() );
   
   mult="";
-  if(multipliers.size() == 0) 
+  if (multipliers.size() == 0) 
     mult="none";
     
   for (i=0; i<multipliers.size(); i++) {
       mult += multipliers[i]->getName();
-      if( i < multipliers.size()-1 ) mult += " "; 
+      if ( i < multipliers.size()-1 ) mult += " "; 
   }
   node->SetString("multipliers",mult);
   
@@ -317,12 +328,14 @@ void FGCoefficient::bind(FGPropertyManager *parent) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGCoefficient::unbind(void) {
+void FGCoefficient::unbind(void)
+{
   node->Untie("SD-norm");
   node->Untie("value-lbs"); 
   node->Untie("bias");  
   node->Untie("gain");
-}  
+}
+  
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index 0ddbeb6962f5968a79920b6ff1fd60dba496a006..f447e229703cebc8591a19387056f6137e23a6e9 100644 (file)
@@ -131,13 +131,17 @@ public:
   virtual void bind(FGPropertyManager *parent);
   virtual void unbind(void);
 
+protected:
+  FGFDMExec* FDMExec;
+  string description;
+  string name;
+  FGPropertyManager *node;
+
 private:
   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
 
   int numInstances;
   string filename;
-  string description;
-  string name;
   string method;
   string multparms;
   string multparmsRow;
@@ -149,7 +153,6 @@ private:
   double totalValue;
   double bias,gain;
   FGPropertyManager *LookupR, *LookupC;
-  FGPropertyManager *node;
   
   MultVec multipliers;
   int rows, columns;
@@ -157,7 +160,6 @@ private:
   double SD; // Actual stability derivative (or other coefficient) value
   FGTable *Table;
 
-  FGFDMExec*      FDMExec;
   FGState*        State;
   FGAtmosphere*   Atmosphere;
   FGFCS*          FCS;
index e1b7e55c070591fcd640c44727139d8216542e24..ea3faf6c6cca5ad264db5684528345984efa3198 100644 (file)
@@ -136,7 +136,7 @@ private:
   string   LineComment;
   bool     CommentsOn;
   bool     Opened;
-  unsigned int      CurrentIndex;
+  unsigned int CurrentIndex;
   void Debug(int from);
 };
 
index 58a683c605dcca6cb5f3dbe65e9351ccf7842a90..a9b071b529a3a77893392b10f07f1a03637bad62 100644 (file)
@@ -76,12 +76,12 @@ FGFCS::FGFCS(FGFDMExec* fdmex) : FGModel(fdmex)
   DoNormalize=true;
   
   bind();
-  for(i=0;i<=NForms;i++) {
+  for (i=0;i<=NForms;i++) {
     DePos[i] = DaLPos[i] = DaRPos[i] = DrPos[i] = 0.0;
     DfPos[i] = DsbPos[i] = DspPos[i] = 0.0;
   }
     
-  for(i=0;i<NNorm;i++) { ToNormalize[i]=-1;}
+  for (i=0;i<NNorm;i++) { ToNormalize[i]=-1;}
   Debug(0);
 }
 
@@ -115,7 +115,7 @@ bool FGFCS::Run(void)
     for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
     for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
     for (i=0; i<Components.size(); i++)  Components[i]->Run();
-    if(DoNormalize) Normalize();
+    if (DoNormalize) Normalize();
   } else {
   }
 
@@ -265,7 +265,7 @@ bool FGFCS::Load(FGConfigFile* AC_cfg)
   
   Name = Name + ":" + AC_cfg->GetValue("NAME");
   if (debug_lvl > 0) cout << "    Control System Name: " << Name << endl;
-  if( AC_cfg->GetValue("NORMALIZE") == "FALSE") {
+  if ( AC_cfg->GetValue("NORMALIZE") == "FALSE") {
       DoNormalize=false;
       cout << "    Automatic Control Surface Normalization Disabled" << endl;
   }    
@@ -307,13 +307,13 @@ bool FGFCS::Load(FGConfigFile* AC_cfg)
   }
   //collect information for normalizing control surfaces
   string nodeName;
-  for(i=0;i<Components.size();i++) {
+  for (i=0;i<Components.size();i++) {
     
-    if( (Components[i]->GetType() == "AEROSURFACE_SCALE" 
+    if ( (Components[i]->GetType() == "AEROSURFACE_SCALE" 
           || Components[i]->GetType() == "KINEMAT")  
                     && Components[i]->GetOutputNode() ) { 
       nodeName= Components[i]->GetOutputNode()->GetName();  
-      if( nodeName == "elevator-pos-rad" ) {
+      if ( nodeName == "elevator-pos-rad" ) {
         ToNormalize[iDe]=i;
       } else if ( nodeName  == "left-aileron-pos-rad" 
                    || nodeName == "aileron-pos-rad" ) {
@@ -424,31 +424,31 @@ void FGFCS::Normalize(void) {
   //those that are have an index >=0 in the ToNormalize array
   //ToNormalize is filled in Load()
   
-  if( ToNormalize[iDe] > -1 ) {
+  if ( ToNormalize[iDe] > -1 ) {
     DePos[ofNorm] = Components[ToNormalize[iDe]]->GetOutputPct();
   }
   
-  if( ToNormalize[iDaL] > -1 ) {
+  if ( ToNormalize[iDaL] > -1 ) {
     DaLPos[ofNorm] = Components[ToNormalize[iDaL]]->GetOutputPct();
   }
   
-  if( ToNormalize[iDaR] > -1 ) {
+  if ( ToNormalize[iDaR] > -1 ) {
     DaRPos[ofNorm] = Components[ToNormalize[iDaR]]->GetOutputPct();
   }
 
-  if( ToNormalize[iDr] > -1 ) {
+  if ( ToNormalize[iDr] > -1 ) {
     DrPos[ofNorm] = Components[ToNormalize[iDr]]->GetOutputPct();
   }
        
-  if( ToNormalize[iDsb] > -1 ) { 
+  if ( ToNormalize[iDsb] > -1 ) { 
     DsbPos[ofNorm] = Components[ToNormalize[iDsb]]->GetOutputPct();
   }
   
-  if( ToNormalize[iDsp] > -1 ) {
+  if ( ToNormalize[iDsp] > -1 ) {
     DspPos[ofNorm] = Components[ToNormalize[iDsp]]->GetOutputPct();
   }
   
-  if( ToNormalize[iDf] > -1 ) {
+  if ( ToNormalize[iDf] > -1 ) {
     DfPos[ofNorm] = Components[ToNormalize[iDf]]->GetOutputPct();
   }
   
@@ -464,7 +464,8 @@ void FGFCS::Normalize(void) {
     
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGFCS::bind(void){
+void FGFCS::bind(void)
+{
   PropertyManager->Tie("fcs/aileron-cmd-norm", this,
                        &FGFCS::GetDaCmd,
                        &FGFCS::SetDaCmd,
@@ -598,11 +599,14 @@ void FGFCS::bind(void){
                        &FGFCS::SetGearPos,
                        true);
 }
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGFCS::bindModel(void){
+void FGFCS::bindModel(void)
+{
   unsigned i;
-  for(i=0;i<ThrottleCmd.size();i++) {
+
+  for (i=0; i<ThrottleCmd.size(); i++) {
     PropertyManager->Tie("fcs/throttle-cmd-norm",this,i,
                           &FGFCS::GetThrottleCmd,
                           &FGFCS::SetThrottleCmd,
@@ -611,7 +615,7 @@ void FGFCS::bindModel(void){
                           &FGFCS::GetThrottlePos,
                           &FGFCS::SetThrottlePos,
                           true );
-    if( MixtureCmd.size() > i ) {
+    if ( MixtureCmd.size() > i ) {
       PropertyManager->Tie("fcs/mixture-cmd-norm",this,i,
                             &FGFCS::GetMixtureCmd,
                             &FGFCS::SetMixtureCmd,
@@ -621,7 +625,7 @@ void FGFCS::bindModel(void){
                             &FGFCS::SetMixturePos,
                             true );
     }
-    if( PropAdvanceCmd.size() > i ) {
+    if ( PropAdvanceCmd.size() > i ) {
       PropertyManager->Tie("fcs/advance-cmd-norm",this,i,
                             &FGFCS::GetPropAdvanceCmd,
                             &FGFCS::SetPropAdvanceCmd,
@@ -636,7 +640,8 @@ void FGFCS::bindModel(void){
                           
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGFCS::unbind(void){
+void FGFCS::unbind(void)
+{
   PropertyManager->Untie("fcs/aileron-cmd-norm");
   PropertyManager->Untie("fcs/elevator-cmd-norm");
   PropertyManager->Untie("fcs/rudder-cmd-norm");
@@ -670,8 +675,6 @@ void FGFCS::unbind(void){
   PropertyManager->Untie("gear/gear-pos-norm");
 }
 
-
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
index c0e9f8f52d2073e30e59b79c4f273a6ca3ebe68d..84945690ddcc0506ff9d529ed33fe7615f0b3533 100644 (file)
@@ -210,7 +210,7 @@ bool FGFDMExec::Allocate(void)
   if (!Aircraft->InitModel())   {
     cerr << fgred << "Aircraft model init failed" << fgdef << endl;
     Error+=128;}
-  if (!Translation->InitModel()){
+  if (!Translation->InitModel()) {
     cerr << fgred << "Translation model init failed" << fgdef << endl;
     Error+=256;}
   if (!Rotation->InitModel())   {
index 5ced2e4c3756b414ab6a542c6e48aa0f7db72dd9..5355aaab581825f7ef273487a4d806c52cf40f35 100644 (file)
@@ -69,6 +69,10 @@ CLASS DOCUMENTATION
 /** Encapsulates the JSBSim simulation executive.
     @author Jon S. Berndt
     @version $Id$
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
 
     @doc This class is the interface class through which all other simulation classes
     are instantiated, initialized, and run. When integrated with FlightGear (or
index 32a8d4e71610bb46ad9fff7b33524468895328ec..1562109352a04cd360ae3dbae4d53d2ecc186eea 100644 (file)
@@ -121,7 +121,6 @@ double FGFactorGroup::TotalValue(void)
      totalValue += sum[i]->TotalValue();
      SDtotal += sum[i]->GetSD();
   }
-  //cout << totalValue << "  " << FGCoefficient::TotalValue() << endl;
   totalValue *= FGCoefficient::TotalValue();
   SDtotal *= FGCoefficient::GetSD();
   Debug(2);
@@ -130,13 +129,10 @@ double FGFactorGroup::TotalValue(void)
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-void FGFactorGroup::bind(FGPropertyManager* parent) {
-  
-  cout << "In FGFactorGroup::bind" << endl;
-  cout << parent->getName() << endl;
+void FGFactorGroup::bind(FGPropertyManager* parent)
+{
   unsigned i;
   node=parent->GetNode(name,true);
-  cout << node->getName() << endl;
   node->SetString("description",description);
   FGCoefficient::bind(node);
   for (i=0; i < sum.size(); i++) { 
@@ -148,7 +144,8 @@ void FGFactorGroup::bind(FGPropertyManager* parent) {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
   
-void FGFactorGroup::unbind(void) {
+void FGFactorGroup::unbind(void)
+{
   unsigned i;
   
   FGCoefficient::unbind();
index 2b4b7ae433041d83c4a1e510122dfb242dd2b391..dda152e01488a601db72a26f1e9fe2377004c0b8 100644 (file)
@@ -95,31 +95,29 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGFactorGroup: public FGCoefficient {
-  public:
-    FGFactorGroup(FGFDMExec* fdmex);
-    ~FGFactorGroup();
-    
-    bool Load(FGConfigFile *AC_cfg);
-    double TotalValue(void);
-    inline double GetValue(void) const { return totalValue; }
-    //string GetCoefficientStrings(void);
-    //string GetCoefficientValues(void);
-    inline double GetSD(void) { return SDtotal; }
-    inline double GetFactorSD(void) { return FGCoefficient::GetSD(); }
-    
-    void bind(FGPropertyManager* parent);
-    void unbind(void);
-  private:
-    FGFDMExec *FDMExec;
-    string name;
-    string description;
-    typedef vector<FGCoefficient*> CoeffArray;
-    CoeffArray sum;
-    double SDtotal;
-    double totalValue;
-    FGPropertyManager* node;
-    void Debug(int from);
+class FGFactorGroup: public FGCoefficient
+{
+public:
+  FGFactorGroup(FGFDMExec* fdmex);
+  ~FGFactorGroup();
+  
+  bool Load(FGConfigFile *AC_cfg);
+  double TotalValue(void);
+  inline double GetValue(void) const { return totalValue; }
+  //string GetCoefficientStrings(void);
+  //string GetCoefficientValues(void);
+  inline double GetSD(void) { return SDtotal; }
+  inline double GetFactorSD(void) { return FGCoefficient::GetSD(); }
+  
+  void bind(FGPropertyManager* parent);
+  void unbind(void);
+
+private:
+  typedef vector<FGCoefficient*> CoeffArray;
+  CoeffArray sum;
+  double SDtotal;
+  double totalValue;
+  void Debug(int from);
 };
     
 #endif 
index db38bd24de4edbb8309c7d07451595fd9ce65a22..46602a049d5167aacd5c3c051745351fa271ff17 100644 (file)
@@ -163,6 +163,39 @@ string FGGroundReactions::GetGroundReactionValues(void)
   return GroundReactionValues;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGGroundReactions::bind(void)
+{
+  PropertyManager->Tie("gear/num-units", this,
+                       &FGGroundReactions::GetNumGearUnits);  
+  PropertyManager->Tie("moments/l-gear-lbsft", this,1,
+                       &FGGroundReactions::GetMoments);
+  PropertyManager->Tie("moments/m-gear-lbsft", this,2,
+                       &FGGroundReactions::GetMoments);
+  PropertyManager->Tie("moments/n-gear-lbsft", this,3,
+                       &FGGroundReactions::GetMoments);
+  PropertyManager->Tie("forces/fbx-gear-lbs", this,1,
+                       &FGGroundReactions::GetForces);
+  PropertyManager->Tie("forces/fby-gear-lbs", this,2,
+                       &FGGroundReactions::GetForces);
+  PropertyManager->Tie("forces/fbz-gear-lbs", this,3,
+                       &FGGroundReactions::GetForces);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGGroundReactions::unbind(void)
+{
+  PropertyManager->Untie("gear/num-units");
+  PropertyManager->Untie("moments/l-gear-lbsft");
+  PropertyManager->Untie("moments/m-gear-lbsft");
+  PropertyManager->Untie("moments/n-gear-lbsft");
+  PropertyManager->Untie("forces/fbx-gear-lbs");
+  PropertyManager->Untie("forces/fby-gear-lbs");
+  PropertyManager->Untie("forces/fbz-gear-lbs");
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -209,30 +242,3 @@ void FGGroundReactions::Debug(int from)
   }
 }
 
-void FGGroundReactions::bind(void){
-
-  PropertyManager->Tie("gear/num-units", this,
-                       &FGGroundReactions::GetNumGearUnits);  
-  PropertyManager->Tie("moments/l-gear-lbsft", this,1,
-                       &FGGroundReactions::GetMoments);
-  PropertyManager->Tie("moments/m-gear-lbsft", this,2,
-                       &FGGroundReactions::GetMoments);
-  PropertyManager->Tie("moments/n-gear-lbsft", this,3,
-                       &FGGroundReactions::GetMoments);
-  PropertyManager->Tie("forces/fbx-gear-lbs", this,1,
-                       &FGGroundReactions::GetForces);
-  PropertyManager->Tie("forces/fby-gear-lbs", this,2,
-                       &FGGroundReactions::GetForces);
-  PropertyManager->Tie("forces/fbz-gear-lbs", this,3,
-                       &FGGroundReactions::GetForces);
-}
-
-void FGGroundReactions::unbind(void){
-  PropertyManager->Untie("gear/num-units");
-  PropertyManager->Untie("moments/l-gear-lbsft");
-  PropertyManager->Untie("moments/m-gear-lbsft");
-  PropertyManager->Untie("moments/n-gear-lbsft");
-  PropertyManager->Untie("forces/fbx-gear-lbs");
-  PropertyManager->Untie("forces/fby-gear-lbs");
-  PropertyManager->Untie("forces/fbz-gear-lbs");
-}
index 1475a6b93a3b416b6b1e9457c41880626b6ee4f3..f76274036f68718ea2fc487cbe6386b006d5bb06 100644 (file)
@@ -125,6 +125,27 @@ bool FGInertial::LoadInertial(FGConfigFile* AC_cfg)
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGInertial::bind(void)
+{
+  PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
+                       &FGInertial::GetForces);
+  PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
+                       &FGInertial::GetForces);
+  PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
+                       &FGInertial::GetForces);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGInertial::unbind(void)
+{
+  PropertyManager->Untie("forces/fbx-inertial-lbs");
+  PropertyManager->Untie("forces/fby-inertial-lbs");
+  PropertyManager->Untie("forces/fbz-inertial-lbs");
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -171,17 +192,3 @@ void FGInertial::Debug(int from)
   }
 }
 
-void FGInertial::bind(void){
-  PropertyManager->Tie("forces/fbx-inertial-lbs", this,1,
-                       &FGInertial::GetForces);
-  PropertyManager->Tie("forces/fby-inertial-lbs", this,2,
-                       &FGInertial::GetForces);
-  PropertyManager->Tie("forces/fbz-inertial-lbs", this,3,
-                       &FGInertial::GetForces);
-}
-
-void FGInertial::unbind(void){
-  PropertyManager->Untie("forces/fbx-inertial-lbs");
-  PropertyManager->Untie("forces/fby-inertial-lbs");
-  PropertyManager->Untie("forces/fbz-inertial-lbs");
-}
index 5d14dae02e626409d4427674d7f4b6073db29fd2..54f39639ae30ac1b7e2c70e868eecd9ca9b488d6 100644 (file)
@@ -188,6 +188,48 @@ double FGMassBalance::GetPMIxz(void)
   return I;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGMassBalance::bind(void)
+{
+  PropertyManager->Tie("inertia/mass-slugs", this,
+                       &FGMassBalance::GetMass);
+  PropertyManager->Tie("inertia/weight-lbs", this,
+                       &FGMassBalance::GetWeight);
+  PropertyManager->Tie("inertia/ixx-lbsft2", this,
+                       &FGMassBalance::GetIxx);
+  PropertyManager->Tie("inertia/iyy-lbsft2", this,
+                       &FGMassBalance::GetIyy);
+  PropertyManager->Tie("inertia/izz-lbsft2", this,
+                       &FGMassBalance::GetIzz);
+  PropertyManager->Tie("inertia/ixy-lbsft2", this,
+                       &FGMassBalance::GetIxy);
+  PropertyManager->Tie("inertia/ixz-lbsft2", this,
+                       &FGMassBalance::GetIxz);
+  PropertyManager->Tie("inertia/cg-x-ft", this,1,
+                       &FGMassBalance::GetXYZcg);
+  PropertyManager->Tie("inertia/cg-y-ft", this,2,
+                       &FGMassBalance::GetXYZcg);
+  PropertyManager->Tie("inertia/cg-z-ft", this,3,
+                       &FGMassBalance::GetXYZcg);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGMassBalance::unbind(void)
+{
+  PropertyManager->Untie("inertia/mass-slugs");
+  PropertyManager->Untie("inertia/weight-lbs");
+  PropertyManager->Untie("inertia/ixx-lbsft2");
+  PropertyManager->Untie("inertia/iyy-lbsft2");
+  PropertyManager->Untie("inertia/izz-lbsft2");
+  PropertyManager->Untie("inertia/ixy-lbsft2");
+  PropertyManager->Untie("inertia/ixz-lbsft2");
+  PropertyManager->Untie("inertia/cg-x-ft");
+  PropertyManager->Untie("inertia/cg-y-ft");
+  PropertyManager->Untie("inertia/cg-z-ft");
+}
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -242,38 +284,3 @@ void FGMassBalance::Debug(int from)
   }
 }
 
-void FGMassBalance::bind(void){
-  PropertyManager->Tie("inertia/mass-slugs", this,
-                       &FGMassBalance::GetMass);
-  PropertyManager->Tie("inertia/weight-lbs", this,
-                       &FGMassBalance::GetWeight);
-  PropertyManager->Tie("inertia/ixx-lbsft2", this,
-                       &FGMassBalance::GetIxx);
-  PropertyManager->Tie("inertia/iyy-lbsft2", this,
-                       &FGMassBalance::GetIyy);
-  PropertyManager->Tie("inertia/izz-lbsft2", this,
-                       &FGMassBalance::GetIzz);
-  PropertyManager->Tie("inertia/ixy-lbsft2", this,
-                       &FGMassBalance::GetIxy);
-  PropertyManager->Tie("inertia/ixz-lbsft2", this,
-                       &FGMassBalance::GetIxz);
-  PropertyManager->Tie("inertia/cg-x-ft", this,1,
-                       &FGMassBalance::GetXYZcg);
-  PropertyManager->Tie("inertia/cg-y-ft", this,2,
-                       &FGMassBalance::GetXYZcg);
-  PropertyManager->Tie("inertia/cg-z-ft", this,3,
-                       &FGMassBalance::GetXYZcg);
-}
-
-void FGMassBalance::unbind(void){
-  PropertyManager->Untie("inertia/mass-slugs");
-  PropertyManager->Untie("inertia/weight-lbs");
-  PropertyManager->Untie("inertia/ixx-lbsft2");
-  PropertyManager->Untie("inertia/iyy-lbsft2");
-  PropertyManager->Untie("inertia/izz-lbsft2");
-  PropertyManager->Untie("inertia/ixy-lbsft2");
-  PropertyManager->Untie("inertia/ixz-lbsft2");
-  PropertyManager->Untie("inertia/cg-x-ft");
-  PropertyManager->Untie("inertia/cg-y-ft");
-  PropertyManager->Untie("inertia/cg-z-ft");
-}
index dc88dc2a353e899b8ac811799e614cbae6d6bd7a..830e99dddfb9c8715fa429b7f4f72715ca8e7f3d 100644 (file)
@@ -328,7 +328,7 @@ FGMatrix33 FGMatrix33::operator/(const double scalar)
 {
   FGMatrix33 Quot;
   
-  if( scalar != 0 ) {
+  if ( scalar != 0 ) {
          double tmp = 1.0/scalar;
     Quot(1,1) = data[1][1] * tmp;
     Quot(1,2) = data[1][2] * tmp;
@@ -351,7 +351,7 @@ FGMatrix33 FGMatrix33::operator/(const double scalar)
 
 void FGMatrix33::operator/=(const double scalar)
 {
-  if( scalar != 0 ) {
+  if ( scalar != 0 ) {
     double tmp = 1.0/scalar;
     data[1][1] *= tmp;
     data[1][2] *= tmp;
index d8b0193814bd2ac475ed38ee8805a210fc734fa1..6520196e6f418e00fa3bbc9b8dc6900944e73d64 100644 (file)
@@ -91,7 +91,6 @@ FGModel::FGModel(FGFDMExec* fdmex)
   //must be brought up now.
   PropertyManager = FDMExec->GetPropertyManager();
   
-  
   exe_ctr     = 1;
 
   if (debug_lvl & 2) cout << "              FGModel Base Class" << endl;
index f9bf7e86f572ae7e08e7b6e0de88fda91aec41c0..740f4521b0f6ea9b8a218ed6030c0c8198a23a28 100644 (file)
@@ -97,6 +97,10 @@ CLASS DOCUMENTATION
 
 /** Base class for all scheduled JSBSim models
     @author Jon S. Berndt
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
   */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index e7efe9cfbe95c0b36327459b92d67bb235d5a203..4d9e9491900155971430cf3833ea8d578012513c 100644 (file)
@@ -117,7 +117,7 @@ void FGOutput::SetType(string type)
     Type = otSocket;
   } else if (type == "TERMINAL") {
     Type = otTerminal;
-  } else if (type != string("NONE")){
+  } else if (type != string("NONE")) {
     Type = otUnknown;
     cerr << "Unknown type of output specified in config file" << endl;
   }
index e96146cb9131e5eee179fd109043739dbc786154..46eaaccf10892e9bafca2650d78dc87406d04183 100644 (file)
@@ -163,7 +163,7 @@ double FGPiston::Calculate(double PowerRequired)
   //Assume lean limit at 22 AFR for now - thats a thi of 0.668
   //This might be a bit generous, but since there's currently no audiable warning of impending
   //cutout in the form of misfiring and/or rough running its probably reasonable for now.
-  if(equivalence_ratio < 0.668)
+  if (equivalence_ratio < 0.668)
     Running = false;
 
   doEnginePower();
@@ -231,7 +231,7 @@ void FGPiston::doEngineStartup(void)
 
   if ((!Running) && (spark) && (fuel)) {
   // start the engine if revs high enough
-    if(Cranking) {
+    if (Cranking) {
       if ((RPM > 450) && (crank_counter > 175)) {
         //Add a little delay to startup on the starter
         Running = true;
@@ -355,7 +355,7 @@ void FGPiston::doFuelFlow(void)
 void FGPiston::doEnginePower(void)
 {
   ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
-  if(Running) {        
+  if (Running) {       
     double ManXRPM = ManifoldPressure_inHg * RPM;
         // FIXME: this needs to be generalized
     Percentage_Power = (6e-9 * ManXRPM * ManXRPM) + (8e-4 * ManXRPM) - 1.0;
index 1fcd1e56191f8a9512b2a7ae8447f653214c6bdb..01a36c649eae0d284f6142d3fd70ee7e7ed237f8 100644 (file)
@@ -229,52 +229,9 @@ void FGPosition::SetDistanceAGL(double tt) {
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//    The bitmasked value choices are as follows:
-//    unset: In this case (the default) JSBSim would only print
-//       out the normally expected messages, essentially echoing
-//       the config files as they are read. If the environment
-//       variable is not set, debug_lvl is set to 1 internally
-//    0: This requests JSBSim not to output any messages
-//       whatsoever.
-//    1: This value explicity requests the normal JSBSim
-//       startup messages
-//    2: This value asks for a message to be printed out when
-//       a class is instantiated
-//    4: When this value is set, a message is displayed when a
-//       FGModel object executes its Run() method
-//    8: When this value is set, various runtime state variables
-//       are printed out periodically
-//    16: When set various parameters are sanity checked and
-//       a message is printed out when they go out of bounds
 
-void FGPosition::Debug(int from)
+void FGPosition::bind(void)
 {
-  if (debug_lvl <= 0) return;
-
-  if (debug_lvl & 1) { // Standard console startup message output
-    if (from == 0) { // Constructor
-
-    }
-  }
-  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
-    if (from == 0) cout << "Instantiated: FGPosition" << endl;
-    if (from == 1) cout << "Destroyed:    FGPosition" << endl;
-  }
-  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
-  }
-  if (debug_lvl & 8 ) { // Runtime state variables
-  }
-  if (debug_lvl & 16) { // Sanity checking
-  }
-  if (debug_lvl & 64) {
-    if (from == 0) { // Constructor
-      cout << IdSrc << endl;
-      cout << IdHdr << endl;
-    }
-  }
-}
-
-void FGPosition::bind(void){
   PropertyManager->Tie("velocities/v-north-fps", this,
                        &FGPosition::GetVn);
   PropertyManager->Tie("velocities/v-east-fps", this,
@@ -319,7 +276,10 @@ void FGPosition::bind(void){
                        &FGPosition::GetHOverBMAC);
 }
 
-void FGPosition::unbind(void){
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGPosition::unbind(void)
+{
   PropertyManager->Untie("velocities/v-north-fps");
   PropertyManager->Untie("velocities/v-east-fps");
   PropertyManager->Untie("velocities/v-down-fps");
@@ -338,3 +298,50 @@ void FGPosition::unbind(void){
   PropertyManager->Untie("aero/h_b-cg-ft");
   PropertyManager->Untie("aero/h_b-mac-ft");
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    The bitmasked value choices are as follows:
+//    unset: In this case (the default) JSBSim would only print
+//       out the normally expected messages, essentially echoing
+//       the config files as they are read. If the environment
+//       variable is not set, debug_lvl is set to 1 internally
+//    0: This requests JSBSim not to output any messages
+//       whatsoever.
+//    1: This value explicity requests the normal JSBSim
+//       startup messages
+//    2: This value asks for a message to be printed out when
+//       a class is instantiated
+//    4: When this value is set, a message is displayed when a
+//       FGModel object executes its Run() method
+//    8: When this value is set, various runtime state variables
+//       are printed out periodically
+//    16: When set various parameters are sanity checked and
+//       a message is printed out when they go out of bounds
+
+void FGPosition::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+    if (from == 0) { // Constructor
+
+    }
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGPosition" << endl;
+    if (from == 1) cout << "Destroyed:    FGPosition" << endl;
+  }
+  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+  }
+  if (debug_lvl & 8 ) { // Runtime state variables
+  }
+  if (debug_lvl & 16) { // Sanity checking
+  }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
+
index 39f278a9668d137e630f7a522e9ae34ec41a2fee..7a31a46aafa53008e3ff71e33b724e62d5e3799d 100644 (file)
@@ -131,9 +131,9 @@ bool FGPropulsion::GetSteadyState(void)
         PowerAvailable = Engines[i]->Calculate(Thrusters[i]->GetPowerRequired());
         lastThrust = currentThrust;
         currentThrust = Thrusters[i]->Calculate(PowerAvailable);
-        if(fabs(lastThrust-currentThrust) < 0.0001) {
+        if (fabs(lastThrust-currentThrust) < 0.0001) {
           steady_count++;
-          if(steady_count > 120) { steady=true; }
+          if (steady_count > 120) { steady=true; }
         } else {
           steady_count=0;
         }
@@ -548,7 +548,8 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGPropulsion::bind(void){
+void FGPropulsion::bind(void)
+{
   /* PropertyManager->Tie("propulsion/num-engines", this,
                        &FGPropulsion::GetNumEngines);
   PropertyManager->Tie("propulsion/num-tanks", this,
@@ -575,7 +576,8 @@ void FGPropulsion::bind(void){
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGPropulsion::unbind(void){
+void FGPropulsion::unbind(void)
+{
   /* PropertyManager->Untie("propulsion/num-engines");
   PropertyManager->Untie("propulsion/num-tanks"); */
   PropertyManager->Untie("propulsion/num-sel-fuel-tanks");
index d07c973e5ba0981787416cc2eb507d8e67295278..18ce859aed1f707b57a680c5faf5438befb6f7ba 100644 (file)
@@ -155,60 +155,9 @@ void FGRotation::GetState(void)
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//    The bitmasked value choices are as follows:
-//    unset: In this case (the default) JSBSim would only print
-//       out the normally expected messages, essentially echoing
-//       the config files as they are read. If the environment
-//       variable is not set, debug_lvl is set to 1 internally
-//    0: This requests JSBSim not to output any messages
-//       whatsoever.
-//    1: This value explicity requests the normal JSBSim
-//       startup messages
-//    2: This value asks for a message to be printed out when
-//       a class is instantiated
-//    4: When this value is set, a message is displayed when a
-//       FGModel object executes its Run() method
-//    8: When this value is set, various runtime state variables
-//       are printed out periodically
-//    16: When set various parameters are sanity checked and
-//       a message is printed out when they go out of bounds
 
-void FGRotation::Debug(int from)
+void FGRotation::bind(void)
 {
-  if (debug_lvl <= 0) return;
-
-  if (debug_lvl & 1) { // Standard console startup message output
-    if (from == 0) { // Constructor
-
-    }
-  }
-  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
-    if (from == 0) cout << "Instantiated: FGRotation" << endl;
-    if (from == 1) cout << "Destroyed:    FGRotation" << endl;
-  }
-  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
-  }
-  if (debug_lvl & 8 ) { // Runtime state variables
-  }
-  if (debug_lvl & 16) { // Sanity check variables
-    if (from == 2) {
-      if (fabs(vPQR(eP)) > 100)
-        cout << "FGRotation::P (Roll Rate) out of bounds: " << vPQR(eP) << endl;
-      if (fabs(vPQR(eQ)) > 100)
-        cout << "FGRotation::Q (Pitch Rate) out of bounds: " << vPQR(eQ) << endl;
-      if (fabs(vPQR(eR)) > 100)
-        cout << "FGRotation::R (Yaw Rate) out of bounds: " << vPQR(eR) << endl;
-    }
-  }
-  if (debug_lvl & 64) {
-    if (from == 0) { // Constructor
-      cout << IdSrc << endl;
-      cout << IdHdr << endl;
-    }
-  }
-}
-
-void FGRotation::bind(void){
   PropertyManager->Tie("velocities/p-rad_sec", this,1,
                        &FGRotation::GetPQR);
   PropertyManager->Tie("velocities/q-rad_sec", this,2,
@@ -247,7 +196,10 @@ void FGRotation::bind(void){
                        &FGRotation::Getpsi);
 }
 
-void FGRotation::unbind(void){
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGRotation::unbind(void)
+{
   PropertyManager->Untie("velocities/p-rad_sec");
   PropertyManager->Untie("velocities/q-rad_sec");
   PropertyManager->Untie("velocities/r-rad_sec");
@@ -267,3 +219,58 @@ void FGRotation::unbind(void){
   PropertyManager->Untie("attitude/theta-rad");
   PropertyManager->Untie("attitude/psi-true-rad");
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    The bitmasked value choices are as follows:
+//    unset: In this case (the default) JSBSim would only print
+//       out the normally expected messages, essentially echoing
+//       the config files as they are read. If the environment
+//       variable is not set, debug_lvl is set to 1 internally
+//    0: This requests JSBSim not to output any messages
+//       whatsoever.
+//    1: This value explicity requests the normal JSBSim
+//       startup messages
+//    2: This value asks for a message to be printed out when
+//       a class is instantiated
+//    4: When this value is set, a message is displayed when a
+//       FGModel object executes its Run() method
+//    8: When this value is set, various runtime state variables
+//       are printed out periodically
+//    16: When set various parameters are sanity checked and
+//       a message is printed out when they go out of bounds
+
+void FGRotation::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+    if (from == 0) { // Constructor
+
+    }
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGRotation" << endl;
+    if (from == 1) cout << "Destroyed:    FGRotation" << endl;
+  }
+  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+  }
+  if (debug_lvl & 8 ) { // Runtime state variables
+  }
+  if (debug_lvl & 16) { // Sanity check variables
+    if (from == 2) {
+      if (fabs(vPQR(eP)) > 100)
+        cout << "FGRotation::P (Roll Rate) out of bounds: " << vPQR(eP) << endl;
+      if (fabs(vPQR(eQ)) > 100)
+        cout << "FGRotation::Q (Pitch Rate) out of bounds: " << vPQR(eQ) << endl;
+      if (fabs(vPQR(eR)) > 100)
+        cout << "FGRotation::R (Yaw Rate) out of bounds: " << vPQR(eR) << endl;
+    }
+  }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
+
index 3359a85498d0d7747a39ccff9a65aba0e922428c..9569220225696a18290a81c703cb868ef0b772b4 100644 (file)
@@ -233,8 +233,8 @@ void FGState::Initialize(double U, double V, double W,
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::Initialize(FGInitialCondition *FGIC) {
-
+void FGState::Initialize(FGInitialCondition *FGIC)
+{
   double tht,psi,phi;
   double U, V, W, h;
   double latitude, longitude;
@@ -263,7 +263,8 @@ void FGState::Initialize(FGInitialCondition *FGIC) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::InitMatrices(double phi, double tht, double psi) {
+void FGState::InitMatrices(double phi, double tht, double psi)
+{
   double thtd2, psid2, phid2;
   double Sthtd2, Spsid2, Sphid2;
   double Cthtd2, Cpsid2, Cphid2;
@@ -299,7 +300,8 @@ void FGState::InitMatrices(double phi, double tht, double psi) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::CalcMatrices(void) {
+void FGState::CalcMatrices(void)
+{
   double Q0Q0, Q1Q1, Q2Q2, Q3Q3;
   double Q0Q1, Q0Q2, Q0Q3, Q1Q2;
   double Q1Q3, Q2Q3;
@@ -331,7 +333,8 @@ void FGState::CalcMatrices(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::IntegrateQuat(FGColumnVector3 vPQR, int rate) {
+void FGState::IntegrateQuat(FGColumnVector3 vPQR, int rate)
+{
   vQdot(1) = -0.5*(vQtrn(2)*vPQR(eP) + vQtrn(3)*vPQR(eQ) + vQtrn(4)*vPQR(eR));
   vQdot(2) =  0.5*(vQtrn(1)*vPQR(eP) + vQtrn(3)*vPQR(eR) - vQtrn(4)*vPQR(eQ));
   vQdot(3) =  0.5*(vQtrn(1)*vPQR(eQ) + vQtrn(4)*vPQR(eP) - vQtrn(2)*vPQR(eR));
@@ -345,7 +348,8 @@ void FGState::IntegrateQuat(FGColumnVector3 vPQR, int rate) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGColumnVector3& FGState::CalcEuler(void) {
+FGColumnVector3& FGState::CalcEuler(void)
+{
   if (mTl2b(3,3) == 0.0) mTl2b(3,3) = 0.0000001;
   if (mTl2b(1,1) == 0.0) mTl2b(1,1) = 0.0000001;
 
@@ -427,16 +431,18 @@ void FGState::ReportState(void)
                    FDMExec->GetMassBalance()->GetXYZcg(2),
                    FDMExec->GetMassBalance()->GetXYZcg(3));
   cout << out;             
-  if( FCS->GetDfPos() <= 0.01)
+  if ( FCS->GetDfPos() <= 0.01)
     snprintf(flap,10,"Up");
   else
     snprintf(flap,10,"%2.0f",FCS->GetDfPos());
-  if(FCS->GetGearPos() < 0.01)
+
+  if (FCS->GetGearPos() < 0.01)
     snprintf(gear,12,"Up");
-  else if(FCS->GetGearPos() > 0.99)
+  else if (FCS->GetGearPos() > 0.99)
     snprintf(gear,12,"Down");
   else
-    snprintf(gear,12,"In Transit");   
+    snprintf(gear,12,"In Transit");
+
   snprintf(out,80, "    Flaps: %3s  Gear: %12s\n",flap,gear);
   cout << out;
   snprintf(out,80, "    Speed: %4.0f KCAS  Mach: %5.2f\n",
@@ -491,7 +497,8 @@ void FGState::ReportState(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::InitPropertyMaps(void)  {
+void FGState::InitPropertyMaps(void)
+{
   ParamNameToProp[  "FG_TIME" ]="sim-time-sec";
   ParamNameToProp[  "FG_QBAR" ]="aero/qbar-psf";
   ParamNameToProp[  "FG_WINGAREA" ]="metrics/Sw-sqft";
@@ -568,24 +575,23 @@ void FGState::InitPropertyMaps(void)  {
   ParamNameToProp[  "FG_VBARV" ]="metrics/vbarv-norm";     
   ParamNameToProp[  "FG_GEAR_CMD" ]="gear/gear-cmd-norm";
   ParamNameToProp[  "FG_GEAR_POS" ]="gear/gear-pos-norm";
-  
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGState::bind(void) {
+void FGState::bind(void)
+{
   PropertyManager->Tie("sim-time-sec",this,
                         &FGState::Getsim_time);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                         
-void FGState::unbind(void) {
+void FGState::unbind(void)
+{
   PropertyManager->Untie("sim-time-sec");
 }
 
-
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -632,4 +638,3 @@ void FGState::Debug(int from)
   }
 }
 
-
index 20e0fdd18320cbb51c205e53a40190ffc299624e..3f81558936d3e020562eeb27e0b0aaf3b753ca6c 100644 (file)
@@ -115,7 +115,8 @@ double FGTable::GetValue(double key)
   int r;
 
   for (r=1; r<=nRows; r++) if (Data[r][0] >= key) break;
-  r = r < 2 ? 2 : (r > nRows ? nRows : r);
+  r   = Clamp(2, r, nRows);
+  key = Clamp(Data[1][0], key, Data[nRows][0]);
 
   // make sure denominator below does not go to zero.
 
@@ -140,10 +141,12 @@ double FGTable::GetValue(double rowKey, double colKey)
   int r, c;
 
   for (r=1;r<=nRows;r++) if (Data[r][0] >= rowKey) break;
-  for (c=1;c<=nCols;c++) if (Data[0][c] >= colKey) break;
+  r = Clamp(2, r, nRows);
+  rowKey = Clamp(Data[1][0], rowKey, Data[nRows][0]);
 
-  c = c < 2 ? 2 : (c > nCols ? nCols : c);
-  r = r < 2 ? 2 : (r > nRows ? nRows : r);
+  for (c=1;c<=nCols;c++) if (Data[0][c] >= colKey) break;
+  c = Clamp(2, c, nCols);
+  colKey = Clamp(Data[0][1], colKey, Data[0][nCols]);
 
   rFactor = (rowKey - Data[r-1][0]) / (Data[r][0] - Data[r-1][0]);
   cFactor = (colKey - Data[0][c-1]) / (Data[0][c] - Data[0][c-1]);
index 9325a60218d9ea6d4ed28b1034bc7e7211b23b00..5ca46308329e8a2ef3c027808097386ee003033d 100644 (file)
@@ -98,10 +98,11 @@ public:
   void operator<<(FGConfigFile&);
   FGTable& operator<<(const double n);
   FGTable& operator<<(const int n);
-//  FGTable& operator<<(const double n);
   inline double GetElement(int r, int c) {return Data[r][c];}
   void Print(void);
-  
+  template <class T> T Clamp(T lower, T value, T upper)
+    {return value < lower ? lower : (value > upper ? upper : value);}
+
 private:
   enum type {tt1D, tt2D} Type;
   double** Data;
index bee3a0adfabafc34f7010b027c5e6d4999093d65..4223e557a24151280d905660647d4adc3852b929 100644 (file)
@@ -162,70 +162,9 @@ bool FGTranslation::Run(void)
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//    The bitmasked value choices are as follows:
-//    unset: In this case (the default) JSBSim would only print
-//       out the normally expected messages, essentially echoing
-//       the config files as they are read. If the environment
-//       variable is not set, debug_lvl is set to 1 internally
-//    0: This requests JSBSim not to output any messages
-//       whatsoever.
-//    1: This value explicity requests the normal JSBSim
-//       startup messages
-//    2: This value asks for a message to be printed out when
-//       a class is instantiated
-//    4: When this value is set, a message is displayed when a
-//       FGModel object executes its Run() method
-//    8: When this value is set, various runtime state variables
-//       are printed out periodically
-//    16: When set various parameters are sanity checked and
-//       a message is printed out when they go out of bounds
 
-void FGTranslation::Debug(int from)
+void FGTranslation::bind(void)
 {
-  if (debug_lvl <= 0) return;
-
-  if (debug_lvl & 1) { // Standard console startup message output
-    if (from == 0) { // Constructor
-
-    }
-  }
-  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
-    if (from == 0) cout << "Instantiated: FGTranslation" << endl;
-    if (from == 1) cout << "Destroyed:    FGTranslation" << endl;
-  }
-  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
-  }
-  if (debug_lvl & 8 ) { // Runtime state variables
-  }
-  if (debug_lvl & 16) { // Sanity checking
-    if (fabs(vUVW(eU)) > 1e6)
-      cout << "FGTranslation::U velocity out of bounds: " << vUVW(eU) << endl;
-    if (fabs(vUVW(eV)) > 1e6)
-      cout << "FGTranslation::V velocity out of bounds: " << vUVW(eV) << endl;
-    if (fabs(vUVW(eW)) > 1e6)
-      cout << "FGTranslation::W velocity out of bounds: " << vUVW(eW) << endl;
-    if (fabs(vUVWdot(eU)) > 1e4)
-      cout << "FGTranslation::U acceleration out of bounds: " << vUVWdot(eU) << endl;
-    if (fabs(vUVWdot(eV)) > 1e4)
-      cout << "FGTranslation::V acceleration out of bounds: " << vUVWdot(eV) << endl;
-    if (fabs(vUVWdot(eW)) > 1e4)
-      cout << "FGTranslation::W acceleration out of bounds: " << vUVWdot(eW) << endl;
-    if (Mach > 100 || Mach < 0.00)
-      cout << "FGTranslation::Mach is out of bounds: " << Mach << endl;
-    if (qbar > 1e6 || qbar < 0.00)
-      cout << "FGTranslation::qbar is out of bounds: " << qbar << endl;
-  }
-  if (debug_lvl & 64) {
-    if (from == 0) { // Constructor
-      cout << IdSrc << endl;
-      cout << IdHdr << endl;
-    }
-  }
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-void FGTranslation::bind(void){
   PropertyManager->Tie("velocities/u-fps", this,1,
                        &FGTranslation::GetUVW /*,
                        &FGTranslation::SetUVW,
@@ -284,7 +223,8 @@ void FGTranslation::bind(void){
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGTranslation::unbind(void){
+void FGTranslation::unbind(void)
+{
   PropertyManager->Untie("velocities/u-fps");
   PropertyManager->Untie("velocities/v-fps");
   PropertyManager->Untie("velocities/w-fps");
@@ -302,3 +242,66 @@ void FGTranslation::unbind(void){
   PropertyManager->Untie("aero/alphadot-rad_sec");
   PropertyManager->Untie("aero/betadot-rad_sec");
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    The bitmasked value choices are as follows:
+//    unset: In this case (the default) JSBSim would only print
+//       out the normally expected messages, essentially echoing
+//       the config files as they are read. If the environment
+//       variable is not set, debug_lvl is set to 1 internally
+//    0: This requests JSBSim not to output any messages
+//       whatsoever.
+//    1: This value explicity requests the normal JSBSim
+//       startup messages
+//    2: This value asks for a message to be printed out when
+//       a class is instantiated
+//    4: When this value is set, a message is displayed when a
+//       FGModel object executes its Run() method
+//    8: When this value is set, various runtime state variables
+//       are printed out periodically
+//    16: When set various parameters are sanity checked and
+//       a message is printed out when they go out of bounds
+
+void FGTranslation::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+    if (from == 0) { // Constructor
+
+    }
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGTranslation" << endl;
+    if (from == 1) cout << "Destroyed:    FGTranslation" << endl;
+  }
+  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+  }
+  if (debug_lvl & 8 ) { // Runtime state variables
+  }
+  if (debug_lvl & 16) { // Sanity checking
+    if (fabs(vUVW(eU)) > 1e6)
+      cout << "FGTranslation::U velocity out of bounds: " << vUVW(eU) << endl;
+    if (fabs(vUVW(eV)) > 1e6)
+      cout << "FGTranslation::V velocity out of bounds: " << vUVW(eV) << endl;
+    if (fabs(vUVW(eW)) > 1e6)
+      cout << "FGTranslation::W velocity out of bounds: " << vUVW(eW) << endl;
+    if (fabs(vUVWdot(eU)) > 1e4)
+      cout << "FGTranslation::U acceleration out of bounds: " << vUVWdot(eU) << endl;
+    if (fabs(vUVWdot(eV)) > 1e4)
+      cout << "FGTranslation::V acceleration out of bounds: " << vUVWdot(eV) << endl;
+    if (fabs(vUVWdot(eW)) > 1e4)
+      cout << "FGTranslation::W acceleration out of bounds: " << vUVWdot(eW) << endl;
+    if (Mach > 100 || Mach < 0.00)
+      cout << "FGTranslation::Mach is out of bounds: " << Mach << endl;
+    if (qbar > 1e6 || qbar < 0.00)
+      cout << "FGTranslation::qbar is out of bounds: " << qbar << endl;
+  }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
+
index 67bdae4cfa68f31db9f38a1c575382156d52f485..2f8b362c89a40a9f0022458d7e2724132eeeef25 100644 (file)
@@ -89,6 +89,10 @@ CLASS DOCUMENTATION
     @author Tony Peden (Maintained and refined)
     @version $Id$
     @see main in file JSBSim.cpp (use main() wrapper for standalone usage)
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/JSBSim.hxx?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/JSBSim.cxx?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index a1552a0b74f762e54b7d6b376270f2390a44fe51..f1fb2a722af3cd52cdceacacfba2dc0244d2b4e9 100644 (file)
@@ -48,7 +48,7 @@ libJSBSim_a_SOURCES = \
        FGEngine.cpp FGEngine.h \
        FGTank.cpp FGTank.h \
        FGfdmSocket.cpp FGfdmSocket.h \
-  FGPropertyManager.h \
+        FGPropertyManager.h \
        JSBSim.cxx JSBSim.hxx
 
 
index 40452260149ed8d8dcfd72f3b10870dbb2f2d8e5..ea91f734dfc9aad258d8a9220a911bf7725895d8 100644 (file)
@@ -79,7 +79,7 @@ FGKinemat::FGKinemat(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
       }
     } else if ( token == "DETENTS" ) {
       *AC_cfg >> NumDetents;
-      for(int i=0;i<NumDetents;i++) {
+      for (int i=0;i<NumDetents;i++) {
         *AC_cfg >> tmpDetent;
         *AC_cfg >> tmpTime;
         Detents.push_back(tmpDetent);
@@ -114,13 +114,13 @@ bool FGKinemat::Run(void ) {
   InputCmd = Input*Detents[NumDetents-1];
   OutputPos = OutputNode->getDoubleValue();
   
-  if(InputCmd < Detents[0]) {
+  if (InputCmd < Detents[0]) {
     fi=0;
     InputCmd=Detents[0];
     lastInputCmd=InputCmd;
     OutputPos=Detents[0];
     Output=OutputPos;
-  } else if(InputCmd > Detents[NumDetents-1]) {
+  } else if (InputCmd > Detents[NumDetents-1]) {
     fi=NumDetents-1;
     InputCmd=Detents[fi];
     lastInputCmd=InputCmd;
@@ -128,32 +128,32 @@ bool FGKinemat::Run(void ) {
     Output=OutputPos;
   } else {
     //cout << "FGKinemat::Run Handle: " << InputCmd << " Position: " << OutputPos << endl;
-    if(dt <= 0)
+    if (dt <= 0)
       OutputPos=InputCmd;
     else {
-      if(InputCmd != lastInputCmd) {
+      if (InputCmd != lastInputCmd) {
         InTransit=1;
       }
       //cout << "FGKinemat::Run, InTransit: " << InTransit << endl;
-      if(InTransit) {
+      if (InTransit) {
         //fprintf(stderr,"InputCmd: %g, OutputPos: %g\n",InputCmd,OutputPos);
         fi=0;
-        while(Detents[fi] < InputCmd) {
+        while (Detents[fi] < InputCmd) {
           fi++;
         }
-        if(OutputPos < InputCmd) {
-          if(TransitionTimes[fi] > 0)
+        if (OutputPos < InputCmd) {
+          if (TransitionTimes[fi] > 0)
             output_transit_rate=(Detents[fi] - Detents[fi-1])/TransitionTimes[fi];
           else
             output_transit_rate=(Detents[fi] - Detents[fi-1])/5;
           //cout << "FGKinemat::Run, output_transit_rate: " << output_transit_rate << endl;  
         } else {
-          if(TransitionTimes[fi+1] > 0)
+          if (TransitionTimes[fi+1] > 0)
             output_transit_rate=(Detents[fi] - Detents[fi+1])/TransitionTimes[fi+1];
           else
             output_transit_rate=(Detents[fi] - Detents[fi+1])/5;
         }
-        if(fabs(OutputPos - InputCmd) > fabs(dt*output_transit_rate) ) {
+        if (fabs(OutputPos - InputCmd) > fabs(dt*output_transit_rate) ) {
           OutputPos+=output_transit_rate*dt;
           //cout << "FGKinemat::Run, OutputPos: " << OutputPos 
           //     << " dt: " << dt << endl;
@@ -167,7 +167,7 @@ bool FGKinemat::Run(void ) {
     Output = OutputPos;
   }
   
-  if( Detents[NumDetents-1] > 0 ) {
+  if ( Detents[NumDetents-1] > 0 ) {
     OutputPct = Output / Detents[NumDetents-1];
   }
   
@@ -204,7 +204,7 @@ void FGKinemat::Debug(int from)
       cout << "      ID: " << ID << endl;
       cout << "      INPUT: " << InputNode->getName() << endl;
       cout << "      DETENTS: " << NumDetents << endl;
-      for(int i=0;i<NumDetents;i++) {
+      for (int i=0;i<NumDetents;i++) {
         cout << "        " << Detents[i] << " " << TransitionTimes[i] << endl;
       }
       if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
index df77ceaa8ddda08577934e1fe08607b89aaf988b..5fb742a771623f3eab4b28966d873200152724cd 100644 (file)
@@ -110,7 +110,7 @@ FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
 FGSummer::~FGSummer()
 {
   unsigned i;
-  for(i=0;i<Inputs.size();i++) {
+  for (i=0;i<Inputs.size();i++) {
     delete Inputs[i];
   }  
   Debug(1);