]> git.mxchange.org Git - flightgear.git/commitdiff
Latest JSBSim updates, including use of new "JSBSim" namespace
authortony <tony>
Fri, 24 Jan 2003 12:55:28 +0000 (12:55 +0000)
committertony <tony>
Fri, 24 Jan 2003 12:55:28 +0000 (12:55 +0000)
104 files changed:
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAerodynamics.h
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAircraft.h
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGAtmosphere.h
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGAuxiliary.h
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGCoefficient.h
src/FDM/JSBSim/FGColumnVector3.cpp
src/FDM/JSBSim/FGColumnVector3.h
src/FDM/JSBSim/FGColumnVector4.cpp
src/FDM/JSBSim/FGColumnVector4.h
src/FDM/JSBSim/FGConfigFile.cpp
src/FDM/JSBSim/FGConfigFile.h
src/FDM/JSBSim/FGEngine.cpp
src/FDM/JSBSim/FGEngine.h
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGFactorGroup.cpp
src/FDM/JSBSim/FGFactorGroup.h
src/FDM/JSBSim/FGForce.cpp
src/FDM/JSBSim/FGForce.h
src/FDM/JSBSim/FGGroundReactions.cpp
src/FDM/JSBSim/FGGroundReactions.h
src/FDM/JSBSim/FGInertial.cpp
src/FDM/JSBSim/FGInertial.h
src/FDM/JSBSim/FGInitialCondition.cpp
src/FDM/JSBSim/FGInitialCondition.h
src/FDM/JSBSim/FGJSBBase.cpp
src/FDM/JSBSim/FGJSBBase.h
src/FDM/JSBSim/FGLGear.cpp
src/FDM/JSBSim/FGLGear.h
src/FDM/JSBSim/FGMassBalance.cpp
src/FDM/JSBSim/FGMassBalance.h
src/FDM/JSBSim/FGMatrix33.cpp
src/FDM/JSBSim/FGMatrix33.h
src/FDM/JSBSim/FGModel.cpp
src/FDM/JSBSim/FGModel.h
src/FDM/JSBSim/FGNozzle.cpp
src/FDM/JSBSim/FGNozzle.h
src/FDM/JSBSim/FGOutput.cpp
src/FDM/JSBSim/FGOutput.h
src/FDM/JSBSim/FGPiston.cpp
src/FDM/JSBSim/FGPiston.h
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPosition.h
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropeller.h
src/FDM/JSBSim/FGPropertyManager.cpp
src/FDM/JSBSim/FGPropertyManager.h
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGPropulsion.h
src/FDM/JSBSim/FGRocket.cpp
src/FDM/JSBSim/FGRocket.h
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGRotor.cpp
src/FDM/JSBSim/FGRotor.h
src/FDM/JSBSim/FGScript.cpp
src/FDM/JSBSim/FGScript.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGState.h
src/FDM/JSBSim/FGTable.cpp
src/FDM/JSBSim/FGTable.h
src/FDM/JSBSim/FGTank.cpp
src/FDM/JSBSim/FGTank.h
src/FDM/JSBSim/FGThruster.cpp
src/FDM/JSBSim/FGThruster.h
src/FDM/JSBSim/FGTranslation.cpp
src/FDM/JSBSim/FGTranslation.h
src/FDM/JSBSim/FGTrim.cpp
src/FDM/JSBSim/FGTrim.h
src/FDM/JSBSim/FGTrimAxis.cpp
src/FDM/JSBSim/FGTrimAxis.h
src/FDM/JSBSim/FGTurbine.cpp
src/FDM/JSBSim/FGTurbine.h
src/FDM/JSBSim/FGUtility.cpp
src/FDM/JSBSim/FGUtility.h
src/FDM/JSBSim/FGfdmSocket.cpp
src/FDM/JSBSim/FGfdmSocket.h
src/FDM/JSBSim/JSBSim.cxx
src/FDM/JSBSim/JSBSim.hxx
src/FDM/JSBSim/Makefile.am
src/FDM/JSBSim/filtersjb/FGDeadBand.cpp
src/FDM/JSBSim/filtersjb/FGDeadBand.h
src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp
src/FDM/JSBSim/filtersjb/FGFCSComponent.h
src/FDM/JSBSim/filtersjb/FGFilter.cpp
src/FDM/JSBSim/filtersjb/FGFilter.h
src/FDM/JSBSim/filtersjb/FGGain.cpp
src/FDM/JSBSim/filtersjb/FGGain.h
src/FDM/JSBSim/filtersjb/FGGradient.cpp
src/FDM/JSBSim/filtersjb/FGGradient.h
src/FDM/JSBSim/filtersjb/FGKinemat.cpp
src/FDM/JSBSim/filtersjb/FGKinemat.h
src/FDM/JSBSim/filtersjb/FGSummer.cpp
src/FDM/JSBSim/filtersjb/FGSummer.h
src/FDM/JSBSim/filtersjb/FGSwitch.cpp
src/FDM/JSBSim/filtersjb/FGSwitch.h
src/FDM/JSBSim/filtersjb/Makefile.am

index eaeaa194d13ef51bfe2551adf8f2e9fb21caf967..214a6f0b614bffd573c69688ba8e6bd70f8e0849 100644 (file)
@@ -41,6 +41,8 @@ INCLUDES
 #include "FGCoefficient.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_AERODYNAMICS;
 
@@ -404,3 +406,4 @@ void FGAerodynamics::Debug(int from)
   }
 }
 
+} // namespace JSBSim
index 5adac5b8604a3245e076b1b1ba11f956164fb5ae..66796a32540f5fd6d2f89b65fe8c8f818e591821 100644 (file)
@@ -94,6 +94,7 @@ CLASS DOCUMENTATION
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
 
 class FGAerodynamics : public FGModel {
 
@@ -177,6 +178,8 @@ private:
   void Debug(int from);
 };
 
+} // namespace JSBSim
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 2e94ecfad3e285655e281ef6ffa2408325432cd0..b8b532a57b2654d7bedb56804dcae1a10edfed00 100644 (file)
@@ -84,6 +84,8 @@ INCLUDES
 #include "FGOutput.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -380,3 +382,4 @@ void FGAircraft::Debug(int from)
   }
 }
 
+} // namespace JSBSim
index 7d4b0be6145d63e3f5c992c776b4e54653b460d9..0a9b107b6d15afb163d83495a8c86e9bf93fdc8b 100644 (file)
@@ -109,6 +109,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGAircraft : public FGModel {
 public:
   /** Constructor
@@ -186,6 +188,7 @@ private:
   void Debug(int from);
 };
 
+} // namespace JSBSim
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 0e945a3cc677ab312ccb3ccd90c65cf52cf6a33e..e6f58d8f26538c3d92613b32125012b5bbd3274b 100644 (file)
@@ -62,6 +62,8 @@ INCLUDES
 #include "FGColumnVector4.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_ATMOSPHERE;
 
@@ -431,3 +433,4 @@ void FGAtmosphere::Debug(int from)
   }
 }
 
+} // namespace JSBSim
index 43894a114122c70090237eda12320dcb1ab67928..4290f1714250029aae888bdb2f325ff29c7e1a41 100644 (file)
@@ -82,6 +82,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 *******************************************************************************/
 
+namespace JSBSim {
+
 class FGAtmosphere : public FGModel {
 public:
 
@@ -190,6 +192,8 @@ private:
   void Debug(int from);
 };
 
+} // namespace JSBSim
+
 /******************************************************************************/
 #endif
 
index fcadc8000920225bcfb26437c995b1621f65399b..845341b24c15b2cebbaafdc769e1bdf6d73ffdbe 100644 (file)
@@ -57,6 +57,8 @@ INCLUDES
 #include "FGColumnVector4.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_AUXILIARY;
 
@@ -315,3 +317,4 @@ void FGAuxiliary::Debug(int from)
   }
 }
 
