]> git.mxchange.org Git - flightgear.git/commitdiff
Latest JSBSim changes.
authordavid <david>
Mon, 24 Dec 2001 13:54:55 +0000 (13:54 +0000)
committerdavid <david>
Mon, 24 Dec 2001 13:54:55 +0000 (13:54 +0000)
59 files changed:
src/FDM/JSBSim/FGAerodynamics.cpp
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGAircraft.h
src/FDM/JSBSim/FGAtmosphere.cpp
src/FDM/JSBSim/FGAuxiliary.cpp
src/FDM/JSBSim/FGCoefficient.cpp
src/FDM/JSBSim/FGColumnVector3.cpp
src/FDM/JSBSim/FGColumnVector4.cpp
src/FDM/JSBSim/FGConfigFile.cpp
src/FDM/JSBSim/FGEngine.cpp
src/FDM/JSBSim/FGFCS.cpp
src/FDM/JSBSim/FGFDMExec.cpp
src/FDM/JSBSim/FGFDMExec.h
src/FDM/JSBSim/FGFactorGroup.cpp
src/FDM/JSBSim/FGForce.cpp
src/FDM/JSBSim/FGGroundReactions.cpp
src/FDM/JSBSim/FGInertial.cpp
src/FDM/JSBSim/FGInitialCondition.cpp
src/FDM/JSBSim/FGInitialCondition.h
src/FDM/JSBSim/FGLGear.cpp
src/FDM/JSBSim/FGMassBalance.cpp
src/FDM/JSBSim/FGMatrix33.cpp
src/FDM/JSBSim/FGModel.cpp
src/FDM/JSBSim/FGModel.h
src/FDM/JSBSim/FGNozzle.cpp
src/FDM/JSBSim/FGOutput.cpp
src/FDM/JSBSim/FGPiston.cpp
src/FDM/JSBSim/FGPosition.cpp
src/FDM/JSBSim/FGPropeller.cpp
src/FDM/JSBSim/FGPropulsion.cpp
src/FDM/JSBSim/FGRocket.cpp
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGRotor.cpp
src/FDM/JSBSim/FGScript.cpp
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTable.cpp
src/FDM/JSBSim/FGTank.cpp
src/FDM/JSBSim/FGThruster.cpp
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/FGTurboJet.cpp
src/FDM/JSBSim/FGTurboProp.cpp
src/FDM/JSBSim/FGTurboShaft.cpp
src/FDM/JSBSim/FGUtility.cpp
src/FDM/JSBSim/FGfdmSocket.cpp
src/FDM/JSBSim/FGfdmSocket.h
src/FDM/JSBSim/JSBSim.cpp
src/FDM/JSBSim/filtersjb/FGDeadBand.cpp
src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp
src/FDM/JSBSim/filtersjb/FGFilter.cpp
src/FDM/JSBSim/filtersjb/FGGain.cpp
src/FDM/JSBSim/filtersjb/FGGradient.cpp
src/FDM/JSBSim/filtersjb/FGKinemat.cpp
src/FDM/JSBSim/filtersjb/FGSummer.cpp
src/FDM/JSBSim/filtersjb/FGSwitch.cpp

index c721709541cf9a003ad5d1fb20a710fd8c4146a8..c8466f42d62febc84342351d896e62bb130ecfe9 100644 (file)
@@ -61,7 +61,7 @@ FGAerodynamics::FGAerodynamics(FGFDMExec* FDMExec) : FGModel(FDMExec)
 
   Coeff = new CoeffArray[6];
 
-  if (debug_lvl & 2) cout << "Instantiated: FGAerodynamics" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -76,7 +76,7 @@ FGAerodynamics::~FGAerodynamics()
   }
   delete[] Coeff;
 