+} // namespace JSBSim
index 9210156c64b365cca7b51937e504d2ac173b1a1c..3f6018edca503f8a6671f604ab3ded11c4d85a3c 100644 (file)
@@ -75,6 +75,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGAuxiliary : public FGModel {
 public:
   /** Constructor
@@ -129,6 +131,8 @@ private:
   void Debug(int from);
 };
 
+} // namespace JSBSim
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 523d8ff7adf1d328e837b2aafdc003b01eb90a64..ab7927a441b568c788c4d951d8d6908c5263bb6d 100644 (file)
@@ -61,6 +61,8 @@ INCLUDES
 #  include STL_IOMANIP
 #endif
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_COEFFICIENT;
 
@@ -420,3 +422,4 @@ void FGCoefficient::Debug(int from)
   }
 }
 
+} // namespace JSBSim
index a809ae11a5ff3c5a40891c658c3b70c2382d6bfa..55ad7a165018d3f9aa7fe9ad6736e46fa74acee0 100644 (file)
@@ -61,6 +61,8 @@ using std::vector;
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFDMExec;
 class FGState;
 class FGAtmosphere;
@@ -208,6 +210,8 @@ private:
   virtual void Debug(int from);
 };
 
+} // using namespace JSBSim
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 4684da5294ef8926a89e28c39d01f3b89c42d733..25431763162353cd5dc7edcf22a41e6ff7de5f62 100644 (file)
@@ -20,6 +20,8 @@ INCLUDES
 
 #include "FGColumnVector3.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_COLUMNVECTOR3;
 
@@ -324,3 +326,4 @@ void FGColumnVector3::Debug(int from)
   }
 }
 
+} // namespace JSBSim
index dad53abf0b690af4c975209e0f8656defdefa842..35a5c8743a9770d3d6c9f4a2956c62a072a4c45e 100644 (file)
@@ -66,6 +66,8 @@ FORWARD DECLARATIONS
 DECLARATION: FGColumnVector3
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGColumnVector3 : public FGJSBBase
 {
 public:
@@ -110,6 +112,6 @@ private:
   int rowCtr;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index 8a0cd99f2bd82440663b44f9400d4e3146243c17..de65c011754d18b9f5108a17e4b590858e22d4f0 100644 (file)
@@ -20,6 +20,8 @@ INCLUDES
 
 #include "FGColumnVector4.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_COLUMNVECTOR4;
 
@@ -309,5 +311,4 @@ void FGColumnVector4::Debug(int from)
     }
   }
 }
-
-
+}
index eca61df038e8d26226647cf343ffb0c6f2a5aa32..ab65e1402cd5d6ed75e0e478d5f0ef67c07ae1f1 100644 (file)
@@ -66,6 +66,8 @@ FORWARD DECLARATIONS
 DECLARATION: FGColumnVector4
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGColumnVector4 : public FGJSBBase
 {
 public:
@@ -109,7 +111,7 @@ private:
   int rowCtr;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index a3bb234773072f35c0c77d566d57eb67cafab6f4..e0d42cb061833250ba028305c5041a3f38efc7c9 100644 (file)
@@ -21,6 +21,8 @@ INCLUDES
 #include <stdlib.h>
 #include <math.h>
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_CONFIGFILE;
 
@@ -339,4 +341,4 @@ void FGConfigFile::Debug(int from)
     }
   }
 }
-
+}
index f71367eaf429a2cf0bcefedb3d8fffe10d9e7c53..f415210d842faf1007ba349f85513235b8e23433 100644 (file)
@@ -104,6 +104,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGConfigFile : public FGJSBBase
 {
 public:
@@ -146,7 +148,7 @@ private:
 
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index f977a8846bcbf6808ef4ad509cca5a336ef8e572..0117166d7209cf48f085b14a34e4da9e844f33fd 100644 (file)
@@ -56,6 +56,8 @@ INCLUDES
 #include "FGEngine.h"
 #include "FGTank.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_ENGINE;
 
@@ -211,4 +213,4 @@ void FGEngine::Debug(int from)
     }
   }
 }
-
+}
index fde9f0adb368294832e3dff82929922f0a1b2d62..14d15149bc59e4e7209046dc8716c23f84a1cbbb 100644 (file)
@@ -67,6 +67,9 @@ DEFINITIONS
 #define ID_ENGINE "$Id$"
 
 using std::string;
+using std::vector;
+
+namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -84,8 +87,6 @@ class FGPosition;
 class FGAuxiliary;
 class FGOutput;
 
-using std::vector;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -241,7 +242,7 @@ protected:
   vector <int> SourceTanks;
   virtual void Debug(int from);
 };
-
+}
 #include "FGState.h"
 #include "FGFDMExec.h"
 #include "FGAtmosphere.h"
index c6ee9bd831788338d6bafc9eda2d540bc31e542c..c53d5e75e0c0e451c275af836ca5d9e61d65d0bf 100644 (file)
@@ -57,6 +57,8 @@ INCLUDES
 #include "filtersjb/FGSummer.h"
 #include "filtersjb/FGKinemat.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FCS;
 
@@ -896,3 +898,4 @@ void FGFCS::Debug(int from)
   }
 }
 
+}
index 4af471e749f11849302e1be6c2a4d4e27454f76e..c2f560b47254fb0152e6e57bded32ed85de9bdef 100644 (file)
@@ -65,6 +65,8 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf, NNorm } FcIdx;
 typedef enum { ofRad=0, ofNorm, ofMag , NForms} OutputForm;
 
@@ -644,7 +646,7 @@ private:
   int ToNormalize[NNorm];
   void Debug(int from);
 };
-
+}
 
 #endif
 
index 75ee4615aee88a1c36eb1d8d8fe2e26e923db679..166fdee453296f24a61bd2dbbcf663b63e503216 100644 (file)
@@ -73,6 +73,8 @@ INCLUDES
 #include "FGInitialCondition.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FDMEXEC;
 
@@ -245,12 +247,11 @@ bool FGFDMExec::Allocate(void)
   if (Error > 0) result = false;
   
   IC = new FGInitialCondition(this); 
-  //Trim is allocated as needed by GetTrim()                                 
-
   
   // Schedule a model. The second arg (the integer) is the pass number. For
   // instance, the atmosphere model gets executed every fifth pass it is called
   // by the executive. Everything else here gets executed each pass.
+  // IC and Trim objects are NOT scheduled.
 
   Schedule(Atmosphere,      1);
   Schedule(FCS,             1);
@@ -265,9 +266,6 @@ bool FGFDMExec::Allocate(void)
   Schedule(Position,        1);
   Schedule(Auxiliary,       1);
   Schedule(Output,          1);
-  //IC and Trim are *not* scheduled objects
-  
-  
 
   modelLoaded = false;
 
@@ -700,4 +698,5 @@ void FGFDMExec::Debug(int from)
     }
   }
 }
+}
 
index 08f6161bcd4282bd7bb01c2e8b0ea4297b7fd1e8..155d3aba9e7a9f17fb3e5380d02ef370f4a82919 100644 (file)
@@ -113,6 +113,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFDMExec : public FGJSBBase
 {
 public:
@@ -317,7 +319,7 @@ private:
   bool DeAllocate(void);
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 9d96439eacb57bac824d5a36e3756d83607f465c..ebf1da9a6d7d26ff8ced04c7c7df6ac05d0d0220 100644 (file)
@@ -60,6 +60,8 @@ INCLUDES
 #  include STL_IOMANIP
 #endif
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FACTORGROUP;
 
@@ -200,3 +202,4 @@ void FGFactorGroup::Debug(int from)
   }
 }
 
+}
index 9a118c188fa6f6b26883144a793976292f55bea3..cbed19b3d6737cb33163edc1b4ebd16dda370ea8 100644 (file)
@@ -62,6 +62,8 @@ using std::vector;
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFDMExec;
 class FGState;
 class FGAtmosphere;
@@ -120,5 +122,5 @@ private:
   FGPropertyManager *node;
   void Debug(int from);
 };
-    
+}    
 #endif 
index 91dd746e6f2a6a8b9800080120203bde3b6645f0..86d4b915ca6c654c5c91e6f9bceeb05592fb065a 100644 (file)
@@ -48,6 +48,8 @@ and the cg.
 #include "FGColumnVector4.h"
 #include "FGForce.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FORCE;
 
@@ -179,4 +181,4 @@ void FGForce::Debug(int from)
     }
   }
 }
-
+}
index dfacc4a194c4f990c97a761c40c51e610a05bea7..a54e69f2b2d28afb9dd5c7b35c27b2492baf82c8 100644 (file)
@@ -217,6 +217,8 @@ and vMn, the moments, can be made directly. Otherwise, the usage is similar.<br>
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGForce : public FGJSBBase
 {
 public:
@@ -328,6 +330,6 @@ private:
 
   virtual void Debug(int from);
 };
-
+}
 #endif
 
index 6762719868d0a2f8e948cac8eaf4b0caa29a9fde..960cda2624119bb28d7e2733fdcca9a6c873794c 100644 (file)
@@ -38,6 +38,8 @@ INCLUDES
 #include "FGGroundReactions.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GROUNDREACTIONS;
 
@@ -269,4 +271,4 @@ void FGGroundReactions::Debug(int from)
     }
   }
 }
-
+}
index 842d70837db06fb9c5e0b7c2cf30bd57eff65e62..e589263e327755fb89e6b3c7d26d134693b140f1 100644 (file)
@@ -65,6 +65,8 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGGroundReactions : public FGModel
 {
 public:
@@ -100,7 +102,7 @@ private:
 
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 091f6647d671ca5a8f505c314d56982557dbed7d..53516939f92c1cd9db6364ef89dbba20c055f907 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 #include "FGPosition.h"
 #include "FGMassBalance.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_INERTIAL;
 
@@ -190,4 +192,4 @@ void FGInertial::Debug(int from)
     }
   }
 }
-
+}
index 5130c92db8bb2b2204a9acaea02c950c481087ad..1ec306610be18c47a9daf33ac9ca70272bcc7e94 100644 (file)
@@ -66,6 +66,8 @@ CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
+namespace JSBSim {
+
 class FGInertial : public FGModel {
 
 public:
@@ -101,7 +103,7 @@ private:
   double GM;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index f9fbc31b5c7236005480376e85f17e77b2ca261e..16a912192476fa3d573d43461b2e1af126b1cb49 100644 (file)
@@ -57,6 +57,8 @@ INCLUDES
 #include "FGConfigFile.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_INITIALCONDITION;
 
@@ -1021,4 +1023,4 @@ void FGInitialCondition::Debug(int from)
     }
   }
 }
-
+}
index 753b26dc21f2563cd4f64b245bf7e4c40f002920..c83838e45596950f447c8aa05c388ef404a88145 100644 (file)
@@ -60,6 +60,8 @@ DEFINITIONS
 
 #define ID_INITIALCONDITION "$Id$"
 
+namespace JSBSim {
+
 typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
 typedef enum { setwned, setwmd, setwhc } windset; 
 
@@ -301,6 +303,6 @@ private:
   bool solve(double *y, double x);
   void Debug(int from);
 };
-
+}
 #endif
 
index a38a4c6975ef2605459bbdedf8bebc5f740e1520..db7c0c348ec1c6a431fbc9da37cab08c789334b5 100644 (file)
@@ -37,6 +37,8 @@ INCLUDES
 
 #include "FGJSBBase.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_JSBBASE;
 
@@ -67,7 +69,7 @@ const double FGJSBBase::in3tom3 = 1.638706E-5;
 const double FGJSBBase::Reng = 1716.0;
 const double FGJSBBase::SHRatio = 1.40;
 const string FGJSBBase::needed_cfg_version = "1.60";
-const string FGJSBBase::JSBSim_version = "0.9.2";
+const string FGJSBBase::JSBSim_version = "0.9.4";
 
 queue <FGJSBBase::Message*> FGJSBBase::Messages;
 FGJSBBase::Message FGJSBBase::localMsg;
@@ -183,4 +185,5 @@ void FGJSBBase::disableHighLighting(void) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+} // namespace JSBSim
 
index f203f36e3d6611ea08753946fe7e139eadb13892..80d3e17ea78e11d18dba47760d350a6daf366f5b 100644 (file)
@@ -105,6 +105,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGJSBBase {
 public:
   /// Constructor for FGJSBBase.
@@ -231,7 +233,7 @@ protected:
   static const string needed_cfg_version;
   static const string JSBSim_version;
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index ac73b6ee5a5b64840fead85bbc5c8fb2a67c8925..b717df1c11e32a1f8f3aef26b366f7eea74edee0 100644 (file)
@@ -41,6 +41,8 @@ INCLUDES
 #include "FGLGear.h"
 #include <algorithm>
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -49,7 +51,6 @@ DEFINITIONS
 GLOBAL DATA
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_LGEAR;
 
@@ -107,8 +108,9 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : Exec(fdmex)
   WOW = lastWOW = true; // should the value be initialized to true?
   ReportEnable = true;
   FirstContact = false;
-  Reported = false;
-  DistanceTraveled = 0.0;
+  StartedGroundRun = false;
+  TakeoffReported = LandingReported = false;
+  LandingDistanceTraveled = TakeoffDistanceTraveled = TakeoffDistanceTraveled50ft = 0.0;
   MaximumStrutForce = MaximumStrutTravel = 0.0;
   SinkRate = GroundSpeed = 0.0;
 
@@ -154,7 +156,10 @@ FGLGear::FGLGear(const FGLGear& lgear)
   lastWOW            = lgear.lastWOW;
   ReportEnable       = lgear.ReportEnable;
   FirstContact       = lgear.FirstContact;
-  DistanceTraveled   = lgear.DistanceTraveled;
+  StartedGroundRun   = lgear.StartedGroundRun;
+  LandingDistanceTraveled   = lgear.LandingDistanceTraveled;
+  TakeoffDistanceTraveled   = lgear.TakeoffDistanceTraveled;
+  TakeoffDistanceTraveled50ft   = lgear.TakeoffDistanceTraveled50ft;
   MaximumStrutForce  = lgear.MaximumStrutForce;
   MaximumStrutTravel = lgear.MaximumStrutTravel;
 
@@ -169,7 +174,8 @@ FGLGear::FGLGear(const FGLGear& lgear)
   maxCompLen      = lgear.maxCompLen;
   SinkRate        = lgear.SinkRate;
   GroundSpeed     = lgear.GroundSpeed;
-  Reported        = lgear.Reported;
+  LandingReported = lgear.LandingReported;
+  TakeoffReported = lgear.TakeoffReported;
   name            = lgear.name;
   sSteerType      = lgear.sSteerType;
   sRetractable    = lgear.sRetractable;
@@ -197,6 +203,7 @@ FGColumnVector3& FGLGear::Force(void)
 {
   double SteerGain = 0;
   double SinWheel, CosWheel;
+  double deltaT;
 
   vForce.InitMatrix();
   vMoment.InitMatrix();
@@ -264,6 +271,19 @@ FGColumnVector3& FGLGear::Force(void)
         FirstContact  = true;
         SinkRate      =  compressSpeed;
         GroundSpeed   =  Position->GetVel().Magnitude();
+        TakeoffReported = false;
+      }
+
+// If the takeoff run is starting, initialize.
+
+      if ((Position->GetVel().Magnitude() > 0.1) &&
+          (FCS->GetBrake(bgLeft) == 0) &&
+          (FCS->GetBrake(bgRight) == 0) &&
+          (FCS->GetThrottlePos(0) == 1) && !StartedGroundRun)
+      {
+        TakeoffDistanceTraveled = 0;
+        TakeoffDistanceTraveled50ft = 0;
+        StartedGroundRun = true;
       }
 
 // The following needs work regarding friction coefficients and braking and
@@ -412,20 +432,32 @@ FGColumnVector3& FGLGear::Force(void)
 
       if (Position->GetDistanceAGL() > 200.0) {
         FirstContact = false;
-        Reported = false;
-        DistanceTraveled = 0.0;
+        StartedGroundRun = false;
+        LandingReported = false;
+        LandingDistanceTraveled = 0.0;
         MaximumStrutForce = MaximumStrutTravel = 0.0;
       }
 
       compressLength = 0.0; // reset compressLength to zero for data output validity
     }
 
-    if (FirstContact) {
-      DistanceTraveled += Position->GetVel().Magnitude()*State->Getdt()*Aircraft->GetRate();
-    }
+    deltaT = State->Getdt()*Aircraft->GetRate();
+
+    if (FirstContact) LandingDistanceTraveled += Position->GetVground()*deltaT;
   
-    if (ReportEnable && Position->GetVel().Magnitude() <= 0.05 && !Reported) {
-      if (debug_lvl > 0) Report();
+    if (StartedGroundRun) {
+       TakeoffDistanceTraveled50ft += Position->GetVground()*deltaT;
+      if (WOW) TakeoffDistanceTraveled += Position->GetVground()*deltaT;
+    }
+
+    if (ReportEnable && Position->GetVground() <= 0.05 && !LandingReported) {
+      if (debug_lvl > 0) Report(erLand);
+    }
+
+    if (ReportEnable && !TakeoffReported &&
+       (vLocalGear(eZ) - Position->GetDistanceAGL()) < -50.0)
+    {
+      if (debug_lvl > 0) Report(erTakeoff);
     }
 
     if (lastWOW != WOW) {
@@ -450,20 +482,32 @@ FGColumnVector3& FGLGear::Force(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGLGear::Report(void)
+void FGLGear::Report(ReportType repType)
 {
-  cout << endl << "Touchdown report for " << name << endl;
-  cout << "  Sink rate at contact:  " << SinkRate                << " fps,    "
-                              << SinkRate*0.3408          << " mps"     << endl;
-  cout << "  Contact ground speed:  " << GroundSpeed*.5925       << " knots,  "
-                              << GroundSpeed*0.3408       << " mps"     << endl;
-  cout << "  Maximum contact force: " << MaximumStrutForce       << " lbs,    "
-                              << MaximumStrutForce*4.448  << " Newtons" << endl;
-  cout << "  Maximum strut travel:  " << MaximumStrutTravel*12.0 << " inches, "
-                              << MaximumStrutTravel*30.48 << " cm"      << endl;
-  cout << "  Distance traveled:     " << DistanceTraveled        << " ft,     "
-                              << DistanceTraveled*0.3408  << " meters"  << endl;
-  Reported = true;
+  switch(repType) {
+  case erLand:
+    cout << endl << "Touchdown report for " << name << endl;
+    cout << "  Sink rate at contact:  " << SinkRate                << " fps,    "
+                                << SinkRate*0.3408          << " mps"     << endl;
+    cout << "  Contact ground speed:  " << GroundSpeed*.5925       << " knots,  "
+                                << GroundSpeed*0.3408       << " mps"     << endl;
+    cout << "  Maximum contact force: " << MaximumStrutForce       << " lbs,    "
+                                << MaximumStrutForce*4.448  << " Newtons" << endl;
+    cout << "  Maximum strut travel:  " << MaximumStrutTravel*12.0 << " inches, "
+                                << MaximumStrutTravel*30.48 << " cm"      << endl;
+    cout << "  Distance traveled:     " << LandingDistanceTraveled        << " ft,     "
+                                << LandingDistanceTraveled*0.3408  << " meters"  << endl;
+    LandingReported = true;
+    break;
+  case erTakeoff:
+    cout << endl << "Takeoff report for " << name << endl;
+    cout << "  Distance traveled:                " << TakeoffDistanceTraveled
+         << " ft,     " << TakeoffDistanceTraveled*0.3408  << " meters"  << endl;
+    cout << "  Distance traveled (over 50'):     " << TakeoffDistanceTraveled50ft
+         << " ft,     " << TakeoffDistanceTraveled50ft*0.3408 << " meters" << endl;
+    TakeoffReported = true;
+    break;
+  }
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -522,3 +566,5 @@ void FGLGear::Debug(int from)
   }
 }
 
+} // namespace JSBSim
+
index 8bfc6e21a555521a6f29d5086be304725b1ea8f2..e849d229e0e282cd8e8564f268288e72c9dadb1c 100644 (file)
@@ -60,6 +60,8 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGAircraft;
 class FGPosition;
 class FGRotation;
@@ -186,6 +188,8 @@ public:
   enum BrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail };
   /// Steering group membership enumerators
   enum SteerType {stSteer, stFixed, stCaster};
+  /// Report type enumerators
+  enum ReportType {erNone=0, erTakeoff, erLand};
   /** Constructor
       @param Executive a pointer to the parent executive object
       @param File a pointer to the config file instance */
@@ -265,7 +269,9 @@ private:
   double maxCompLen;
   double SinkRate;
   double GroundSpeed;
-  double DistanceTraveled;
+  double TakeoffDistanceTraveled;
+  double TakeoffDistanceTraveled50ft;
+  double LandingDistanceTraveled;
   double MaximumStrutForce;
   double MaximumStrutTravel;
   double SideWhlVel, RollingWhlVel;
@@ -275,7 +281,9 @@ private:
   bool WOW;
   bool lastWOW;
   bool FirstContact;
-  bool Reported;
+  bool StartedGroundRun;
+  bool LandingReported;
+  bool TakeoffReported;
   bool ReportEnable;
   bool isRetractable;
   bool GearUp, GearDown;
@@ -296,10 +304,10 @@ private:
   FGFCS*      FCS;
   FGMassBalance* MassBalance;
 
-  void Report(void);
+  void Report(ReportType rt);
   void Debug(int from);
 };
-
+}
 #include "FGAircraft.h"
 #include "FGPosition.h"
 #include "FGRotation.h"
index 5df0f3c187c89087eae20a78ea3d66024d372bf3..ab9b725d49dc86bfb05d9d1ebb1c8126964cc57d 100644 (file)
@@ -41,6 +41,8 @@ INCLUDES
 #include "FGMassBalance.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_MASSBALANCE;
 
@@ -290,4 +292,4 @@ void FGMassBalance::Debug(int from)
     }
   }
 }
-
+}
index dbdbf1c951ad9444057e598e4bbdb2b0baabaab9..7abd554664df803f82ec077c660667e279316640 100644 (file)
@@ -52,6 +52,8 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGMassBalance : public FGModel
 {
 
@@ -113,6 +115,6 @@ private:
   FGColumnVector3 PointMassCG;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index 830e99dddfb9c8715fa429b7f4f72715ca8e7f3d..65e046e485ea9891818442e00836cb34acedbd84 100644 (file)
@@ -21,6 +21,8 @@ INCLUDES
 #include "FGMatrix33.h"
 #include "FGColumnVector3.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_MATRIX33;
 
@@ -440,4 +442,4 @@ void FGMatrix33::Debug(int from)
     }
   }
 }
-
+}
index 74328fa0c9e7dfb1127c6d2a2d8efee86e19f6fc..e43e4f0c6f2ec1ebd52e03422da3f19b8862da52 100644 (file)
@@ -65,6 +65,8 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGColumnVector3;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -128,5 +130,5 @@ private:
   unsigned int rowCtr, colCtr;
   void Debug(int from);
 };
-
+}
 #endif
index 6520196e6f418e00fa3bbc9b8dc6900944e73d64..dcad25c17615d235839bc16121f097873a55ca98 100644 (file)
@@ -55,6 +55,8 @@ INCLUDES
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_MODEL;
 
@@ -199,4 +201,4 @@ void FGModel::Debug(int from)
     }
   }
 }
-
+}
index 740f4521b0f6ea9b8a218ed6030c0c8198a23a28..6cd7a82950bc14b35cf9627c1ba12830a3258e06 100644 (file)
@@ -70,6 +70,8 @@ using namespace std;
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFDMExec;
 class FGState;
 class FGAtmosphere;
@@ -157,7 +159,7 @@ protected:
   FGOutput*          Output;
   FGPropertyManager* PropertyManager;
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index b7340183888f0ed9deec81cb89612d125d94eb01..d46a622b75f7013f2b46709b6df63e621adad379 100644 (file)
@@ -44,6 +44,8 @@ INCLUDES
 
 #include "FGNozzle.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_NOZZLE;
 
@@ -149,4 +151,4 @@ void FGNozzle::Debug(int from)
     }
   }
 }
-
+}
index 08906083cc4afffad25af6da0e0c8bd130aa732b..1c9ab80279b11ac5f17d5d25d6f23f17a7ca13d6 100644 (file)
@@ -69,6 +69,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGNozzle : public FGThruster {
 
 public:
@@ -89,7 +91,7 @@ private:
   double Area2;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index b3b3858088f2c6d0986a541acef77d82397ac8e3..f35662a6c39b3f05a93ff6e2f88acec45e718e62 100644 (file)
@@ -52,6 +52,8 @@ INCLUDES
 #include "FGPosition.h"
 #include "FGAuxiliary.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_OUTPUT;
 
@@ -557,4 +559,4 @@ void FGOutput::Debug(int from)
     }
   }
 }
-
+}
index 0d8f5fe3ebf3b87a3757a4a0594809952283e64f..37bf06c4cafe4d8de4a438bda3502db3d6cc385c 100644 (file)
@@ -62,6 +62,8 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGOutput : public FGModel
 {
 public:
@@ -107,7 +109,7 @@ private:
   FGfdmSocket* socket;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 3b224cf3cd9af2a40ae596b59e15442212d2b7ad..dbbc88588c904b7aecba63f3ac8047f6bb1f3a46 100644 (file)
@@ -42,6 +42,8 @@ INCLUDES
 #include "FGPiston.h"
 #include "FGPropulsion.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_PISTON;
 
@@ -569,3 +571,5 @@ FGPiston::CalcFuelNeed(void)
 {
   return FuelFlow_gph / 3600 * 6 * State->Getdt() * Propulsion->GetRate();
 }
+
+} // namespace JSBSim
index 909ed1920d3454f345c543fb8ad130da68fad970..3f0d67b6d54bae26107d6a1f4217df1ef63f9dcd 100644 (file)
@@ -80,6 +80,8 @@ DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGPiston : public FGEngine
 {
 public:
@@ -162,6 +164,6 @@ private:
 
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index 74cd727bb56134bb4e3c25a20be000043b838d74..b13c110100205c01d7a3b44dd74751c9892643ce 100644 (file)
@@ -86,6 +86,8 @@ INCLUDES
 #include "FGPropertyManager.h"
 
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_POSITION;
 
@@ -348,4 +350,4 @@ void FGPosition::Debug(int from)
     }
   }
 }
-
+}
index 358d5a0a08b836439cab2c0b13b23b505ca56db4..b1f5fde91f893e50fa557c332f1de3b5d61c444f 100644 (file)
@@ -74,6 +74,8 @@ DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGPosition : public FGModel {
 public:
   /** Constructor
@@ -148,7 +150,7 @@ private:
   void GetState(void);
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 1bd9118ef6de4cfe8401b8e1d437f923c182d4aa..6dff5c58783e8db3b1cb0bd0bbf4a63185b577d0 100644 (file)
@@ -38,6 +38,8 @@ INCLUDES
 #include "FGPropeller.h"
 #include "FGFCS.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_PROPELLER;
 
@@ -293,4 +295,4 @@ void FGPropeller::Debug(int from)
     }
   }
 }
-
+}
index f6ed849afed5d28eb250849c6db9fa6f524a6568..071cefb0e67dad87cdc22d4e4d33d92ed911c4b0 100644 (file)
@@ -91,6 +91,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGPropeller : public FGThruster {
 
 public:
@@ -178,7 +180,7 @@ private:
   FGTable *cPower;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index bd778f940fae6e8e943cf97f9cc660534c4bb3ba..d0f810ab8ae7a4977731bd258fb35981cb751a23 100644 (file)
@@ -47,6 +47,8 @@ COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */
 
+namespace JSBSim {
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 string FGPropertyManager::mkPropertyName(string name, bool lowercase) {
@@ -312,3 +314,5 @@ void FGPropertyManager::Tie (const string &name, double *pointer,
     cout <<
           "Failed to tie property " << name << " to a pointer" << endl;
 }
+
+} // namespace JSBSim
index aefa5cb58f9a180e834b42d4326fa8a5396d8b86..57e090daf19247b7a545474b1533507612fb6794 100644 (file)
@@ -70,6 +70,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGPropertyManager : public SGPropertyNode {
   public:
     /// Constructor
@@ -608,6 +610,6 @@ class FGPropertyManager : public SGPropertyNode {
           "Failed to tie property " << name << " to indexed object methods" << endl;
    }
 };                                                                                       
-
+}
 #endif // FGPROPERTYMANAGER_H
 
index 3ee7b2058a4fe06c846bcef67cef536c4f6455ef..f40972fa21e3b8950ba9a228bf709d62d13a92c1 100644 (file)
@@ -55,12 +55,6 @@ INCLUDES
 #include "FGPropulsion.h"
 #include "FGPropertyManager.h"
 
-
-static const char *IdSrc = "$Id$";
-static const char *IdHdr = ID_PROPULSION;
-
-extern short debug_lvl;
-
 #if defined (__APPLE__)
 /* Not all systems have the gcvt function */
 inline char* gcvt (double value, int ndigits, char *buf) {
@@ -70,6 +64,13 @@ inline char* gcvt (double value, int ndigits, char *buf) {
 }
 #endif
 
+namespace JSBSim {
+
+static const char *IdSrc = "$Id$";
+static const char *IdHdr = ID_PROPULSION;
+
+extern short debug_lvl;
+
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
@@ -702,4 +703,4 @@ void FGPropulsion::Debug(int from)
     }
   }
 }
-
+}
index 56eecf4c3cdbeb867562fb4f4e6c711a0a64f2b3..2e8e803a73b60d1be9f58284aa313d8e7810e575 100644 (file)
@@ -98,6 +98,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGPropulsion : public FGModel
 {
 public:
@@ -216,7 +218,7 @@ private:
   FGColumnVector3 vXYZtank;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index ec1bb72151a001afa3ec5baa04cf7d98d23b6ff5..b786bc4ed7baae3b424bfde0359bb9f804f11167 100644 (file)
@@ -40,6 +40,8 @@ INCLUDES
 
 #include "FGRocket.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_ROCKET;
 
@@ -160,4 +162,4 @@ void FGRocket::Debug(int from)
     }
   }
 }
-
+}
index 58142fb494e4a00c07477b4b24e17feffe25ac58..0635b8fb8b3763cba85784e7e33cadaaad889087 100644 (file)
@@ -104,6 +104,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGRocket : public FGEngine
 {
 public:
@@ -135,7 +137,7 @@ private:
   double PC;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 88eeea4d9aebc9c9cdc38f20bfbb2c38d6bb450f..77a4ea5ceac5394e25be9b2441b6211728c02789 100644 (file)
@@ -69,6 +69,8 @@ INCLUDES
 #include "FGPropertyManager.h"
 
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_ROTATION;
 
@@ -279,4 +281,4 @@ void FGRotation::Debug(int from)
     }
   }
 }
-
+}
index 5122535fcb4abe3c9cfceda6883a219ff65ece75..db6538aaaaa5fa6824631d01f0d938c9651513cb 100644 (file)
@@ -78,6 +78,8 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGRotation : public FGModel
 {
 public:
@@ -141,7 +143,7 @@ private:
 
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 3d0c7f3e04d2e08d235405d6d2fc1f79198aa937..71436a97c61e7fc11b9fdf4ad81d9e8a4ba3441b 100644 (file)
@@ -37,6 +37,8 @@ INCLUDES
 
 #include "FGRotor.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_ROTOR;
 
@@ -109,4 +111,4 @@ void FGRotor::Debug(int from)
     }
   }
 }
-
+}
index dde526de5432c9d2c897a02cb6d12edf69cd1999..624eb63c389cfbb1cd326af6bbd962dee607cd45 100644 (file)
@@ -50,6 +50,8 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGRotor : public FGThruster {
 
 public:
@@ -61,6 +63,6 @@ public:
 private:
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index f17221325dad15764aa2618cf94caad4f9aefe8a..aa85b427f9dab906c4796e821542bf46f74fac68 100644 (file)
@@ -57,6 +57,8 @@ INCLUDES
 #include "FGScript.h"
 #include "FGConfigFile.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FGSCRIPT;
 
@@ -415,4 +417,4 @@ void FGScript::Debug(int from)
     }
   }
 }
-
+}
index b188d68557abcd709591df7f29987aa493b93d0a..269a96f0d9dae9a5a309fcf8f442c9ec9642d2b9 100644 (file)
@@ -133,6 +133,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGScript : public FGJSBBase
 {
 public:
@@ -198,7 +200,7 @@ private:
   FGPropertyManager* PropertyManager;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 6ce19c4071ce11b7ba80bdf5e5301f08ee0e34fa..9adba93f29957fa635abbece50725cc50a8e41fc 100644 (file)
@@ -53,6 +53,8 @@ INCLUDES
 
 #include "FGState.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_STATE;
 
@@ -477,4 +479,4 @@ void FGState::Debug(int from)
     }
   }
 }
-
+}
index 3eaf0f2b2c6029db3f50e5fd3021630182eac561..ffab08c731ff994b0e94de31a8997bcbfe3a040d 100644 (file)
@@ -108,6 +108,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGState : public FGJSBBase
 {
 public:
@@ -362,7 +364,7 @@ private:
 
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
index 248ca8ebd04038f75bee46e2c1d27f880bb2cae5..531c1222dfd4ef32e339239cc590c7a2eb7726e4 100644 (file)
@@ -44,6 +44,10 @@ INCLUDES
 #include <iomanip>
 #endif
 
+using namespace std;
+
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TABLE;
 
@@ -51,7 +55,6 @@ static const char *IdHdr = ID_TABLE;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using namespace std;
 
 FGTable::FGTable(int NRows, int NCols) : nRows(NRows), nCols(NCols)
 {
@@ -313,6 +316,4 @@ void FGTable::Debug(int from)
     }
   }
 }
-
-
-
+}
index cdee7d18667e0e22d9b2d0f3caa020af38050659..483e945b5cb6126480d39b5c9ddb2013fd8ad408 100644 (file)
@@ -76,6 +76,8 @@ CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 
+namespace JSBSim {
+
 class FGTable : public FGJSBBase
 {
 public:
@@ -111,7 +113,7 @@ private:
   double** Allocate(void);
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 #endif
index 9f77de5a1f82e4c8d6bc1ea3a3ba0f1c168c1ab9..664b6b4ce006108c85c02b4329f65b0de2e10351 100644 (file)
@@ -38,6 +38,14 @@ INCLUDES
 
 #include "FGTank.h"
 
+#if !defined ( sgi ) || defined( __GNUC__ )
+using std::cerr;
+using std::endl;
+using std::cout;
+#endif
+
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TANK;
 
@@ -45,12 +53,6 @@ static const char *IdHdr = ID_TANK;
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#if !defined ( sgi ) || defined( __GNUC__ )
-using std::cerr;
-using std::endl;
-using std::cout;
-#endif
-
 FGTank::FGTank(FGConfigFile* AC_cfg)
 {
   string token;
@@ -156,4 +158,4 @@ void FGTank::Debug(int from)
     }
   }
 }
-
+}
index e689112da0b237466f10534222bb30981041d7ae..944e0968c9970e1bbde9c3126b39bada671ddb3e 100644 (file)
@@ -74,6 +74,8 @@ DEFINES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGTank : public FGJSBBase
 {
 public:
@@ -104,7 +106,7 @@ private:
   bool  Selected;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index f1330f967b222f5c37c4fd29c660213bf199a74f..adddcbc56b4b51ea4fd1d50882f625b83b11cbd9 100644 (file)
@@ -37,6 +37,8 @@ INCLUDES
 
 #include "FGThruster.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_THRUSTER;
 
@@ -115,4 +117,4 @@ void FGThruster::Debug(int from)
     }
   }
 }
-
+}
index cba795d41ba93d8c6f443bf1da3c41de43546f16..1d99d475de79e448016b979445e5001ae9809b37 100644 (file)
@@ -64,6 +64,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGThruster : public FGForce {
 
 public:
@@ -96,7 +98,7 @@ protected:
   double deltaT;
   virtual void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 8f19d519366194601df895d8a0d3834b838328e9..7b415b6bb1105f42c13147b6e5dd0c5b1ae69fb8 100644 (file)
@@ -70,6 +70,8 @@ INCLUDES
 #include "FGOutput.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TRANSLATION;
 
@@ -322,4 +324,4 @@ void FGTranslation::Debug(int from)
     }
   }
 }
-
+}
index 8a17e95812621adfb27d179538e14d2d2ab74fdb..814857e67c80c408d6c4801c2ad4dbdf00197207 100644 (file)
@@ -82,40 +82,100 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGTranslation : public FGModel {
 public:
   FGTranslation(FGFDMExec*);
   ~FGTranslation();
   
+    /** Bound Properties
+        GetUVW(1): velocities/u-fps
+        GetUVW(2): velocities/v-fps
+        GetUVW(3): velocities/w-fps
+    */
   inline double           GetUVW   (int idx) const { return vUVW(idx); }
   inline FGColumnVector3& GetUVW   (void)    { return vUVW; }
   inline FGColumnVector3& GetUVWdot(void)    { return vUVWdot; }
+    /** Bound Properties
+        GetUVWdot(1): accelerations/udot-fps
+        GetUVWdot(2): accelerations/vdot-fps
+        GetUVWdot(3): accelerations/wdot-fps
+    */
   inline double           GetUVWdot(int idx) const { return vUVWdot(idx); }
   inline FGColumnVector3& GetAeroUVW (void)    { return vAeroUVW; }
+    /** Bound Properties
+        GetAeroUVW(1): velocities/u-aero-fps
+        GetAeroUVW(2): velocities/v-aero-fps
+        GetAeroUVW(3): velocities/w-aero-fps
+    */
   inline double           GetAeroUVW (int idx) const { return vAeroUVW(idx); }
 
+    /** Bound Property:  aero/alpha-rad
+    */
   double Getalpha(void) const { return alpha; }
+    /** Bound Property:  aero/beta-rad
+    */
   double Getbeta (void) const { return beta; }
+    /** Bound Property:  aero/mag-beta-rad
+    */
   inline double GetMagBeta(void) const { return fabs(beta); }
+    /** Bound Property:  aero/qbar-psf
+    */
   double Getqbar (void) const { return qbar; }
+    /** Bound Property:  aero/qbarUW-psf
+    */
   double GetqbarUW (void) const { return qbarUW; }
+    /** Bound Property:  aero/qbarUV-psf
+    */
   double GetqbarUV (void) const { return qbarUV; }
+    /** Bound Property:  velocities/vt-fps
+    */
   inline double GetVt   (void) const { return Vt; }
+    /** Bound Property:  velocities/mach-norm
+    */
   double GetMach (void) const { return Mach; }
+    /** Bound Property:  aero/alphadot-rad_sec
+    */
   double Getadot (void) const { return adot; }
+    /** Bound Property:  aero/betadot-rad_sec
+    */
   double Getbdot (void) const { return bdot; }
 
+    /** Bound Properties
+        SetUVW(1): velocities/u-fps
+        SetUVW(2): velocities/v-fps
+        SetUVW(3): velocities/w-fps
+    */
   void SetUVW(FGColumnVector3 tt) { vUVW = tt; }
   void SetAeroUVW(FGColumnVector3 tt) { vAeroUVW = tt; }
 
+    /** Bound Property:  aero/alpha-rad
+    */
   inline void Setalpha(double tt) { alpha = tt; }
+    /** Bound Property:  aero/beta-rad
+    */
   inline void Setbeta (double tt) { beta  = tt; }
+    /** Bound Property:  aero/qbar-psf
+    */
   inline void Setqbar (double tt) { qbar = tt; }
+    /** Bound Property:  aero/qbarUW-psf
+    */
   inline void SetqbarUW (double tt) { qbarUW = tt; }
+    /** Bound Property:  aero/qbarUV-psf
+    */
   inline void SetqbarUV (double tt) { qbarUV = tt; }
+    /** Bound Property:  velocities/vt-fps
+    */
   inline void SetVt   (double tt) { Vt = tt; }
+    /** Bound Property:  velocities/mach-norm
+    */
   inline void SetMach (double tt) { Mach=tt; }
+    /** Bound Property:  aero/alphadot-rad_sec
+    */
   inline void Setadot (double tt) { adot = tt; }
+    /** Bound Property:  aero/betadot-rad_sec
+    */
   inline void Setbdot (double tt) { bdot = tt; }
 
   inline void SetAB(double t1, double t2) { alpha=t1; beta=t2; }
@@ -139,7 +199,7 @@ private:
   double adot,bdot;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 21dae465da7fc1f369c27f980858bca47d040159..6f2c1710f439671d7ca7afe16a8188535d9da2d9 100644 (file)
@@ -58,6 +58,8 @@ INCLUDES
 #pragma warning (disable : 4786 4788)
 #endif
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TRIM;
 
@@ -665,4 +667,4 @@ void FGTrim::SetMode(TrimMode tt) {
     current_axis=0;
 }    
 //YOU WERE WARNED, BUT YOU DID IT ANYWAY.
-
+}
index 4a75f5905bf40df8d158ed337ac0ecafdab2d25e..1276c5851c4adb91a20f35eaeb3c72e9df257443 100644 (file)
@@ -62,14 +62,16 @@ DEFINITIONS
 
 #define ID_TRIM "$Id$"
 
-typedef enum { tLongitudinal, tFull, tGround, tPullup, 
-               tCustom, tNone, tTurn 
-             } TrimMode;
-
 #if defined(_WIN32) && !defined(__CYGWIN__)
   #define snprintf _snprintf
 #endif
 
+namespace JSBSim {
+
+typedef enum { tLongitudinal, tFull, tGround, tPullup, 
+               tCustom, tNone, tTurn 
+             } TrimMode;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -302,15 +304,6 @@ public:
   inline double GetTargetNlf(void) { return targetNlf; }
 
 };
-
+}
 
 #endif
-
-
-
-
-
-
-
-
-
index 485dbd5c2ed5e10ea908e3fa231761a39623f955..8a1b024d07fbaea2425a7a4c0ec07098ce346e5a 100644 (file)
@@ -48,6 +48,8 @@ INCLUDES
 #include "FGAerodynamics.h"
 
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TRIMAXIS;
 
@@ -482,5 +484,4 @@ void FGTrimAxis::Debug(int from)
     }
   }
 }
-
-
+}
index e687a27710a26647e0bc1a872322b523a3fd0c31..605bca53e52c5c0418baa8d72f18ba526150fa76 100644 (file)
@@ -48,6 +48,8 @@ INCLUDES
 
 #define DEFAULT_TOLERANCE 0.001
 
+namespace JSBSim {
+
 const string StateNames[10]=   { "all","udot","vdot","wdot","qdot","pdot","rdot",
                                 "hmgt","nlf" 
                               };
@@ -165,5 +167,5 @@ private:
   
   void Debug(int from);
 };
-
+}
 #endif
index 437e3401150a673c0a3c3a0bed145607c01a8122..e329f2c211e430d9ae53cfc60c30244845081ebf 100644 (file)
@@ -42,6 +42,8 @@ INCLUDES
 #include "FGTurbine.h"
 
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TURBINE;
 
@@ -251,4 +253,4 @@ void FGTurbine::Debug(int from)
     }
   }
 }
-
+}
index fee3b66ff6daf6b9f1720f26ca689cb8f48e0ec4..bfeca9c1c68aa30cb47bf02ec0c37e46814f379f 100644 (file)
@@ -53,6 +53,8 @@ INCLUDES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGTurbine : public FGEngine
 {
 public:
@@ -88,7 +90,7 @@ private:
 
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
 
index 5ec59baab8a72d98b15965e4ce5db36dce06befa..c6d0b201804cd717ff0d4efc98ef27cfd359878e 100644 (file)
@@ -61,6 +61,8 @@ INCLUDES
 #include "FGState.h"
 #include "FGFDMExec.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_UTILITY;
 
@@ -125,4 +127,4 @@ void FGUtility::Debug(int from)
     }
   }
 }
-
+}
index 4514c253c07371b010f997d3a7be8f473f1eb625..154314d20392860daaac52a50c35c82ee929675e 100644 (file)
@@ -50,6 +50,8 @@ DEFINES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFDMExec;
 class FGState;
 
@@ -64,6 +66,6 @@ private:
   FGFDMExec* FDMExec;
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
index 9d86bbab5b96f9b81201e3c618adb71b71139689..d117100dab5d972e9d0e0760647ea25ae067972b 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGfdmSocket.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FDMSOCKET;
 
@@ -204,4 +206,4 @@ void FGfdmSocket::Debug(int from)
     }
   }
 }
-
+}
index a03e58e9c63329a1ac69df9cfa42ad82e27ad467..ff6ef5562684cdd260a9701ffeac93b73ef73a0e 100644 (file)
@@ -88,6 +88,8 @@ CLASS DECLARATION
 
 using std::string;
 
+namespace JSBSim {
+
 class FGfdmSocket : public FGJSBBase
 {
 public:
@@ -109,5 +111,5 @@ private:
   bool connected;
   void Debug(int from);
 };
-
+}
 #endif
index ef7c086deb9bc7b3617525733d0bf5f102c13ca2..a114dcc13d74be60a70ca50292df888fbbf4396f 100644 (file)
@@ -796,3 +796,4 @@ void FGJSBsim::update_ic(void) {
      fgic->SetClimbRateFpsIC( get_Climb_Rate() );
    }  
 }
+
index dbb294bdae1cfc3ecbaea2fdb08bf0512686996e..cdbc3c7682a7bfba77e77830d447be85c45e4bd5 100644 (file)
@@ -57,6 +57,7 @@ FORWARD DECLARATIONS
 
 #include <FDM/JSBSim/FGFDMExec.h>
 
+namespace JSBSim {
 class FGState;
 class FGAtmosphere;
 class FGFCS;
@@ -71,6 +72,9 @@ class FGPosition;
 class FGAuxiliary;
 class FGOutput;
 class FGInitialCondition;
+}
+
+using namespace JSBSim;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
index 9c337da376bad8b425c9459f021e8ae26902dd34..d8e245fc32aa98d5e3ad08cd50d97c9406cd1cf6 100644 (file)
@@ -41,9 +41,7 @@ libJSBSim_a_SOURCES = \
        FGTranslation.cpp FGTranslation.h \
        FGTrim.cpp FGTrim.h \
        FGTrimAxis.cpp FGTrimAxis.h \
-       FGTurboJet.cpp FGTurboJet.h \
-       FGTurboProp.cpp FGTurboProp.h \
-       FGTurboShaft.cpp FGTurboShaft.h \
+       FGTurbine.cpp FGTurbine.h \
        FGUtility.cpp FGUtility.h \
        FGEngine.cpp FGEngine.h \
        FGTank.cpp FGTank.h \
index 00d99177f9beda2d3fe9d6ca6723010a74709032..e9e6d3383204735332a8cc80e40da7199fa1dcce 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGDeadBand.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_DEADBAND;
 
@@ -56,14 +58,30 @@ FGDeadBand::FGDeadBand(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   AC_cfg->GetNextConfigLine();
   string token;
 
+  clipmax = clipmin = 0.0;
+  clip = false;
+  gain = 1.0;
+  width = 0.0;
+
   while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
-    if (token == "ID") {
-      *AC_cfg >> ID;
-    } else if (token == "INPUT") {
-      *AC_cfg >> InputIdx;
-    } else {
+    if (token == "INPUT") {
+      if (InputNodes.size() > 0) {
+        cerr << "Deadband can only accept one input" << endl;
+      } else  {
+        *AC_cfg >> token;
+        InputNodes.push_back(resolveSymbol(token));
+      }  
+    } else if (token == "WIDTH") {
+      *AC_cfg >> width;
+    } else if (token == "CLIPTO") {
+      *AC_cfg >> clipmin >> clipmax;
+      if (clipmax > clipmin) clip = true;
+    } else if (token == "GAIN") {
+      *AC_cfg >> gain;
+    } else if (token == "OUTPUT") {
       *AC_cfg >> token;
+      OutputNode = PropertyManager->GetNode(token);
     }
   }
   FGFCSComponent::bind();
@@ -83,6 +101,23 @@ bool FGDeadBand::Run(void )
 {
   FGFCSComponent::Run(); // call the base class for initialization of Input
 
+  Input = InputNodes[0]->getDoubleValue();
+
+  if (Input < -width/2.0) {
+    Output = (Input + width/2.0)*gain;
+  } else if (Input > width/2.0) {
+    Output = (Input - width/2.0)*gain;
+  } else {
+    Output = 0.0;
+  }
+
+  if (clip) {
+    if (Output > clipmax)      Output = clipmax;
+    else if (Output < clipmin) Output = clipmin;
+  }
+
+  if (IsOutput) SetOutput();
+
   return true;
 }
 
@@ -111,7 +146,12 @@ void FGDeadBand::Debug(int from)
 
   if (debug_lvl & 1) { // Standard console startup message output
     if (from == 0) { // Constructor
-
+      cout << "      INPUT: " << InputNodes[0]->getName() << endl;
+      cout << "      DEADBAND WIDTH: " << width << endl;
+      cout << "      GAIN: " << gain << endl;
+      if (clip) cout << "      CLIPTO: " << clipmin 
+                                  << ", " << clipmax << endl;
+      if (IsOutput) cout << "      OUTPUT: " << OutputNode->getName() << endl;
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
@@ -131,4 +171,4 @@ void FGDeadBand::Debug(int from)
     }
   }
 }
-
+}
index a20f4b152ff71bd87acb506b80bec1b76365cb0e..1f30e4dc047f40e0420f1766c298fefbc0236481 100644 (file)
@@ -50,6 +50,8 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFCS;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -62,6 +64,16 @@ CLASS DOCUMENTATION
 
 /** Models a deadband object.
     Owned and Operated by the FGFCS class.
+
+    <COMPONENT NAME="Deadbeat1" TYPE="DEADBAND">
+      INPUT {input}
+      WIDTH {deadband width}
+      GAIN {optional deadband gain}
+      MIN {minimum value}
+      MAX {maximum value}
+      OUTPUT {optional output parameter to set}
+    </COMPONENT>
+
     @author Jon S. Berndt
     @see -
   */
@@ -80,10 +92,14 @@ public:
 
 private:
   FGConfigFile* AC_cfg;
+  double width;
+  double clipmax, clipmin;
+  bool clip;
+  double gain;
   
   void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 #endif
index 14608d1215dccaf7f156e49a97bb570421f7ead0..de20fad4e9845b2d2a708140b62c602a73af720f 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGFCSComponent.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FCSCOMPONENT;
 
@@ -49,7 +51,6 @@ CLASS IMPLEMENTATION
 FGFCSComponent::FGFCSComponent(FGFCS* _fcs) : fcs(_fcs)
 {
   Type       = "";
-  ID         = 0;
   Input      = 0.0;
   Output     = 0.0;
   OutputNode = 0;
@@ -82,14 +83,14 @@ bool FGFCSComponent::Run(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGPropertyManager* FGFCSComponent::resolveSymbol(string token) {
+FGPropertyManager* FGFCSComponent::resolveSymbol(string token)
+{
   string prop;
-  FGPropertyManager* tmp=PropertyManager->GetNode(token,false);
-  if( !tmp ){
-    if( token.find("/") == token.npos ) 
-      prop = "model/" + token;
+  FGPropertyManager* tmp = PropertyManager->GetNode(token,false);
+  if (!tmp) {
+    if (token.find("/") == token.npos) prop = "model/" + token;
     cerr << "Creating new property " << prop << endl;
-    tmp=PropertyManager->GetNode(token,true);
+    tmp = PropertyManager->GetNode(token,true);
   }
   return tmp;  
 }              
@@ -97,7 +98,8 @@ FGPropertyManager* FGFCSComponent::resolveSymbol(string token) {
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGFCSComponent::bind(void) {
+void FGFCSComponent::bind(void)
+{
   string tmp = "fcs/" + PropertyManager->mkPropertyName(Name, true);
   FGPropertyManager *tmpn;
   PropertyManager->Tie( tmp,this, &FGFCSComponent::GetOutput);
@@ -154,4 +156,4 @@ void FGFCSComponent::Debug(int from)
     }
   }
 }
-
+}
index 2e7f8e858183f59cb6b8a5170629a8c5fc06bdcf..688eb63d6cb4d1cdd5ae4eafffe2f649b3116fe1 100644 (file)
@@ -59,6 +59,8 @@ using std::string;
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFCS;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -119,16 +121,14 @@ protected:
   FGPropertyManager* treenode;
   string Type;
   string Name;
-  int ID;
-  vector<FGPropertyManager*> InputNodes;
-  int InputIdx;
+  vector <FGPropertyManager*> InputNodes;
   double Input;
   FGPropertyManager* OutputNode;
   double Output;
   bool IsOutput;
   virtual void Debug(int from);
 };
-
+}
 #include "../FGFCS.h"
 
 #endif
index 15a685faa4e4baa3e288350413127eff69f5a1e4..3dc26999d3be0d9ec1d13da7cf41bb27ba565e05 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGFilter.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FILTER;
 
@@ -69,8 +71,7 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
 
   while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
-    if      (token == "ID")     *AC_cfg >> ID;
-    else if (token == "C1")     *AC_cfg >> C1;
+    if (token == "C1")          *AC_cfg >> C1;
     else if (token == "C2")     *AC_cfg >> C2;
     else if (token == "C3")     *AC_cfg >> C3;
     else if (token == "C4")     *AC_cfg >> C4;
@@ -239,4 +240,4 @@ void FGFilter::Debug(int from)
     }
   }
 }
-
+}
index e7e745e2cb36dc90d097c84a6dfa2e4de37a6031..95cdc47a569a74a5a1f8fa48217f1fad46dcce11 100644 (file)
@@ -69,7 +69,6 @@ CLASS DOCUMENTATION
     <pre>
     
     &ltCOMPONENT NAME="Elevator Filter" TYPE="LAG_FILTER">
-      ID           16
       INPUT        15
       C1           600
       OUTPUT       FG_ELEVATOR_POS
@@ -87,6 +86,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFilter  : public FGFCSComponent         
 {
 public:
@@ -121,6 +122,6 @@ private:
   FGConfigFile* AC_cfg;
   void Debug(int from);
 };
-
+}
 #endif
 
index a98ccb6231832945f97e6d1afc46e799995191be..1c711799634fb8db4f8abf7fdf6f5a6ed69d149c 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGGain.h" 
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GAIN;
 
@@ -69,11 +71,9 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
 
   while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
-    if (token == "ID") {
-      *AC_cfg >> ID;
-    } else if (token == "INPUT") {
+    if (token == "INPUT") {
       token = AC_cfg->GetValue("INPUT");
-      if( InputNodes.size() > 0 ) {
+      if (InputNodes.size() > 0) {
         cerr << "Gains can only accept one input" << endl;
       } else  {
         *AC_cfg >> token;
@@ -132,10 +132,10 @@ bool FGGain::Run(void )
     Output = Gain * Input;
   } else if (Type == "SCHEDULED_GAIN") {
     LookupVal = ScheduledBy->getDoubleValue();
-         SchedGain = Table->GetValue(LookupVal);
+    SchedGain = Table->GetValue(LookupVal);
     Output = Gain * SchedGain * Input;
   } else if (Type == "AEROSURFACE_SCALE") {
-    if(!invert) {
+    if (!invert) {
       OutputPct = Input;
       if (Input >= 0.0) Output = Input * Max;
       else Output = Input * -Min;
@@ -206,4 +206,4 @@ void FGGain::Debug(int from)
     }
   }
 }
-
+}
index 592da07e72d63d37214c6e4cb2bfeeace0a8894d..562a1a65c4f1f465da5704a1345bfd6bfe0ca826 100644 (file)
@@ -60,6 +60,8 @@ DEFINES
 
 #define ID_GAIN "$Id$"
 
+namespace JSBSim {
+
 class FGFCS;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -89,5 +91,5 @@ private:
 
   void Debug(int from);
 };
-
+}
 #endif
index c1efab8dda4880cae8c90ba3767227b1556723cc..270ea27467069a7c4dced82d62c6d2ce96b3a9e2 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGGradient.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GRADIENT;
 
@@ -119,4 +121,4 @@ void FGGradient::Debug(int from)
     }
   }
 }
-
+}
index dd87aaeb64bb71591c99851f2e7022d38afeb55b..fdb2c102510eb39db44ca3b828e555aceaea77f6 100644 (file)
@@ -50,6 +50,8 @@ DEFINES
 
 #define ID_GRADIENT "$Id$"
 
+namespace JSBSim {
+
 class FGFCS;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -68,5 +70,5 @@ private:
   FGConfigFile* AC_cfg;
   void Debug(int from);
 };
-
+}
 #endif
index 798f42c139b85ce271dcc3c90a638e7f7f833ee6..8c29a65771caa4f2bc191ef8e05ed4128ce353fc 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGKinemat.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FLAPS;
 
@@ -65,9 +67,7 @@ FGKinemat::FGKinemat(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
 
   while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
-    if (token == "ID") {
-      *AC_cfg >> ID;
-    } else if (token == "INPUT") {
+    if (token == "INPUT") {
       token = AC_cfg->GetValue("INPUT");
       if( InputNodes.size() > 0 ) {
         cerr << "Kinemat can only accept one input" << endl;
@@ -226,4 +226,4 @@ void FGKinemat::Debug(int from)
     }
   }
 }
-
+}
index 56f612f464a1f705a458f133306943e6e6277b06..6437ce3685601b4732790251aa06bf2e08d8e7ad 100644 (file)
@@ -66,6 +66,8 @@ DEFINES
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGKinemat  : public FGFCSComponent {
 public:
   FGKinemat(FGFCS* fcs, FGConfigFile* AC_cfg);
@@ -88,5 +90,5 @@ private:
 
   void Debug(int from);
 };
-
+}
 #endif
index 2b367b5a20cab6cdb9537edb40a3c96551593351..b045f7d696d63870eef956e448dce5d82841d4ee 100644 (file)
@@ -39,6 +39,8 @@ INCLUDES
 
 #include "FGSummer.h"            
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_SUMMER;
 
@@ -63,9 +65,7 @@ FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
 
-    if (token == "ID") {
-      *AC_cfg >> ID;
-    } else if (token == "INPUT") {
+    if (token == "INPUT") {
       token = AC_cfg->GetValue("INPUT");
       *AC_cfg >> token;
       InputNodes.push_back( resolveSymbol(token) );
@@ -169,4 +169,4 @@ void FGSummer::Debug(int from)
     }
   }
 }
-
+}
index e8817cb87156df1d3ae295fce9332931b8d79939..b2edfda89d5d72fbc7e9381e09aad0f6f704ceab 100644 (file)
@@ -85,6 +85,8 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGSummer  : public FGFCSComponent
 {
 public:
@@ -105,5 +107,5 @@ private:
   double Bias;
   void Debug(int from);
 };