-  if (debug_lvl & 2) cout << "Destroyed:    FGAerodynamics" << endl;
+  Debug(1);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -202,11 +202,49 @@ double FGAerodynamics::GetLoD(void)
   if (vFs(1) != 0.00) return vFs(3)/vFs(1);
   else                return 0.00;
 }
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    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 FGAerodynamics::Debug(int from)
 {
-    //TODO: Add your source code here
+  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: FGAerodynamics" << endl;
+    if (from == 1) cout << "Destroyed:    FGAerodynamics" << 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 5f0573b4f278f17fdd2ff721585519105c487755..6f61c729844766902e0c28db689d4390a0dfc269 100644 (file)
@@ -119,40 +119,6 @@ FGAircraft::~FGAircraft()
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGAircraft::Load(FGConfigFile* AC_cfg)
-{
-  string token;
-
-  if (!ReadPrologue(AC_cfg)) return false;
-
-  while ((AC_cfg->GetNextConfigLine() != string("EOF")) &&
-         (token = AC_cfg->GetValue()) != string("/FDM_CONFIG")) {
-    if (token == "METRICS") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Metrics" << fgdef << endl;
-      if (!ReadMetrics(AC_cfg)) return false;
-    } else if (token == "AERODYNAMICS") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Aerodynamics" << fgdef << endl;
-      if (!ReadAerodynamics(AC_cfg)) return false;
-    } else if (token == "UNDERCARRIAGE") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Landing Gear" << fgdef << endl;
-      if (!ReadUndercarriage(AC_cfg)) return false;
-    } else if (token == "PROPULSION") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Propulsion" << fgdef << endl;
-      if (!ReadPropulsion(AC_cfg)) return false;
-    } else if (token == "FLIGHT_CONTROL") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Flight Control" << fgdef << endl;
-      if (!ReadFlightControls(AC_cfg)) return false;
-    } else if (token == "OUTPUT") {
-      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Output directives" << fgdef << endl;
-      if (!ReadOutput(AC_cfg)) return false;
-    }
-  }
-  
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 bool FGAircraft::Run(void)
 {
   if (!FGModel::Run()) {                 // if false then execute this Run()
@@ -197,33 +163,7 @@ float FGAircraft::GetNlf(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGAircraft::ReadPrologue(FGConfigFile* AC_cfg)
-{
-  string token = AC_cfg->GetValue();
-  string scratch;
-  AircraftName = AC_cfg->GetValue("NAME");
-  if (debug_lvl > 0) cout << underon << "Reading Aircraft Configuration File"
-            << underoff << ": " << highint << AircraftName << normint << endl;
-  scratch = AC_cfg->GetValue("VERSION").c_str();
-
-  CFGVersion = AC_cfg->GetValue("VERSION");
-
-  if (debug_lvl > 0)
-    cout << "                            Version: " << highint << CFGVersion
-                                                             << normint << endl;
-  if (CFGVersion != needed_cfg_version) {
-    cerr << endl << fgred << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT."
-            " RESULTS WILL BE UNPREDICTABLE !!" << endl;
-    cerr << "Current version needed is: " << needed_cfg_version << endl;
-    cerr << "         You have version: " << CFGVersion << endl << fgdef << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
+bool FGAircraft::Load(FGConfigFile* AC_cfg)
 {
   string token = "";
   string parameter;
@@ -318,61 +258,6 @@ bool FGAircraft::ReadMetrics(FGConfigFile* AC_cfg)
   return true;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadPropulsion(FGConfigFile* AC_cfg)
-{
-  if (!Propulsion->Load(AC_cfg)) {
-    cerr << "  Propulsion not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadFlightControls(FGConfigFile* AC_cfg)
-{
-  if (!FCS->Load(AC_cfg)) {
-    cerr << "  Flight Controls not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadAerodynamics(FGConfigFile* AC_cfg)
-{
-  if (!Aerodynamics->Load(AC_cfg)) {
-    cerr << "  Aerodynamics not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadUndercarriage(FGConfigFile* AC_cfg)
-{
-  if (!GroundReactions->Load(AC_cfg)) {
-    cerr << "  Ground Reactions not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-bool FGAircraft::ReadOutput(FGConfigFile* AC_cfg)
-{
-  if (!Output->Load(AC_cfg)) {
-    cerr << "  Output not successfully loaded" << endl;
-    return false;
-  }
-  return true;
-}
-
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //    The bitmasked value choices are as follows:
 //    unset: In this case (the default) JSBSim would only print
@@ -410,7 +295,11 @@ void FGAircraft::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
-  if (debug_lvl & 32) { // Turbulence
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
   }
 }
 
index 3346de06d445dc42c38fd6c796cc6c164a561bd3..240d75259477cd2ef6a6dd9a4abeb9eaeb09b12c 100644 (file)
@@ -74,45 +74,6 @@ FORWARD DECLARATIONS
 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Longitudinal
-  CL0 - Reference lift at zero alpha
-  CD0 - Reference drag at zero alpha
-  CDM - Drag due to Mach
-  CLa - Lift curve slope (w.r.t. alpha)
-  CDa - Drag curve slope (w.r.t. alpha)
-  CLq - Lift due to pitch rate
-  CLM - Lift due to Mach
-  CLadt - Lift due to alpha rate
-  Cmadt - Pitching Moment due to alpha rate
-  Cm0 - Reference Pitching moment at zero alpha
-  Cma - Pitching moment slope (w.r.t. alpha)
-  Cmq - Pitch damping (pitch moment due to pitch rate)
-  CmM - Pitch Moment due to Mach
-Lateral
-  Cyb - Side force due to sideslip
-  Cyr - Side force due to yaw rate
-  Clb - Dihedral effect (roll moment due to sideslip)
-  Clp - Roll damping (roll moment due to roll rate)
-  Clr - Roll moment due to yaw rate
-  Cnb - Weathercocking stability (yaw moment due to sideslip)
-  Cnp - Rudder adverse yaw (yaw moment due to roll rate)
-  Cnr - Yaw damping (yaw moment due to yaw rate)
-Control
-  CLDe - Lift due to elevator
-  CDDe - Drag due to elevator
-  CyDr - Side force due to rudder
-  CyDa - Side force due to aileron
-  CmDe - Pitch moment due to elevator
-  ClDa - Roll moment due to aileron
-  ClDr - Roll moment due to rudder
-  CnDr - Yaw moment due to rudder
-  CnDa - Yaw moment due to aileron
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -123,10 +84,7 @@ CLASS DOCUMENTATION
     landing gear, etc. These constituent parts may actually run as separate
     JSBSim models themselves, but the responsibility for initializing them and
     for retrieving their force and moment contributions falls to FGAircraft.<br>
-    When an aircraft model is loaded the config file is parsed and for each of the
-    sections of the config file (propulsion, flight control, etc.) the
-    corresponding "ReadXXX()" method is called. From within this method the 
-    "Load()" method of that system is called (e.g. LoadFCS).
+    
     @author Jon S. Berndt
     @version $Id$
     @see
@@ -199,6 +157,7 @@ public:
 
   inline void SetAlphaCLMax(double tt) { alphaclmax=tt; }
   inline void SetAlphaCLMin(double tt) { alphaclmin=tt; }
+  inline void SetAircraftName(string name) {AircraftName = name;}
   
   inline double GetStallWarn(void) { return impending_stall; }
   
@@ -222,16 +181,8 @@ private:
   double lbarh,lbarv,vbarh,vbarv;
   double alphaclmax,alphaclmin;
   double impending_stall;
-  string CFGVersion;
   string AircraftName;
 
-  bool ReadMetrics(FGConfigFile*);
-  bool ReadPropulsion(FGConfigFile*);
-  bool ReadFlightControls(FGConfigFile*);
-  bool ReadAerodynamics(FGConfigFile*);
-  bool ReadUndercarriage(FGConfigFile*);
-  bool ReadPrologue(FGConfigFile*);
-  bool ReadOutput(FGConfigFile*);
   void Debug(int from);
 };
 
index 2f9f24066dbc3d0855cddd29a6d3285256602925..3f6f9f2e8f8ff9b4e04505922b5433a25a240afe 100644 (file)
@@ -338,5 +338,11 @@ void FGAtmosphere::Debug(int from)
       cout << vTurbulence << ", " << vTurbulenceGrad << ", " << vDirection << ", " << Magnitude << ", " << vTurbPQR << endl;
     }
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 4657cb34c16ea652b3908a5669935d292e49a552..d744579d36a3d63647cfc2c67f444e4143838778 100644 (file)
@@ -70,14 +70,14 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
   psl = rhosl = 1;
   earthPosAngle = 0.0;
   
-  if (debug_lvl & 2) cout << "Instantiated: " << Name << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGAuxiliary::~FGAuxiliary()
 {
-  if (debug_lvl & 2) cout << "Destroyed:    FGAuxiliary" << endl;
+  Debug(1);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -212,9 +212,48 @@ void FGAuxiliary::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 FGAuxiliary::Debug(int from)
 {
-    //TODO: Add your source code here
+  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: FGAuxiliary" << endl;
+    if (from == 1) cout << "Destroyed:    FGAuxiliary" << 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 6838d86f08eae8280fd0564b8b0ee19439578c04..fa6973a65d9206ad762db94d224c67af38607a2c 100644 (file)
@@ -324,5 +324,11 @@ void FGCoefficient::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 70a785dff9172ec96004318d5c817df1ef45b680..4684da5294ef8926a89e28c39d01f3b89c42d733 100644 (file)
@@ -32,7 +32,7 @@ FGColumnVector3::FGColumnVector3(void)
   rowCtr = 1;
   data[0]=0; data[1]=0; data[2]=0; data[3]=0;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector3" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -42,14 +42,14 @@ FGColumnVector3::FGColumnVector3(double X, double Y, double Z)
   rowCtr = 1;
   data[0] = 0; data[eX] = X; data[eY] = Y; data[eZ] = Z;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector3" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGColumnVector3::~FGColumnVector3(void)
 {
-  if (debug_lvl & 2) cout << "Destroyed:    FGColumnVector3" << endl;
+  Debug(1);
 }
 
 
@@ -62,7 +62,7 @@ FGColumnVector3::FGColumnVector3(const FGColumnVector3& b)
   data[3] = b.data[3];
   rowCtr = 1;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector3" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -74,8 +74,6 @@ FGColumnVector3 FGColumnVector3::operator=(const FGColumnVector3& b)
   data[3] = b.data[3];
   rowCtr = 1;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector3" << endl;
-  
   return *this;
 }
 
@@ -283,10 +281,46 @@ FGColumnVector3& FGColumnVector3::operator<<(const double ff)
   return *this;
 }
 
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+//    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 FGColumnVector3::Debug(int from)
 {
-    //TODO: Add your source code here
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGColumnVector3" << endl;
+    if (from == 1) cout << "Destroyed:    FGColumnVector3" << 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 30a100913e38ab20ff6ac19d19d93cc49a4b3132..8a0cd99f2bd82440663b44f9400d4e3146243c17 100644 (file)
@@ -32,7 +32,7 @@ FGColumnVector4::FGColumnVector4(void)
   rowCtr = 1;
   data[1]=0;data[2]=0;data[3]=0;data[4]=0;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector4" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -42,14 +42,14 @@ FGColumnVector4::FGColumnVector4(double A, double B, double C, double D)
   rowCtr = 1;
   data[1]=0;data[2]=0;data[3]=0;data[4]=0;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector4" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGColumnVector4::~FGColumnVector4(void)
 {
-  if (debug_lvl & 2) cout << "Destroyed:    FGColumnVector4" << endl;
+  Debug(1);
 }
 
 
@@ -64,7 +64,7 @@ FGColumnVector4::FGColumnVector4(const FGColumnVector4& b)
 
   rowCtr = 1;
 
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector4" << endl;
+  Debug(0);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -76,9 +76,6 @@ FGColumnVector4 FGColumnVector4::operator=(const FGColumnVector4& b)
   data[3] = b.data[3];
   data[4] = b.data[4];
   rowCtr = 1;
-
-  if (debug_lvl & 2) cout << "Instantiated: FGColumnVector4" << endl;
-  
   return *this;
 }
 
@@ -270,11 +267,47 @@ FGColumnVector4& FGColumnVector4::operator<<(const double ff)
   if (++rowCtr > 4) rowCtr = 1;
   return *this;
 }
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+//    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 FGColumnVector4::Debug(int from)
 {
-    //TODO: Add your source code here
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGColumnVector4" << endl;
+    if (from == 1) cout << "Destroyed:    FGColumnVector4" << 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) { // Sanity checking
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
+
index 29dc717aca8f4c5d3767c1533460b4ca011e0419..488ec0b616f175571e7bc8000c410ff6108c3382 100644 (file)
@@ -350,5 +350,11 @@ void FGConfigFile::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 7f7c2956c1d9fffc7dd632dc658a4853e73e56fd..f90587e70d56e7edfc4e434a5761c40d7a18904c 100644 (file)
@@ -191,4 +191,11 @@ void FGEngine::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
+
index 63d3a725d841322be2649aca50c46cc727b949f0..d95e3d8c0fffbe9f0deeafb2e8e6903921d98a1b 100644 (file)
@@ -408,4 +408,11 @@ void FGFCS::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
+
index 806a08b21959719cf9a26d1437be95989bd4c882..fdf6eaf2cd7acbdb7072440e04626ad78275cf6a 100644 (file)
@@ -4,7 +4,6 @@
  Author:       Jon S. Berndt
  Date started: 11/17/98
  Purpose:      Schedules and runs the model routines.
- Called by:    The GUI.
 
  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
 
@@ -80,26 +79,6 @@ static const char *IdHdr = ID_FDMEXEC;
 GLOBAL DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-short debug_lvl;  // This describes to any interested entity the debug level
-                  // requested by setting the JSBSIM_DEBUG environment variable.
-                  // The bitmasked value choices are as follows:
-                  // a) 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
-                  // b) 0: This requests JSBSim not to output any messages
-                  //    whatsoever.
-                  // c) 1: This value explicity requests the normal JSBSim
-                  //    startup messages
-                  // d) 2: This value asks for a message to be printed out when
-                  //    a class is instantiated
-                  // e) 4: When this value is set, a message is displayed when a
-                  //    FGModel object executes its Run() method
-                  // f) 8: When this value is set, various runtime state variables
-                  //    are printed out periodically
-                  // g) 16: When set various parameters are sanity checked and
-                  //    a message is printed out when they go out of bounds.
-
 unsigned int FGFDMExec::FDMctr = 0;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -131,7 +110,6 @@ FGFDMExec::FGFDMExec(void)
   terminate = false;
   frozen = false;
   modelLoaded = false;
-  Scripted = false;
 
   IdFDM = FDMctr;
   FDMctr++;
@@ -328,11 +306,6 @@ bool FGFDMExec::Run(void)
   model_iterator = FirstModel;
   if (model_iterator == 0L) return false;
 
-  if (Scripted) {
-    RunScript();
-    if (State->Getsim_time() >= EndTime) return false;
-  }
-
   Debug(2);
 
   while (!model_iterator->Run()) {
@@ -361,8 +334,8 @@ bool FGFDMExec::RunIC(FGInitialCondition *fgic)
 
 bool FGFDMExec::LoadModel(string APath, string EPath, string model)
 {
-  bool result = false;
-
+  bool result = true;
+  string token;
   string aircraftCfgFileName;
 
   AircraftPath = APath;
@@ -382,7 +355,30 @@ bool FGFDMExec::LoadModel(string APath, string EPath, string model)
     Allocate();
   }
 
-  result = Aircraft->Load(&AC_cfg);
+  if (!ReadPrologue(&AC_cfg)) return false;
+
+  while ((AC_cfg.GetNextConfigLine() != string("EOF")) &&
+         (token = AC_cfg.GetValue()) != string("/FDM_CONFIG")) {
+    if (token == "METRICS") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Metrics" << fgdef << endl;
+      if (!ReadMetrics(&AC_cfg)) result = false;
+    } else if (token == "AERODYNAMICS") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Aerodynamics" << fgdef << endl;
+      if (!ReadAerodynamics(&AC_cfg)) result = false;
+    } else if (token == "UNDERCARRIAGE") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Landing Gear" << fgdef << endl;
+      if (!ReadUndercarriage(&AC_cfg)) result = false;
+    } else if (token == "PROPULSION") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Propulsion" << fgdef << endl;
+      if (!ReadPropulsion(&AC_cfg)) result = false;
+    } else if (token == "FLIGHT_CONTROL") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Flight Control" << fgdef << endl;
+      if (!ReadFlightControls(&AC_cfg)) result = false;
+    } else if (token == "OUTPUT") {
+      if (debug_lvl > 0) cout << fgcyan << "\n  Reading Output directives" << fgdef << endl;
+      if (!ReadOutput(&AC_cfg)) result = false;
+    }
+  }
 
   if (result) {
     modelLoaded = true;
@@ -398,208 +394,98 @@ bool FGFDMExec::LoadModel(string APath, string EPath, string model)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGFDMExec::LoadScript(string script)
+bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
 {
-  FGConfigFile Script(script);
-  string token="";
-  string aircraft="";
-  string initialize="";
-  bool result = false;
-  double dt = 0.0;
-  unsigned i;
-  struct condition *newCondition;
-
-  if (!Script.IsOpen()) return false;
-
-  Script.GetNextConfigLine();
-  ScriptName = Script.GetValue("name");
-  Scripted = true;
-  if (debug_lvl > 0) cout << "Reading Script File " << ScriptName << endl;
-
-  while (Script.GetNextConfigLine() != string("EOF") && Script.GetValue() != string("/runscript")) {
-    token = Script.GetValue();
-    if (token == "use") {
-      if ((token = Script.GetValue("aircraft")) != string("")) {
-        aircraft = token;
-        if (debug_lvl > 0) cout << "  Use aircraft: " << token << endl;
-      } else if ((token = Script.GetValue("initialize")) != string("")) {
-        initialize = token;
-        if (debug_lvl > 0) cout << "  Use reset file: " << token << endl;
-      } else {
-        cerr << "Unknown 'use' keyword: \"" << token << "\"" << endl;
-      }
-    } else if (token == "run") {
-      StartTime = strtod(Script.GetValue("start").c_str(), NULL);
-      State->Setsim_time(StartTime);
-      EndTime   = strtod(Script.GetValue("end").c_str(), NULL);
-      dt        = strtod(Script.GetValue("dt").c_str(), NULL);
-      State->Setdt(dt);
-      Script.GetNextConfigLine();
-      token = Script.GetValue();
-      while (token != string("/run")) {
-
-        if (token == "when") {
-          Script.GetNextConfigLine();
-          token = Script.GetValue();
-          newCondition = new struct condition();
-          while (token != string("/when")) {
-            if (token == "parameter") {
-              newCondition->TestParam.push_back(State->GetParameterIndex(Script.GetValue("name")));
-              newCondition->TestValue.push_back(strtod(Script.GetValue("value").c_str(), NULL));
-              newCondition->Comparison.push_back(Script.GetValue("comparison"));
-            } else if (token == "set") {
-              newCondition->SetParam.push_back(State->GetParameterIndex(Script.GetValue("name")));
-              newCondition->SetValue.push_back(strtod(Script.GetValue("value").c_str(), NULL));
-              newCondition->Triggered.push_back(false);
-              newCondition->OriginalValue.push_back(0.0);
-              newCondition->newValue.push_back(0.0);
-              newCondition->StartTime.push_back(0.0);
-              newCondition->EndTime.push_back(0.0);
-              string tempCompare = Script.GetValue("type");
-              if      (tempCompare == "FG_DELTA") newCondition->Type.push_back(FG_DELTA);
-              else if (tempCompare == "FG_BOOL")  newCondition->Type.push_back(FG_BOOL);
-              else if (tempCompare == "FG_VALUE") newCondition->Type.push_back(FG_VALUE);
-              else                                newCondition->Type.push_back((eType)0);
-              tempCompare = Script.GetValue("action");
-              if      (tempCompare == "FG_RAMP") newCondition->Action.push_back(FG_RAMP);
-              else if (tempCompare == "FG_STEP") newCondition->Action.push_back(FG_STEP);
-              else if (tempCompare == "FG_EXP")  newCondition->Action.push_back(FG_EXP);
-              else                               newCondition->Action.push_back((eAction)0);
-              
-              if (Script.GetValue("persistent") == "true")
-                newCondition->Persistent.push_back(true);
-              else
-                newCondition->Persistent.push_back(false);
-               
-              newCondition->TC.push_back(strtod(Script.GetValue("tc").c_str(), NULL));
-             
-            } else {
-              cerr << "Unrecognized keyword in script file: \" [when] " << token << "\"" << endl;
-            }
-            Script.GetNextConfigLine();
-            token = Script.GetValue();
-          }
-          Conditions.push_back(*newCondition);
-          Script.GetNextConfigLine();
-          token = Script.GetValue();
-
-        } else {
-          cerr << "Error reading script file: expected \"when\", got \"" << token << "\"" << endl;
-        }
-
-      }
-    } else if (token.empty()) {
-     // do nothing
-    } else {
-      cerr << "Unrecognized keyword in script file: \"" << token << "\" [runscript] " << endl;
-    }
+  string token = AC_cfg->GetValue();
+  string scratch;
+  string AircraftName;
+  
+  AircraftName = AC_cfg->GetValue("NAME");
+  Aircraft->SetAircraftName(AircraftName);
+
+  if (debug_lvl > 0) cout << underon << "Reading Aircraft Configuration File"
+            << underoff << ": " << highint << AircraftName << normint << endl;
+  scratch = AC_cfg->GetValue("VERSION").c_str();
+
+  CFGVersion = AC_cfg->GetValue("VERSION");
+
+  if (debug_lvl > 0)
+    cout << "                            Version: " << highint << CFGVersion
+                                                             << normint << endl;
+  if (CFGVersion != needed_cfg_version) {
+    cerr << endl << fgred << "YOU HAVE AN INCOMPATIBLE CFG FILE FOR THIS AIRCRAFT."
+            " RESULTS WILL BE UNPREDICTABLE !!" << endl;
+    cerr << "Current version needed is: " << needed_cfg_version << endl;
+    cerr << "         You have version: " << CFGVersion << endl << fgdef << endl;
+    return false;
   }
+  return true;
+}
 
-  if (aircraft == "") {
-    cerr << "Aircraft file not loaded in script" << endl;
-    exit(-1);
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+bool FGFDMExec::ReadPropulsion(FGConfigFile* AC_cfg)
+{
+  if (!Propulsion->Load(AC_cfg)) {
+    cerr << "  Propulsion not successfully loaded" << endl;
+    return false;
   }
+  return true;
+}
 
-  Debug(4);
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-  result = LoadModel("aircraft", "engine", aircraft);
-  if (!result) {
-    cerr << "Aircraft file " << aircraft << " was not found" << endl;
-         exit(-1);
+bool FGFDMExec::ReadFlightControls(FGConfigFile* AC_cfg)
+{
+  if (!FCS->Load(AC_cfg)) {
+    cerr << "  Flight Controls not successfully loaded" << endl;
+    return false;
   }
+  return true;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-  FGInitialCondition IC(this);
-  if ( ! IC.Load("aircraft", aircraft, initialize)) {
-    cerr << "Initialization unsuccessful" << endl;
-    exit(-1);
+bool FGFDMExec::ReadAerodynamics(FGConfigFile* AC_cfg)
+{
+  if (!Aerodynamics->Load(AC_cfg)) {
+    cerr << "  Aerodynamics not successfully loaded" << endl;
+    return false;
   }
+  return true;
+}
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+bool FGFDMExec::ReadUndercarriage(FGConfigFile* AC_cfg)
+{
+  if (!GroundReactions->Load(AC_cfg)) {
+    cerr << "  Ground Reactions not successfully loaded" << endl;
+    return false;
+  }
   return true;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGFDMExec::RunScript(void)
+bool FGFDMExec::ReadMetrics(FGConfigFile* AC_cfg)
 {
-  vector <struct condition>::iterator iC = Conditions.begin();
-  bool truth = false;
-  bool WholeTruth = false;
-  unsigned i;
-
-  double currentTime = State->Getsim_time();
-  double newSetValue = 0;
-
-  while (iC < Conditions.end()) {
-    // determine whether the set of conditional tests for this condition equate
-    // to true
-    for (i=0; i<iC->TestValue.size(); i++) {
-           if (iC->Comparison[i] == "lt")
-              truth = State->GetParameter(iC->TestParam[i]) <  iC->TestValue[i];
-      else if (iC->Comparison[i] == "le")
-              truth = State->GetParameter(iC->TestParam[i]) <= iC->TestValue[i];
-      else if (iC->Comparison[i] == "eq")
-              truth = State->GetParameter(iC->TestParam[i]) == iC->TestValue[i];
-      else if (iC->Comparison[i] == "ge")
-              truth = State->GetParameter(iC->TestParam[i]) >= iC->TestValue[i];
-      else if (iC->Comparison[i] == "gt")
-              truth = State->GetParameter(iC->TestParam[i]) >  iC->TestValue[i];
-      else if (iC->Comparison[i] == "ne")
-              truth = State->GetParameter(iC->TestParam[i]) != iC->TestValue[i];
-      else
-              cerr << "Bad comparison" << endl;
-
-      if (i == 0) WholeTruth = truth;
-      else        WholeTruth = WholeTruth && truth;
-
-      if (!truth && iC->Persistent[i] && iC->Triggered[i]) iC->Triggered[i] = false;
-    }
+  if (!Aircraft->Load(AC_cfg)) {
+    cerr << "  Aircraft metrics not successfully loaded" << endl;
+    return false;
+  }
+  return true;
+}
 
-    // if the conditions are true, do the setting of the desired parameters
-
-    if (WholeTruth) {
-      for (i=0; i<iC->SetValue.size(); i++) {
-        if ( ! iC->Triggered[i]) {
-          iC->OriginalValue[i] = State->GetParameter(iC->SetParam[i]);
-          switch (iC->Type[i]) {
-          case FG_VALUE:
-            iC->newValue[i] = iC->SetValue[i];
-            break;
-          case FG_DELTA:
-            iC->newValue[i] = iC->OriginalValue[i] + iC->SetValue[i];
-            break;
-          case FG_BOOL:
-            iC->newValue[i] = iC->SetValue[i];
-            break;
-          default:
-            cerr << "Invalid Type specified" << endl;
-            break;
-          }
-          iC->Triggered[i] = true;
-          iC->StartTime[i] = currentTime;
-        }
-
-        switch (iC->Action[i]) {
-        case FG_RAMP:
-        newSetValue = (currentTime - iC->StartTime[i])/(iC->TC[i])
-                      * (iC->newValue[i] - iC->OriginalValue[i]) + iC->OriginalValue[i];
-          if (newSetValue > iC->newValue[i]) newSetValue = iC->newValue[i];
-          break;
-        case FG_STEP:
-          newSetValue = iC->newValue[i];
-          break;
-        case FG_EXP:
-          newSetValue = (1 - exp(-(currentTime - iC->StartTime[i])/(iC->TC[i])))
-              * (iC->newValue[i] - iC->OriginalValue[i]) + iC->OriginalValue[i];
-          break;
-        default:
-          cerr << "Invalid Action specified" << endl;
-          break;
-        }
-        State->SetParameter(iC->SetParam[i], newSetValue);
-      }
-    }
-    iC++;
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+bool FGFDMExec::ReadOutput(FGConfigFile* AC_cfg)
+{
+  if (!Output->Load(AC_cfg)) {
+    cerr << "  Output not successfully loaded" << endl;
+    return false;
   }
+  return true;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -623,8 +509,6 @@ void FGFDMExec::RunScript(void)
 
 void FGFDMExec::Debug(int from)
 {
-  unsigned int i;
-
   if (debug_lvl <= 0) return;
 
   if (debug_lvl & 1) { // Standard console startup message output
@@ -635,73 +519,6 @@ void FGFDMExec::Debug(int from)
       cout << normint << "JSBSim startup beginning ...\n\n";
     } else if (from == 3) {
       cout << "\n\nJSBSim startup complete\n\n";
-    } else if (from == 4)  { // print out script data
-      vector <struct condition>::iterator iterConditions = Conditions.begin();
-      int count=0;
-
-      cout << "\n  Script goes from " << StartTime << " to " << EndTime
-           << " with dt = " << State->Getdt() << endl << endl;
-
-      while (iterConditions < Conditions.end()) {
-        cout << "  Condition: " << count++ << endl;
-        cout << "    if (";
-
-        for (i=0; i<iterConditions->TestValue.size(); i++) {
-          if (i>0) cout << " and" << endl << "        ";
-          cout << "(" << State->paramdef[iterConditions->TestParam[i]]
-                      << iterConditions->Comparison[i] << " "
-                      << iterConditions->TestValue[i] << ")";
-        }
-        cout << ") then {";
-
-        for (i=0; i<iterConditions->SetValue.size(); i++) {
-          cout << endl << "      set" << State->paramdef[iterConditions->SetParam[i]]
-               << "to " << iterConditions->SetValue[i];
-
-          switch (iterConditions->Type[i]) {
-          case FG_VALUE:
-            cout << " (constant";
-            break;
-          case FG_DELTA:
-            cout << " (delta";
-            break;
-          case FG_BOOL:
-            cout << " (boolean";
-            break;
-          default:
-            cout << " (unspecified type";
-          }
-
-          switch (iterConditions->Action[i]) {
-          case FG_RAMP:
-            cout << " via ramp";
-            break;
-          case FG_STEP:
-            cout << " via step";
-            break;
-          case FG_EXP:
-            cout << " via exponential approach";
-            break;
-          default:
-            cout << " via unspecified action";
-          }
-
-          if (!iterConditions->Persistent[i]) cout << endl
-                             << "                              once";
-          else cout << endl
-                             << "                              repeatedly";
-
-          if (iterConditions->Action[i] == FG_RAMP ||
-              iterConditions->Action[i] == FG_EXP) cout << endl
-                             << "                              with time constant "
-                             << iterConditions->TC[i];
-        }
-        cout << ")" << endl << "    }" << endl << endl;
-
-        iterConditions++;
-      }
-
-      cout << endl;
     }
   }
   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
@@ -718,4 +535,11 @@ void FGFDMExec::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
+
index dd9e633000730497f37992a26bc7f6718c00705e..c7a8c7b505417695d43fb80c1d0fccc3b868b2d7 100644 (file)
@@ -55,20 +55,6 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGState;
-class FGAtmosphere;
-class FGFCS;
-class FGPropulsion;
-class FGMassBalance;
-class FGAerodynamics;
-class FGInertial;
-class FGGroundReactions;
-class FGAircraft;
-class FGTranslation;
-class FGRotation;
-class FGPosition;
-class FGAuxiliary;
-class FGOutput;
 class FGInitialCondition;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -88,64 +74,10 @@ CLASS DOCUMENTATION
     other flight simulator) this class is typically instantiated by an interface
     class on the simulator side.
 
-    <h4>Scripting support provided in the Executive</h4>
-
-    <p>There is simple scripting support provided in the FGFDMExec
-    class. Commands are specified using the <u>Simple Scripting
-    Directives for JSBSim</u> (SSDJ). The script file is in XML
-    format. A test condition (or conditions) can be set up in the
-    script and when the condition evaluates to true, the specified
-    action[s] is/are taken. A test condition can be <em>persistent</em>,
-    meaning that if a test condition evaluates to true, then passes
-    and evaluates to false, the condition is reset and may again be
-    triggered. When the set of tests evaluates to true for a given
-    condition, an item may be set to another value. This value might
-    be a boolean, a value, or a delta value, and the change from the
-    current value to the new value can be either via a step function,
-    a ramp, or an exponential approach. The speed of a ramp or
-    approach is specified via the time constant. Here is the format
-    of the script file:</p>
-
-    <pre><strong>&lt;?xml version=&quot;1.0&quot;?&gt;
-    &lt;runscript name=&quot;C172-01A&quot;&gt;
-
-    &lt;!--
-    This run is for testing C172 runs
-    --&gt;
-
-    &lt;use aircraft=&quot;c172&quot;&gt;
-    &lt;use initialize=&quot;reset00&quot;&gt;
-
-    &lt;run start=&quot;0.0&quot; end=&quot;4.5&quot; dt=&quot;0.05&quot;&gt;
-      &lt;when&gt;
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;0.25&quot;&gt;
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;0.50&quot;&gt;
-        &lt;set name=&quot;FG_AILERON_CMD&quot; type=&quot;FG_VALUE&quot; value=&quot;0.25&quot;
-        action=&quot;FG_STEP&quot; persistent=&quot;false&quot; tc =&quot;0.25&quot;&gt;
-      &lt;/when&gt;
-      &lt;when&gt;
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;0.5&quot;&gt;
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;1.5&quot;&gt;
-        &lt;set name=&quot;FG_AILERON_CMD&quot; type=&quot;FG_DELTA&quot; value=&quot;0.5&quot;
-        action=&quot;FG_EXP&quot; persistent=&quot;false&quot; tc =&quot;0.5&quot;&gt;
-      &lt;/when&gt;
-      &lt;when&gt;
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;ge&quot; value=&quot;1.5&quot;&gt;
-        &lt;parameter name=&quot;FG_TIME&quot; comparison=&quot;le&quot; value=&quot;2.5&quot;&gt;
-        &lt;set name=&quot;FG_RUDDER_CMD&quot; type=&quot;FG_DELTA&quot; value=&quot;0.5&quot;
-        action=&quot;FG_RAMP&quot; persistent=&quot;false&quot; tc =&quot;0.5&quot;&gt;
-      &lt;/when&gt;
-    &lt;/run&gt;
-
-    &lt;/runscript&gt;</strong></pre>
-
-    <p>The first line must always be present. The second line
-    identifies this file as a script file, and gives a descriptive
-    name to the script file. Comments are next, delineated by the
-    &lt;!-- and --&gt; symbols. The aircraft and initialization files
-    to be used are specified in the &quot;use&quot; lines. Next,
-    comes the &quot;run&quot; section, where the conditions are
-    described in &quot;when&quot; clauses.</p>
+    When an aircraft model is loaded the config file is parsed and for each of the
+    sections of the config file (propulsion, flight control, etc.) the
+    corresponding "ReadXXX()" method is called. From within this method the 
+    "Load()" method of that system is called (e.g. LoadFCS).
 
     <h4>JSBSim Debugging Directives</h4>
 
@@ -196,8 +128,7 @@ public:
       @return Currently returns 0 always. */
   int  Schedule(FGModel* model, int rate);
 
-  /** This executes each scheduled model in succession, as well as running any
-      scripts which are loaded.
+  /** This executes each scheduled model in succession.
       @return true if successful, false if sim should be ended  */
   bool Run(void);
 
@@ -227,19 +158,8 @@ public:
       @return true if successful*/
   bool LoadModel(string AircraftPath, string EnginePath, string model);
 
-  /** Loads a script to drive JSBSim (usually in standalone mode).
-      The language is the Simple Script Directives for JSBSim (SSDJ).
-      @param script the filename (including path name, if any) for the script.
-      @return true if successful */
-  bool LoadScript(string script);
-
-  /** This function is called each pass through the executive Run() method IF
-      scripting is enabled. */
-  void RunScript(void);
-
   bool SetEnginePath(string path)   {EnginePath = path; return true;}
   bool SetAircraftPath(string path) {AircraftPath = path; return true;}
-  bool SetScriptPath(string path)   {ScriptPath = path; return true;}
 
   /// @name Top-level executive State and Model retrieval mechanism
   //@{
@@ -279,38 +199,6 @@ public:
   inline string GetAircraftPath(void)        {return AircraftPath;}
 
 private:
-  enum eAction {
-    FG_RAMP  = 1,
-    FG_STEP  = 2,
-    FG_EXP   = 3
-  };
-
-  enum eType {
-    FG_VALUE = 1,
-    FG_DELTA = 2,
-    FG_BOOL  = 3
-  };
-
-  struct condition {
-    vector <eParam>  TestParam;
-    vector <eParam>  SetParam;
-    vector <double>  TestValue;
-    vector <double>  SetValue;
-    vector <string>  Comparison;
-    vector <double>  TC;
-    vector <bool>    Persistent;
-    vector <eAction> Action;
-    vector <eType>   Type;
-    vector <bool>    Triggered;
-    vector <double>  newValue;
-    vector <double>  OriginalValue;
-    vector <double>  StartTime;
-    vector <double>  EndTime;
-
-    condition() {
-    }
-  };
-
   FGModel* FirstModel;
 
   bool frozen;
@@ -320,15 +208,10 @@ private:
   unsigned int IdFDM;
   static unsigned int FDMctr;
   bool modelLoaded;
-  bool Scripted;
 
   string AircraftPath;
   string EnginePath;
-  string ScriptPath;
-  string ScriptName;
-  double  StartTime;
-  double  EndTime;
-  vector <struct condition> Conditions;
+  string CFGVersion;
 
   FGState*           State;
   FGAtmosphere*      Atmosphere;
@@ -345,6 +228,14 @@ private:
   FGAuxiliary*       Auxiliary;
   FGOutput*          Output;
 
+  bool ReadMetrics(FGConfigFile*);
+  bool ReadPropulsion(FGConfigFile*);
+  bool ReadFlightControls(FGConfigFile*);
+  bool ReadAerodynamics(FGConfigFile*);
+  bool ReadUndercarriage(FGConfigFile*);
+  bool ReadPrologue(FGConfigFile*);
+  bool ReadOutput(FGConfigFile*);
+
   bool Allocate(void);
   bool DeAllocate(void);
   void Debug(int from);
index 5b3e0b9a07510fbf18d5b349d0c44e4326eddd0e..4972502846971f8f2f1f438c9b5ae1d831d0e8a8 100644 (file)
@@ -166,4 +166,11 @@ void FGFactorGroup::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
+
index d2da596c2b719e7ee4e24c410230e88cc25b6839..91dd746e6f2a6a8b9800080120203bde3b6645f0 100644 (file)
@@ -172,5 +172,11 @@ void FGForce::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index b041df3bd4afa07c8503fa8f21c6b617b65a0596..30f61113aaf4d614ca89c407ea8ccdb827a22d8b 100644 (file)
@@ -62,8 +62,8 @@ FGGroundReactions::~FGGroundReactions(void)
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 bool FGGroundReactions::Run(void)
 {
-  double steerAngle = 0.0;
-  double xForces = 0.0, yForces = 0.0;
+//  double steerAngle = 0.0;
+//  double xForces = 0.0, yForces = 0.0;
 
   if (!FGModel::Run()) {
     vForces.InitMatrix();
@@ -237,5 +237,11 @@ void FGGroundReactions::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 9f680d203cd95cd59ce038975d3a78e813aea8b8..3afa4677d3533aaeed833272939550ed87b78338 100644 (file)
@@ -160,5 +160,11 @@ void FGInertial::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 213a495f156804509cabac9cd5324a3318c1226a..29dc1f10f6329f3650d3d34e77b09343c7c7c19b 100644 (file)
@@ -91,14 +91,14 @@ FGInitialCondition::FGInitialCondition(FGFDMExec *FDMExec)
     cout << "FGInitialCondition: This class requires a pointer to a valid FGFDMExec object" << endl;
   }
 
-  if (debug_lvl & 2) cout << "Instantiated: FGInitialCondition" << endl;
+  Debug(0);
 }
 
 //******************************************************************************
 
 FGInitialCondition::~FGInitialCondition()
 {
-  if (debug_lvl & 2) cout << "Destroyed:    FGInitialCondition" << endl;
+  Debug(1);
 }
 
 //******************************************************************************
@@ -764,4 +764,48 @@ bool FGInitialCondition::Load(string acpath, string acname, string rstfile)
   fdmex->RunIC(this);
   
   return true;
-}  
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    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 FGInitialCondition::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGInitialCondition" << endl;
+    if (from == 1) cout << "Destroyed:    FGInitialCondition" << 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 7c33cee2ff389ba2c9dbb701b827154138622bed..b8806fd114ace0d9dd3bff850e7e7430282ae1fd 100644 (file)
@@ -290,6 +290,7 @@ private:
 
   bool findInterval(double x,double guess);
   bool solve(double *y, double x);
+  void Debug(int from);
 };
 
 #endif
index dcd9b1c42f32bc49ee1fbd8d904350c690fb36ea..d899dbecba1dc5fe599b4362d3ef2ae9ba0dc86e 100644 (file)
@@ -497,5 +497,11 @@ void FGLGear::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 2770191ab82833368ac50f7343684b5218c84d55..b6a4619d91bcc127960a1bad550cdf55e82d71f4 100644 (file)
@@ -231,5 +231,11 @@ void FGMassBalance::Debug(int from)
         cout << "MassBalance::Mass out of bounds: " << Mass << endl;
     }
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 0c066df5959718b52e8b6c7b7fc4fa24ab797d83..dc88dc2a353e899b8ac811799e614cbae6d6bd7a 100644 (file)
@@ -433,5 +433,11 @@ void FGMatrix33::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index c7f2d4de3c43fe1ab3eba6354429aac5c441b6eb..9462fe79500c88a84bfa28793834642e0b26be7c 100644 (file)
@@ -150,4 +150,48 @@ bool FGModel::Run()
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    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 FGModel::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: FGModel" << endl;
+    if (from == 1) cout << "Destroyed:    FGModel" << 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 59d3224bda93052eb5fe24cd57ce249b27dc6419..189169c65bf5aab02420553c5653e4d161f7bc71 100644 (file)
@@ -130,6 +130,8 @@ public:
 protected:
   int exe_ctr;
   int rate;
+  
+  virtual void Debug(int from);
 
   FGFDMExec*         FDMExec;
   FGState*           State;
index 001df2463445504eb0faff4742828e2f2675aa67..b7340183888f0ed9deec81cb89612d125d94eb01 100644 (file)
@@ -142,5 +142,11 @@ void FGNozzle::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 5cc3d6e1344784905f9483658d65df78ca14f9be..5b1d3501a0708b0968f481b876748bd6ae28daba 100644 (file)
@@ -522,5 +522,11 @@ void FGOutput::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 45abd5e50e9a764d0782eea8a4caf9adfaf30816..d7f8d1c2bae3d6f4e6fe5e79e1f91e6ded946e7c 100644 (file)
@@ -570,5 +570,11 @@ void FGPiston::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 741d9cd4a6e34b4f8f042706fe9d31505898aa37..a5a278af0e6059e16f7b6c8fe62094ff185ebd71 100644 (file)
@@ -263,5 +263,11 @@ void FGPosition::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index b47ba0c7f3b26fd66cdbead5db9ce830ca0600d4..5804117fce13ea9f88f7c1378675ad0b62ee47b6 100644 (file)
@@ -272,5 +272,11 @@ void FGPropeller::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 2b8767dd0a19f23e3717820d8d547411e37948eb..0547532631ea7010eb9f18413ad6f7e148b39bf8 100644 (file)
@@ -580,5 +580,11 @@ void FGPropulsion::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index c5ca65d680fc1f6c9d45989b2fe6e8d15842f775..ec1bb72151a001afa3ec5baa04cf7d98d23b6ff5 100644 (file)
@@ -153,5 +153,11 @@ void FGRocket::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index a3712e00ca1412cb0d841ace758b30ef8968eb68..73763e5a0cfbf045e58ddcc2d87f96c784b15ff8 100644 (file)
@@ -195,4 +195,11 @@ void FGRotation::Debug(int from)
         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 3952a4f395f7cae2294deaf59eef9db0c3e94e3c..50989e8efb81d5f3db9045fbceba8a83d8309a4d 100644 (file)
@@ -97,6 +97,9 @@ public:
   inline FGColumnVector3& GetEulerRates(void) { return vEulerRates; }
   inline double GetEulerRates(int axis) { return vEulerRates(axis); }
   inline void SetPQR(FGColumnVector3 tt) {vPQR = tt;}
+  inline void SetPQR(double p, double q, double r) {vPQR(eP)=p;
+                                                    vPQR(eQ)=q;
+                                                    vPQR(eR)=r;}
   inline void SetEuler(FGColumnVector3 tt) {vEuler = tt;}
   
   inline double Getphi(void) {return vEuler(1);}
index 195795bbc13625e92d7c4360acd657d1d1f166a8..3d0c7f3e04d2e08d235405d6d2fc1f79198aa937 100644 (file)
@@ -102,5 +102,11 @@ void FGRotor::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 690d5abb32d11485caad14caa29e987e009e8a2a..34e7b9f14abaf86fc8710111c3a3c5fee669af39 100644 (file)
@@ -93,7 +93,6 @@ bool FGScript::LoadScript(string script)
   string initialize="";\r
   bool result = false;\r
   double dt = 0.0;\r
-  unsigned i;\r
   struct condition *newCondition;\r
 \r
   if (!Script.IsOpen()) return false;\r
@@ -405,5 +404,11 @@ void FGScript::Debug(int from)
   }\r
   if (debug_lvl & 16) { // Sanity checking\r
   }\r
+  if (debug_lvl & 64) {\r
+    if (from == 0) { // Constructor\r
+      cout << IdSrc << endl;\r
+      cout << IdHdr << endl;\r
+    }\r
+  }\r
 }\r
 \r
index 6e06b10fe86e52010fd92d565b0e44067b935e10..2dc11a08e6508d1623fc093245484a0a2c31cda5 100644 (file)
@@ -326,7 +326,7 @@ eParam FGState::GetParameterIndex(string val_string)
 
 void FGState::SetParameter(eParam val_idx, double val)
 {
-  int i;
+  unsigned i;
 
   switch(val_idx) {
   case FG_ELEVATOR_POS:
@@ -888,5 +888,12 @@ void FGState::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
+
index 0c564a1c759f365bd82b475931bd0599c1ad75f6..103e7e0f0b594a68c329a0c6b27c790fa9799f9e 100644 (file)
@@ -266,6 +266,13 @@ void FGTable::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
 
+
index 5ed9699091a64ee668fba2ca77b62621c2045763..55b7d09ecdc54804551063a2389f16e61715ca82 100644 (file)
@@ -151,5 +151,11 @@ void FGTank::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index ebe861803a9456697d87a0984edccf020be3e209..1a574a6a5f86233b2d59109c4d05092faa7c6523 100644 (file)
@@ -98,5 +98,11 @@ void FGThruster::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index d191b8c74371469772d2a628c6399da629999da0..fe6714dfe97dd24cef98762f6eedd3d00865fc60 100644 (file)
@@ -212,4 +212,11 @@ void FGTranslation::Debug(int from)
     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 a4939638007e1b6c9ba52bf1acec1e32eae67d31..faac818d251160114f000a7ce3fad8d2e0998b07 100644 (file)
@@ -88,11 +88,11 @@ public:
   ~FGTranslation();
 
   inline FGColumnVector3& GetUVW   (void)    { return vUVW; }
-  inline double            GetUVW   (int idx) { return vUVW(idx); }
+  inline double           GetUVW   (int idx) { return vUVW(idx); }
   inline FGColumnVector3& GetUVWdot(void)    { return vUVWdot; }
-  inline double            GetUVWdot(int idx) { return vUVWdot(idx); }
+  inline double           GetUVWdot(int idx) { return vUVWdot(idx); }
   inline FGColumnVector3& GetvAeroUVW (void)    { return vAeroUVW; }
-  inline double            GetvAeroUVW (int idx) { return vAeroUVW(idx); }
+  inline double           GetvAeroUVW (int idx) { return vAeroUVW(idx); }
 
   inline double Getalpha(void) { return alpha; }
   inline double Getbeta (void) { return beta; }
index f478ab6df125fe7cbed152250ca66409804db67c..1e36a1abde87e81232b7f14c0fb2c53bb16d5436 100644 (file)
@@ -115,15 +115,17 @@ FGTrim::FGTrim(FGFDMExec *FDMExec,FGInitialCondition *FGIC, TrimMode tt ) {
     TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tRdot,tRudder ));
     break;
   case tTurn:
-    TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tNlf,tAlpha ));
+    TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tWdot,tAlpha ));
     TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tUdot,tThrottle ));
     TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tQdot,tPitchTrim ));
-    TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tVdot,tBeta ));
-    TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tAileron ));
-    TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tRdot,tRudder ));
+    //TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tVdot,tBeta ));
+    //TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tPdot,tAileron ));
+    //TrimAxes.push_back(new FGTrimAxis(fdmex,fgic,tRdot,tRudder ));
     break;