-
+}
 #endif
index c2521bf3a0b175b95a47e6e2547d9ddbfb297c63..c4df95dca647ab60c1bfd22780093e0b7c3afb2e 100644 (file)
@@ -33,12 +33,35 @@ HISTORY
 COMMENTS, REFERENCES,  and NOTES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+The SWITCH component is defined as follows (see the API documentation for more
+information):
+
+<COMPONENT NAME="switch1" TYPE="SWITCH">
+  <TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}">
+    {property} {conditional} {property|value}
+    <CONDITION_GROUP LOGIC="{AND|OR}">
+      {property} {conditional} {property|value}
+      ...
+    </CONDITION_GROUP>
+    ...
+  </TEST>
+  <TEST LOGIC="{AND|OR}" OUTPUT="{property|value}">
+    {property} {conditional} {property|value}
+    ...
+  </TEST>
+  ...
+</COMPONENT>
+
+Also, see the header file (FGSwitch.h) for further details.
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGSwitch.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_SWITCH;
 
@@ -50,9 +73,55 @@ CLASS IMPLEMENTATION
 FGSwitch::FGSwitch(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                        AC_cfg(AC_cfg)
 {
+  string token, value;
+  struct test *current_test;
+  struct FGCondition *current_condition;
+
   Type = AC_cfg->GetValue("TYPE");
   Name = AC_cfg->GetValue("NAME");
 
+  AC_cfg->GetNextConfigLine();
+  while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
+
+    // See the above documentation, or the API docs, for information on what
+    // the SWITCH component is supposed to look like in the configuration file.
+    // Below, the switch component is read in.
+
+    if (token == "TEST") {
+      tests.push_back(*(new test));
+      current_test = &tests.back();
+
+      if (AC_cfg->GetValue("LOGIC") == "OR") {
+        current_test->Logic = eOR;
+      } else if (AC_cfg->GetValue("LOGIC") == "AND") {
+        current_test->Logic = eAND;
+      } else if (AC_cfg->GetValue("LOGIC") == "DEFAULT") {
+        current_test->Logic = eDefault;
+      } else { // error
+        cerr << "Unrecognized LOGIC token  in switch component: " << Name << endl;
+      }
+      
+      value = AC_cfg->GetValue("VALUE");
+      if (value.empty()) {
+        cerr << "No VALUE supplied for switch component: " << Name << endl;
+      } else {
+        if (value.find_first_not_of("-.0123456789eE") == string::npos) {
+          // if true (and execution falls into this block), "value" is a number.
+          current_test->OutputVal = atof(value.c_str());
+        } else {
+          // "value" must be a property if execution passes to here.
+          current_test->OutputProp = PropertyManager->GetNode(value);
+        }
+      }
+
+      AC_cfg->GetNextConfigLine();
+      while (AC_cfg->GetValue() != "/TEST") {
+        current_test->conditions.push_back(*(new FGCondition(AC_cfg, PropertyManager)));
+      }
+    }
+    AC_cfg->GetNextConfigLine();
+  }
+
   FGFCSComponent::bind();
 
   Debug(0);
@@ -69,8 +138,40 @@ FGSwitch::~FGSwitch()
 
 bool FGSwitch::Run(void )
 {
+  vector <test>::iterator iTests = tests.begin();
+  vector <FGCondition>::iterator iConditions;
+  bool pass = false;
+
   FGFCSComponent::Run(); // call the base class for initialization of Input
 
+  while (iTests < tests.end()) {
+    iConditions = iTests->conditions.begin();
+    if (iTests->Logic == eDefault) {
+      Output = iTests->GetValue();
+    } else if (iTests->Logic == eAND) {
+      pass = true;
+      while (iConditions < iTests->conditions.end()) {
+        if (!iConditions->Evaluate()) pass = false;
+        *iConditions++;
+      }
+    } else if (iTests->Logic == eOR) {
+      pass = false;
+      while (iConditions < iTests->conditions.end()) {
+        if (iConditions->Evaluate()) pass = true;
+        *iConditions++;
+      }
+    } else {
+      cerr << "Invalid logic test" << endl;
+    }
+
+    if (pass) {
+      Output = iTests->GetValue();
+      break;
+    }
+    *iTests++;
+  }
+
   return true;
 }
 
@@ -95,11 +196,57 @@ bool FGSwitch::Run(void )
 
 void FGSwitch::Debug(int from)
 {
+  vector <test>::iterator iTests = tests.begin();
+  vector <FGCondition>::iterator iConditions;
+  string comp, scratch;
+  string indent = "        ";
+  bool first = false;
+
   if (debug_lvl <= 0) return;
 
   if (debug_lvl & 1) { // Standard console startup message output
     if (from == 0) { // Constructor
+      while (iTests < tests.end()) {
+
+        scratch = " if ";
+
+        switch(iTests->Logic) {
+        case (elUndef):
+          comp = " UNSET ";
+          cerr << "Unset logic for test condition" << endl;
+          break;
+        case (eAND):
+          comp = " AND ";
+          break;
+        case (eOR):
+          comp=" OR ";
+          break;
+        case (eDefault):
+          scratch = " by default.";
+          break;
+        default:
+          comp = " UNKNOWN ";
+          cerr << "Unknown logic for test condition" << endl;
+        }
 
+        if (iTests->OutputProp != 0L)
+          cout << indent << "Switch VALUE is " << iTests->OutputProp->GetName() << scratch << endl;
+        else 
+          cout << indent << "Switch VALUE is " << iTests->OutputVal << scratch << endl;
+
+        iConditions = iTests->conditions.begin();
+        first = true;
+        while (iConditions < iTests->conditions.end()) {
+          if (!first) cout << indent << comp << " ";
+          else cout << indent << " ";
+          first = false;
+          iConditions->PrintCondition();
+          cout << endl;
+          *iConditions++;
+        }
+        cout << endl;
+        *iTests++;
+      }
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
@@ -119,4 +266,4 @@ void FGSwitch::Debug(int from)
     }
   }
 }
-
+}
index 8bfe0e1b1454501f407ea523615a19351fd428d1..b29d86e3b197ba59c42795396c25ba3b7d7aafb1 100644 (file)
@@ -1,8 +1,8 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGSwitch.h
- Author:       
- Date started: 
+ Author:       Jon S. Berndt
+ Date started: 12/23/2002
 
  ------------- Copyright (C)  -------------
 
 HISTORY
 --------------------------------------------------------------------------------
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -43,16 +39,71 @@ INCLUDES
 
 #include "FGFCSComponent.h"
 #include "../FGConfigFile.h"
+#include "FGCondition.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #define ID_SWITCH "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a switch for the flight control system.
+
+The SWITCH component models a switch - either on/off or a multi-choice rotary
+switch. The switch can represent a physical cockpit switch, or can represent a
+logical switch, where several conditions might need to be satisfied before a
+particular state is reached. The VALUE of the switch - the output value - is
+chosen depending on the state of the switch. Each switch is comprised of two or
+more TESTs. Each TEST has a VALUE associated with it. The first TEST that
+evaluates to TRUE will set the output value of the switch according to the VALUE
+parameter belonging to that TEST. Each TEST contains one or more CONDITIONS, which
+each must be logically related (if there are more than one) given the value of
+the LOGIC parameter, and which takes the form:
+
+  property conditional property|value
+
+e.g.
+
+  qbar GE 21.0
+
+or,
+
+  roll_rate < pitch_rate
+
+Within a TEST, a CONDITION_GROUP can be specified. A CONDITION_GROUP allows for
+complex groupings of logical comparisons. Each CONDITION_GROUP contains
+additional conditions, as well as possibly additional CONDITION_GROUPs.
+
+<COMPONENT NAME="switch1" TYPE="SWITCH">
+  <TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}">
+    {property} {conditional} {property|value}
+    <CONDITION_GROUP LOGIC="{AND|OR}">
+      {property} {conditional} {property|value}
+      ...
+    </CONDITION_GROUP>
+    ...
+  </TEST>
+  <TEST LOGIC="{AND|OR}" OUTPUT="{property|value}">
+    {property} {conditional} {property|value}
+    ...
+  </TEST>
+  ...
+</COMPONENT>
+*/
+   
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
+
 
 class FGSwitch  : public FGFCSComponent
 {
@@ -65,7 +116,33 @@ public:
 private:
   FGFCS* fcs;
   FGConfigFile* AC_cfg;
+
+  enum eLogic {elUndef=0, eAND, eOR, eDefault};
+  enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
+  map <const string, eComparison> mComparison;
+
+  struct test {
+    vector <FGCondition> conditions;
+    eLogic Logic;
+    double OutputVal;
+    FGPropertyManager *OutputProp;
+    
+    double GetValue(void) {
+      if (OutputProp == 0L) return OutputVal;
+      else                  return OutputProp->getDoubleValue();
+    }
+
+    test(void) { // constructor for the test structure
+      Logic      = elUndef;
+      OutputVal  = 0.0;
+      OutputProp = 0L;
+    }
+
+  };
+
+  vector <test> tests;
+  
   void Debug(int from);
 };
-
+}
 #endif
index 90ad2c5c263cab25373f17db5f639865eead9018..ad4345d49a8779eb6c3bbe8d08301d1f740a6866 100644 (file)
@@ -10,7 +10,8 @@ libfiltersjb_a_SOURCES = \
        FGGradient.cpp FGGradient.h \
        FGKinemat.cpp FGKinemat.h \
        FGSummer.cpp FGSummer.h \
-       FGSwitch.cpp FGSwitch.h
+       FGSwitch.cpp FGSwitch.h \
+        FGCondition.cpp FGCondition.h
 
 AM_CXXFLAGS = -DFGFS