-  
-  }
+  case tCustom:
+  case tNone:
+    break;
+}
   //cout << "TrimAxes.size(): " << TrimAxes.size() << endl;
   sub_iterations=new double[TrimAxes.size()];
   successful=new double[TrimAxes.size()];
@@ -312,14 +314,14 @@ bool FGTrim::DoTrim(void) {
     cout << "nlf done" << endl;
   } else if (mode == tTurn) {
     setupTurn();
-    TrimAxes[0]->SetStateTarget(targetNlf);
+    //TrimAxes[0]->SetStateTarget(targetNlf);
   }  
   
   do {
     axis_count=0;
     for(current_axis=0;current_axis<TrimAxes.size();current_axis++) {
       setDebug();
-      
+      updateRates();
       Nsub=0;
       if(!solution[current_axis]) {
         if(checkLimits()) { 
@@ -595,30 +597,33 @@ void FGTrim::setupPullup() {
        << fgic->GetVtrueFpsIC() << endl;
   q=g*(targetNlf-cgamma)/fgic->GetVtrueFpsIC();
   cout << targetNlf << ", " << q << endl;
-  vPQR.InitMatrix();
-  vPQR(2)=q;
-  cout << vPQR << endl;
-  fdmex->GetRotation()->SetPQR(vPQR);
+  fdmex->GetRotation()->SetPQR(0,q,0);
   cout << "setPitchRateInPullup() complete" << endl;
   
 }  
   
 void FGTrim::setupTurn(void){
-  FGColumnVector3 vPQR;
-  float g,q,r,phi, psidot;
+  double g,phi;
   phi = fgic->GetRollAngleRadIC();
   if( fabs(phi) > 0.01 && fabs(phi) < 1.56 ) {
     targetNlf = 1 / cos(phi);
     g = fdmex->GetInertial()->gravity(); 
     psidot = g*tan(phi) / fgic->GetVtrueFpsIC();
-    q = psidot*sin(phi);
-    r = psidot*cos(phi);
-    vPQR(1)=0;vPQR(2)=q;vPQR(3)=r;
-    fdmex->GetRotation()->SetPQR(vPQR);
-    cout << targetNlf << ", " << vPQR*57.29577 << endl;
+    cout << targetNlf << ", " << psidot << endl;
   }  
 }  
 
+void FGTrim::updateRates(void){
+  if(mode == tTurn) {
+    double p,q,r,theta,phi;
+    theta=fgic->GetPitchAngleRadIC();
+    phi=fgic->GetRollAngleRadIC();
+    p=-psidot*sin(theta);
+    q=psidot*cos(theta)*sin(phi);
+    r=psidot*cos(theta)*cos(phi);
+    fdmex->GetRotation()->SetPQR(p,q,r);
+  }
+}  
 
 void FGTrim::setDebug(void) {
   if(debug_axis == tAll ||
index ec53d57a67ebe81a304f6454bcd516d5395150b7..0e6019efc0dabefd9bd7150ce1c27c756248f8a3 100644 (file)
@@ -168,6 +168,8 @@ private:
   double xlo,xhi,alo,ahi;
   double targetNlf;
   int debug_axis;
+  
+  double psidot,thetadot;
 
   FGFDMExec* fdmex;
   FGInitialCondition* fgic;
@@ -188,6 +190,8 @@ private:
   void setupPullup(void);
   void setupTurn(void);
   
+  void updateRates(void);
+
   void setDebug(void);
 
 public:
index 2fe3213f168c2aee9fa0ae01502f7e495472627e..f8417f8c57a22f6890c61ce26d7ad183cb1e0ff1 100644 (file)
@@ -72,6 +72,7 @@ FGTrimAxis::FGTrimAxis(FGFDMExec* fdex, FGInitialCondition* ic, State st,
     case tRdot: tolerance = DEFAULT_TOLERANCE / 10; break;
     case tHmgt: tolerance = 0.01; break;
     case  tNlf: state_target=1.0; tolerance = 1E-5; break;
+    case tAll: break;
   }  
   
   solver_eps=tolerance;
@@ -153,14 +154,15 @@ FGTrimAxis::~FGTrimAxis(void)
 
 void FGTrimAxis::getState(void) {
   switch(state) {
-  case tUdot: state_value=fdmex->GetTranslation()->GetUVWdot()(1)-state_target; break;
-  case tVdot: state_value=fdmex->GetTranslation()->GetUVWdot()(2)-state_target; break;
-  case tWdot: state_value=fdmex->GetTranslation()->GetUVWdot()(3)-state_target; break;
+  case tUdot: state_value=fdmex->GetTranslation()->GetUVWdot(1)-state_target; break;
+  case tVdot: state_value=fdmex->GetTranslation()->GetUVWdot(2)-state_target; break;
+  case tWdot: state_value=fdmex->GetTranslation()->GetUVWdot(3)-state_target; break;
   case tQdot: state_value=fdmex->GetRotation()->GetPQRdot(2)-state_target;break;
   case tPdot: state_value=fdmex->GetRotation()->GetPQRdot(1)-state_target; break;
   case tRdot: state_value=fdmex->GetRotation()->GetPQRdot(3)-state_target; break;
   case tHmgt: state_value=computeHmgt()-state_target; break;
   case tNlf:  state_value=fdmex->GetAircraft()->GetNlf()-state_target; break;
+  case tAll: break;
   }
 }
 
@@ -450,9 +452,9 @@ double FGTrimAxis::GetAvgStability( void ) {
 
 void FGTrimAxis::Debug(int from)
 {
-  if (debug_lvl <= 0) return;
 
-  if (debug_lvl & 1) { // Standard console startup message output
+  if (debug_lvl <= 0) return;
+  if (debug_lvl & 1 ) { // Standard console startup message output
     if (from == 0) { // Constructor
 
     }
@@ -467,5 +469,12 @@ void FGTrimAxis::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
+
index 3812fdc7f6c66b69c5a18114ffcdc786e9315861..8d6edf2cd01ff822e4b7d50939395688d1e2caaf 100644 (file)
@@ -106,5 +106,11 @@ void FGTurboJet::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 1179cbfafe51d47cd9579abf1c137f47e375a90a..fdbdf17088a0e6950ab318c91da15dfb7c2fb428 100644 (file)
@@ -105,5 +105,11 @@ void FGTurboProp::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index ce414d2741a0ab531813548e4fa97274c748aad8..ee4efb8b7387d136c59b5ea18bfe1839fec73449 100644 (file)
@@ -104,5 +104,11 @@ void FGTurboShaft::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 7e275a8e404405038c7961d2585b8adc09307d24..5ec59baab8a72d98b15965e4ce5db36dce06befa 100644 (file)
@@ -118,5 +118,11 @@ void FGUtility::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 457ddcfcf48cb9f33eb14cca2a4c49979bc6f08f..01f14a93082888a163cbf76ab6bac83dbbcea32e 100644 (file)
@@ -87,10 +87,11 @@ FGfdmSocket::FGfdmSocket(string address, int port)
       cout << "Could not create socket for FDM, error = " << errno << endl;
     }
   }
-
-  if (debug_lvl & 2) cout << "Instantiated: FGfdmSocket" << endl;
+  Debug(0);
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 FGfdmSocket::~FGfdmSocket()
 {
   #ifndef macintosh
@@ -100,14 +101,19 @@ FGfdmSocket::~FGfdmSocket()
   #ifdef __BORLANDC__
     WSACleanup();
   #endif
+  Debug(1);
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGfdmSocket::Clear(void)
 {
   buffer = "";
   size = 0;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGfdmSocket::Append(const char* item)
 {
   if (size == 0) buffer += string(item);
@@ -115,28 +121,34 @@ void FGfdmSocket::Append(const char* item)
   size++;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGfdmSocket::Append(double item)
 {
   char s[25];
 
-  sprintf(s,"%12.7f\0",item);
+  sprintf(s,"%12.7f",item);
 
   if (size == 0) buffer += string(s);
   else buffer += string(",") + string(s);
   size++;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGfdmSocket::Append(long item)
 {
   char s[25];
 
-  sprintf(s,"%12d\0",item);
+  sprintf(s,"%12d",item);
 
   if (size == 0) buffer += string(s);
   else buffer += string(",") + string(s);
   size++;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 void FGfdmSocket::Send(void)
 {
   buffer += string("\n");
@@ -146,3 +158,48 @@ void FGfdmSocket::Send(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 FGfdmSocket::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: FGfdmSocket" << endl;
+    if (from == 1) cout << "Destroyed:    FGfdmSocket" << 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 1aa09bda3b6862ea7b5880fd71d81471ca49ba6d..0a405f32bd8f6502fd04aadcbeecfbd0b2a687d2 100644 (file)
@@ -107,7 +107,7 @@ private:
   struct sockaddr_in scktName;
   struct hostent *host;
   string buffer;
-  void Debug(int from) {}
+  void Debug(int from);
 };
 
 #endif
index 8d3db58bcdf61d784ffdb72c3041e5d16882f1a2..e79d96fc78c212208482d3a64cc857af6f641831 100644 (file)
@@ -50,6 +50,7 @@ INCLUDES
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
 #include "FGConfigFile.h"
+#include "FGScript.h"
 
 #ifdef FGFS
 #include <simgear/compiler.h>
@@ -97,42 +98,35 @@ IMPLEMENTATION
 int main(int argc, char** argv)
 {
   FGFDMExec* FDMExec;
-  float cmd = 0.0;
   bool result = false;
-  bool scripted = false;
+  bool Scripted = false;
+  FGScript* Script;
 
-  if (argc == 2) {
-    FGConfigFile testFile(argv[1]);
-
-    if (!testFile.IsOpen()) {
-      cout << "Script file not opened" << endl;
-      exit(-1); 
-    }
-
-    testFile.GetNextConfigLine();
-    if (testFile.GetValue("runscript").length() <= 0) {
-      cout << "File: " << argv[1] << " is not a script file" << endl;
-      exit(-1); 
-    }
-    scripted = true;
-  } else if (argc != 3) {
-    cout << endl
+  if (argc != 3 && argc != 2) {
+    cerr << endl
          << "  You must enter the name of a registered aircraft and reset point:"
          << endl << endl << "  FDM <aircraft name> <reset file>" << endl;
-    cout << endl << "  Alternatively, you may specify only the name of a script file:"
+    cerr << endl << "  Alternatively, you may specify only the name of a script file:"
          << endl << endl << "  FDM <script file>" << endl << endl;
     exit(0);
   }
 
   FDMExec = new FGFDMExec();
 
-  if (scripted) { // form jsbsim <scriptfile>
-    result = FDMExec->LoadScript(argv[1]);
+  if (argc == 2) { // SCRIPTED CASE
+
+    Script = new FGScript(FDMExec);
+    result = Script->LoadScript(argv[1]);
+
     if (!result) {
       cerr << "Script file " << argv[1] << " was not successfully loaded" << endl;
       exit(-1);
     }
+
+    Scripted = true;
+
   } else {        // form jsbsim <acname> <resetfile>
+
     if ( ! FDMExec->LoadModel("aircraft", "engine", string(argv[1]))) {
        cerr << "  JSBSim could not be started" << endl << endl;
       exit(-1);
@@ -150,7 +144,8 @@ int main(int argc, char** argv)
 //
 
   FGJSBBase::Message* msg;
-  while (FDMExec->Run()) {
+  result = FDMExec->Run();
+  while (result) {
     while (FDMExec->ReadMessage()) {
       msg = FDMExec->ProcessMessage();
       switch (msg->type) {
@@ -171,6 +166,12 @@ int main(int argc, char** argv)
              break;
       }
     }
+
+    if (Scripted) {
+      if (!Script->RunScript()) break;
+    }
+
+    result = FDMExec->Run();
   }
 
   delete FDMExec;
index 1ffeeebbc46dea0eb5d6f4f8ce43deb81edea097..2f2283ef6fc318b2af4c48270cddaecd31c4e6d1 100644 (file)
@@ -124,5 +124,11 @@ void FGDeadBand::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index ec7a596b26b2d98acb4f6a811da8411ffccc1b93..eb578e6823a1bf128c36bf6fdae8403fec75c3c2 100644 (file)
@@ -128,4 +128,11 @@ void FGFCSComponent::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
+
index d95c8c30a70ec512700645bbdcf509f168476421..f1b916196e3137114f4250b9ccfdbfdd6ca83a8b 100644 (file)
@@ -171,6 +171,8 @@ bool FGFilter::Run(void)
       case eIntegrator:
         Output = Input * ca + PreviousInput1 * ca + PreviousOutput1;
         break;
+      case eUnknown:
+        break;
     }
 
   }
@@ -231,5 +233,11 @@ void FGFilter::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 0ca990c9c1058b36ad9b8d537d625ed2b63a0811..89324b59084825b4dd1e0e2682290b147d94e3db 100644 (file)
@@ -187,5 +187,11 @@ void FGGain::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 27aadf39233245754230749324d9964a973683b8..cc9bb73404abf6557b52e914e1664d5283eaa812 100644 (file)
@@ -110,5 +110,11 @@ void FGGradient::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index cea8cb313e9a6464242179c13bb2d7afe2cdac7e..963b135746881957c3f32bd1a815d675b712819e 100644 (file)
@@ -94,7 +94,7 @@ FGKinemat::FGKinemat(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
 
 FGKinemat::~FGKinemat()
 {
-  if (debug_lvl & 2) cout << "Destroyed:    FGKinemat" << endl;
+  Debug(1);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -207,5 +207,11 @@ void FGKinemat::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index af1bf02e55faf3baa8f37d997177db8a082d64d9..3b9de88469027923d9e485cc5157441e55abf4e1 100644 (file)
@@ -177,5 +177,11 @@ void FGSummer::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
 
index 0d0a93ace1431f380ffb6e4a8584c6517d68532c..ca0eb0c802d3477996e7b1f1a629d817c16169a0 100644 (file)
@@ -110,5 +110,11 @@ void FGSwitch::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }