]> git.mxchange.org Git - flightgear.git/commitdiff
Updated from JSBSim cvs.
authorcurt <curt>
Mon, 2 Apr 2001 02:27:45 +0000 (02:27 +0000)
committercurt <curt>
Mon, 2 Apr 2001 02:27:45 +0000 (02:27 +0000)
16 files changed:
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/FGFlaps.cpp
src/FDM/JSBSim/filtersjb/FGFlaps.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/FGSummer.cpp
src/FDM/JSBSim/filtersjb/FGSummer.h
src/FDM/JSBSim/filtersjb/FGSwitch.cpp
src/FDM/JSBSim/filtersjb/FGSwitch.h

index 2130f9a705d19e5c74313149283c8d86da67fcf4..da45f22669606c255049ef2c7e8127db6b2c1b3d 100644 (file)
@@ -39,18 +39,16 @@ INCLUDES
 
 #include "FGDeadBand.h"
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_DEADBAND;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:
-//  Parameters: void
-//  Comments:
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGDeadBand::FGDeadBand(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                            AC_cfg(AC_cfg)
@@ -60,7 +58,7 @@ FGDeadBand::FGDeadBand(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   AC_cfg->GetNextConfigLine();
   string token;
 
-  while ((token = AC_cfg->GetValue()) != "/COMPONENT") {
+  while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
     if (token == "ID") {
       *AC_cfg >> ID;
@@ -70,13 +68,18 @@ FGDeadBand::FGDeadBand(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
       *AC_cfg >> token;
     }
   }
+
+  if (debug_lvl & 2) cout << "Instantiated: FGDeadBand" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGDeadBand::~FGDeadBand()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGDeadBand" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:
-//  Parameters: void
-//  Comments:
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGDeadBand::Run(void )
 {
@@ -85,3 +88,10 @@ bool FGDeadBand::Run(void )
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGDeadBand::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 3f3498d1d1301a5c1560e8607d2efc181593ddc5..9f91dfe0e479dd1db0aeba720f280da9301b9776 100644 (file)
@@ -44,7 +44,7 @@ INCLUDES
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_DEADBAND "$Header"
+#define ID_DEADBAND "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -72,13 +72,16 @@ CLASS DECLARATION
 
 class FGDeadBand  : public FGFCSComponent         
 {
-  FGConfigFile* AC_cfg;
-  
 public:
   FGDeadBand(FGFCS* fcs, FGConfigFile* AC_cfg);
-  ~ FGDeadBand ( ) { }       //Destructor
+  ~FGDeadBand();
+
+  bool Run(void);
 
-  bool Run (void )  ;
+private:
+  FGConfigFile* AC_cfg;
+  
+  void Debug(void);
 };
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 2eba3c57980f5e53c0c6b64fd9b6e1be19465982..6e94d530ee80b16482d9b60b58d6852fe6d09162 100644 (file)
@@ -37,11 +37,13 @@ COMMENTS, REFERENCES,  and NOTES
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include "FGFCSComponent.h"                                    
+#include "FGFCSComponent.h"
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FCSCOMPONENT;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -56,14 +58,25 @@ FGFCSComponent::FGFCSComponent(FGFCS* _fcs) : fcs(_fcs)
   sOutputIdx = "";
   OutputIdx  = FG_UNDEF;
   IsOutput   = false;
+
+  if (debug_lvl & 2) cout << "Instantiated: FGFCSComponent" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGFCSComponent::~FGFCSComponent()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGFCSComponent" << endl;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 void FGFCSComponent::SetOutput(void)
 {
   fcs->GetState()->SetParameter(OutputIdx, Output);
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGFCSComponent::Run(void)
 {
@@ -81,3 +94,11 @@ bool FGFCSComponent::Run(void)
 
   return true;
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFCSComponent::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index fb65abab13722e07c03b012be7b6d701281ae0d6..1cece8d456ed6df1753245720fc62130f7390156 100644 (file)
@@ -48,7 +48,7 @@ INCLUDES
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_FCSCOMPONENT "$Header"
+#define ID_FCSCOMPONENT "$Id$"
 
 using std::string;
 
@@ -91,14 +91,23 @@ CLASS DECLARATION
 
 class FGFCSComponent
 {
-private:
+public:
+  /// Constructor
+  FGFCSComponent(FGFCS*);
+  /// Destructor
+  virtual ~FGFCSComponent();
+
+  virtual bool Run(void);
+  virtual void SetOutput(void);
+  inline float GetOutput (void) {return Output;}
+  inline string GetName(void) {return Name;}
 
 protected:
+   /// Pilot/Aircraft, FCS, Autopilot inputs
+  enum eInputType {itPilotAC, itFCS, itAP} InputType;
   FGFCS* fcs;
   string Type;
   string Name;
-   /// Pilot/Aircraft, FCS, Autopilot inputs
-  enum eInputType {itPilotAC, itFCS, itAP} InputType;
   int ID;
   eParam InputIdx;
   float Input;
@@ -106,17 +115,7 @@ protected:
   eParam OutputIdx;
   float Output;
   bool IsOutput;
-
-public:
-  /// Constructor
-  FGFCSComponent(FGFCS*);
-  /// Destructor
-  virtual ~FGFCSComponent ( ) { }       //Destructor
-
-  virtual bool Run (void);
-  virtual void SetOutput(void);
-  inline float GetOutput (void) {return Output;}
-  inline string GetName(void) {return Name;}
+  void Debug(void);
 };
 
 #include "../FGFCS.h"
index 9bddef58872c0cf10ae666e497b70e2447ac8b91..fe57b1b43186be58106c4098baab332f7bee3e60 100644 (file)
@@ -39,9 +39,11 @@ INCLUDES
 
 #include "FGFilter.h"
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FILTER;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -50,25 +52,27 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                        AC_cfg(AC_cfg)
 {
   string token;
+  float denom;
 
   Type = AC_cfg->GetValue("TYPE");
   Name = AC_cfg->GetValue("NAME");
   AC_cfg->GetNextConfigLine();
+  dt = fcs->GetState()->Getdt();
 
   C1 = C2 = C3 = C4 = C5 = C6 = 0.0;
 
   if      (Type == "LAG_FILTER")          FilterType = eLag        ;
-  else if (Type == "RECT_LAG_FILTER")     FilterType = eRectLag    ;
   else if (Type == "LEAD_LAG_FILTER")     FilterType = eLeadLag    ;
   else if (Type == "SECOND_ORDER_FILTER") FilterType = eOrder2     ;
   else if (Type == "WASHOUT_FILTER")      FilterType = eWashout    ;
   else if (Type == "INTEGRATOR")          FilterType = eIntegrator ;
   else                                    FilterType = eUnknown    ;
 
-  while ((token = AC_cfg->GetValue()) != "/COMPONENT") {
+  while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
     if (token == "ID") {
       *AC_cfg >> ID;
+      cout << "      ID: " << ID << endl;
     } else if (token == "INPUT") {
       token = AC_cfg->GetValue("INPUT");
       if (token.find("FG_") != token.npos) {
@@ -79,63 +83,100 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
         *AC_cfg >> InputIdx;
         InputType = itFCS;
       }
+      cout << "      INPUT: " << token << endl;
     } else if (token == "C1") {
       *AC_cfg >> C1;
+      cout << "      C1: " << C1 << endl;
     } else if (token == "C2") {
       *AC_cfg >> C2;
+      cout << "      C2: " << C2 << endl;
     } else if (token == "C3") {
       *AC_cfg >> C3;
+      cout << "      C3: " << C3 << endl;
     } else if (token == "C4") {
       *AC_cfg >> C4;
+      cout << "      C4: " << C4 << endl;
     } else if (token == "C5") {
       *AC_cfg >> C5;
+      cout << "      C5: " << C5 << endl;
     } else if (token == "C6") {
       *AC_cfg >> C6;
+      cout << "      C6: " << C6 << endl;
+    } else if (token == "OUTPUT") {
+      IsOutput = true;
+      *AC_cfg >> sOutputIdx;
+      OutputIdx = fcs->GetState()->GetParameterIndex(sOutputIdx);
+      cout << "      OUTPUT: " << sOutputIdx << endl;
     }
   }
 
+  Initialize = true;
+
   switch (FilterType) {
     case eLag:
-      ca = dt*C1 / (2.00 + dt*C1);
-      cb = (2.00 - dt*C1) / (2.00 + dt*C1);
-      break;
-    case eRectLag:
+      denom = 2.00 + dt*C1;
+      ca = dt*C1 / denom;
+      cb = (2.00 - dt*C1) / denom;
       break;
     case eLeadLag:
+      denom = 2.00*C3 + dt*C4;
+      ca = (2.00*C1 + dt*C2) / denom;
+      cb = (dt*C2 - 2.00*C1) / denom;
+      cc = (2.00*C3 - dt*C2) / denom;
       break;
     case eOrder2:
       break;
     case eWashout:
+      denom = 2.00 + dt*C1;
+      ca = 2.00 / denom;
+      cb = (2.00 - dt*C1) / denom;
       break;
     case eIntegrator:
+      ca = dt*C1 / 2.00;
       break;
   }
 
+  if (debug_lvl & 2) cout << "Instantiated: FGFilter" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGFilter::~FGFilter()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGFilter" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:
-//  Parameters: void
-//  Comments:
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGFilter::Run(void)
 {
   FGFCSComponent::Run(); // call the base class for initialization of Input
 
-  switch (FilterType) {
-    case eLag:
-      break;
-    case eRectLag:
-      break;
-    case eLeadLag:
-      break;
-    case eOrder2:
-      break;
-    case eWashout:
-      break;
-    case eIntegrator:
-      break;
+  if (Initialize) {
+
+    PreviousOutput1 = PreviousInput1 = Output = Input;
+    Initialize = false;
+
+  } else {
+
+    switch (FilterType) {
+      case eLag:
+        Output = Input * ca + PreviousInput1 * ca + PreviousOutput1 * cb;
+//        Output = Input * ca + PreviousOutput1 * cb;
+        break;
+      case eLeadLag:
+        Output = Input * ca + PreviousInput1 * cb + PreviousOutput1 * cc;
+        break;
+      case eOrder2:
+        break;
+      case eWashout:
+        Output = Input * ca - PreviousInput1 * ca + PreviousOutput1 * cb;
+        break;
+      case eIntegrator:
+        Output = Input * ca + PreviousInput1 * ca + PreviousOutput1;
+        break;
+    }
+
   }
 
   PreviousOutput2 = PreviousOutput1;
@@ -143,6 +184,15 @@ bool FGFilter::Run(void)
   PreviousInput2  = PreviousInput1;
   PreviousInput1  = Input;
 
+  if (IsOutput) SetOutput();
+
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFilter::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 9fdf4bd2c5edcf2449b6caf3cceefe376c358d76..12eb347b716074212692b5375cb76270ad01d851 100644 (file)
@@ -1,8 +1,8 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGFilter.h
- Author:       
- Date started: 
+ Author:       Jon S. Berndt
+ Date started: 4/2000
 
  ------------- Copyright (C)  -------------
 
 HISTORY
 --------------------------------------------------------------------------------
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -45,17 +41,63 @@ INCLUDES
 #include "../FGConfigFile.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DEFINES
+DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_FILTER "$Header"
+#define ID_FILTER "$Id$"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a filter for the flight control system.
+    Filters are modeled using the Tustin Substitution method. These types of
+    filters can currently be modeled:
+    <ol><li>Lag</li>
+    <li>Lead-Lag</li>
+    <li>Washout</li>
+    <li>Integrator</li></ol>
+    The filter is specified in the config file like this:
+    <pre>
+    
+    &ltCOMPONENT NAME="Elevator Filter" TYPE="LAG_FILTER">
+      ID           16
+      INPUT        15
+      C1           600
+      OUTPUT       FG_ELEVATOR_POS
+    &lt/COMPONENT>
+    </pre>
+    @author Jon S. Berndt
+    @version $Id$
+    */
+   
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGFilter  : public FGFCSComponent         
 {
+public:
+  FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg);
+  ~FGFilter();
+
+  bool Run (void);
+
+  /** When true, causes previous values to be set to current values. This
+      is particularly useful for first pass. */
+  bool Initialize;
+
+  enum {eLag, eLeadLag, eOrder2, eWashout, eIntegrator, eUnknown} FilterType;
+
+private:
   float dt;
   float ca;
   float cb;
@@ -72,15 +114,7 @@ class FGFilter  : public FGFCSComponent
   float PreviousOutput1;
   float PreviousOutput2;
   FGConfigFile* AC_cfg;
-
-protected:
-  enum {eLag, eRectLag, eLeadLag, eOrder2, eWashout, eIntegrator, eUnknown} FilterType; 
-
-public:
-  FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg);
-  ~FGFilter ( ) { }       //Destructor
-
-  bool Run (void);
+  void Debug(void);
 };
 
 #endif
index ee714527ac2a829f916d379f8accd6fe1bed1523..0ac76d357da68745f31ef825f6f6cb81673f3df9 100644 (file)
@@ -39,19 +39,15 @@ INCLUDES
 
 #include "FGFlaps.h"
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FLAPS;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-// *****************************************************************************
-//  Function:   Constructor
-//  Purpose:
-//  Parameters: void
-//  Comments:
-
 FGFlaps::FGFlaps(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
 AC_cfg(AC_cfg) {
   string token;
@@ -65,7 +61,7 @@ AC_cfg(AC_cfg) {
   Name = AC_cfg->GetValue("NAME");
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != "/COMPONENT") {
+  while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
     if (token == "ID") {
       *AC_cfg >> ID;
@@ -96,13 +92,18 @@ AC_cfg(AC_cfg) {
       OutputIdx = fcs->GetState()->GetParameterIndex(sOutputIdx);
     }
   }
+
+  if (debug_lvl & 2) cout << "Instantiated: FGFlaps" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:
-//  Parameters: void
-//  Comments:
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGFlaps::~FGFlaps()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGFlaps" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGFlaps::Run(void ) {
   float dt=fcs->GetState()->Getdt();
@@ -171,3 +172,10 @@ bool FGFlaps::Run(void ) {
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFlaps::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index ff71071d74831ae344079242ce5783056e251e7f..4b26437522d14912670cb5022cfa21875a78da81 100644 (file)
@@ -1,4 +1,3 @@
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  Header:       FGFlap.h
@@ -44,7 +43,7 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
-#  ifdef SG_HAVE_STD_INCLUDES
+#  ifdef FG_HAVE_STD_INCLUDES
 #    include <vector>
 #  else
 #    include <vector.h>
@@ -61,7 +60,7 @@ INCLUDES
 DEFINES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_FLAPS "$Header"
+#define ID_FLAPS "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
@@ -79,11 +78,11 @@ class FGFlaps  : public FGFCSComponent {
 
 public:
   FGFlaps(FGFCS* fcs, FGConfigFile* AC_cfg);
-  ~FGFlaps ( ) { }       //Destructor
-
-
-
+  ~FGFlaps();
   bool Run (void );
+  
+private:
+  void Debug(void);
 };
 
 #endif
index 52f8d66a1fdea7d173232aace40c21f2ae92ad9a..ada0b3db679d3cecb6d36364d0533c23c2a3bc26 100644 (file)
@@ -39,18 +39,15 @@ INCLUDES
 
 #include "FGGain.h"            
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GAIN;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-// *****************************************************************************
-//  Function:   Constructor
-//  Purpose:    Builds a Gain-type of FCS component.
-//  Parameters: void
-//  Comments:   Types are PURE_GAIN, SCHEDULED_GAIN, and AEROSURFACE_SCALE
 
 FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                    AC_cfg(AC_cfg)
@@ -68,7 +65,7 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   Name = AC_cfg->GetValue("NAME");
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != "/COMPONENT") {
+  while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
     if (token == "ID") {
       *AC_cfg >> ID;
@@ -116,15 +113,20 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
       Schedule.push_back(lookup);
     }
   }
+
+  if (debug_lvl & 2) cout << "Instantiated: FGGain" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGGain::~FGGain()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGGain" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:
-//  Parameters: void
-//  Comments:
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGGain::Run(void ) 
+bool FGGain::Run(void )
 {
   float SchedGain = 1.0;
 
@@ -169,3 +171,10 @@ bool FGGain::Run(void )
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGGain::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index d8efd9601582d8be43c203051fdbb446a572e75a..44f66e6338cd1a4dc7d4205505b846e3725c16b3 100644 (file)
@@ -1,4 +1,3 @@
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGGain.h
@@ -44,7 +43,7 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
-#  ifdef SG_HAVE_STD_INCLUDES
+#  ifdef FG_HAVE_STD_INCLUDES
 #    include <vector>
 #  else
 #    include <vector.h>
@@ -61,7 +60,7 @@ INCLUDES
 DEFINES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_GAIN "$Header"
+#define ID_GAIN "$Id$"
 
 class FGFCS;
 
@@ -69,8 +68,15 @@ class FGFCS;
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGGain  : public FGFCSComponent         
+class FGGain  : public FGFCSComponent
 {
+public:
+  FGGain(FGFCS* fcs, FGConfigFile* AC_cfg);
+  ~FGGain();
+
+  bool Run (void);
+
+private:
   FGConfigFile* AC_cfg;
   float Gain;
   float* lookup;
@@ -78,11 +84,7 @@ class FGGain  : public FGFCSComponent
   float Min, Max;
   eParam ScheduledBy;
 
-public:
-  FGGain(FGFCS* fcs, FGConfigFile* AC_cfg);
-  ~FGGain ( ) { }       //Destructor
-
-  bool Run (void);
+  void Debug(void);
 };
 
 #endif
index a1f09c022441c0167e5c6afe910ba70a6abd8f57..fd7cdbbfdb9c684bb2278ba76d1004aef83e7260 100644 (file)
@@ -37,28 +37,35 @@ COMMENTS, REFERENCES,  and NOTES
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include "FGGradient.h"                                
+#include "FGGradient.h"
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GRADIENT;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+
 FGGradient::FGGradient(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                            AC_cfg(AC_cfg)
 {
   Type = AC_cfg->GetValue("TYPE");
   Name = AC_cfg->GetValue("NAME");
-  
+
+  if (debug_lvl & 2) cout << "Instantiated: FGGradient" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:    
-//  Parameters: void 
-//  Comments:   
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGGradient::~FGGradient()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGGradient" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGGradient::Run(void )
 {
@@ -67,3 +74,10 @@ bool FGGradient::Run(void )
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGGradient::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 814944bd1a0e663d911ece5b0c43f9ec94d51db1..66d335d508b06f36a8b75147e972411b0b431541 100644 (file)
@@ -1,4 +1,3 @@
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGGradient.h
@@ -49,7 +48,7 @@ INCLUDES
 DEFINES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_GRADIENT "$Header"
+#define ID_GRADIENT "$Id$"
 
 class FGFCS;
 
@@ -59,13 +58,15 @@ CLASS DECLARATION
 
 class FGGradient  : public FGFCSComponent
 {
-  FGConfigFile* AC_cfg;
-
 public:
   FGGradient(FGFCS* fcs, FGConfigFile* AC_cfg);
- ~ FGGradient ( ) { }       //Destructor
+  ~FGGradient();
 
-  bool Run (void )  ;
+  bool Run (void);
+
+private:
+  FGConfigFile* AC_cfg;
+  void Debug(void);
 };
 
 #endif
index 6abed084c2c047052fa676e66357b750b1c55930..b73af9af8badf45ab1866d0a3dcac6e979208a78 100644 (file)
@@ -39,13 +39,16 @@ INCLUDES
 
 #include "FGSummer.h"            
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_SUMMER;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+
 FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                        AC_cfg(AC_cfg)
 {
@@ -60,7 +63,7 @@ FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
   Name = AC_cfg->GetValue("NAME");
   AC_cfg->GetNextConfigLine();
 
-  while ((token = AC_cfg->GetValue()) != "/COMPONENT") {
+  while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
     *AC_cfg >> token;
 
     if (token == "ID") {
@@ -99,13 +102,18 @@ FGSummer::FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
       OutputIdx = fcs->GetState()->GetParameterIndex(sOutputIdx);
     }
   }
+
+  if (debug_lvl & 2) cout << "Instantiated: FGSummer" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:
-//  Parameters: void
-//  Comments:
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGSummer::~FGSummer()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGSummer" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGSummer::Run(void )
 {
@@ -137,3 +145,10 @@ bool FGSummer::Run(void )
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGSummer::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 2ae397b341fe3249858db476243ac249a5f6a6fb..1a91e40840690fe37725699c6c0b92de35ef38dd 100644 (file)
@@ -1,4 +1,3 @@
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGSummer.h
@@ -44,7 +43,7 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
-#  ifdef SG_HAVE_STD_INCLUDES
+#  ifdef FG_HAVE_STD_INCLUDES
 #    include <vector>
 #  else
 #    include <vector.h>
@@ -61,7 +60,7 @@ INCLUDES
 DEFINES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_SUMMER "$Header"
+#define ID_SUMMER "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
@@ -69,18 +68,19 @@ CLASS DECLARATION
 
 class FGSummer  : public FGFCSComponent
 {
+public:
+  FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg);
+  ~FGSummer();
+
+  bool Run(void);
+
+private:
   FGConfigFile* AC_cfg;
   vector <eParam> InputIndices;
   vector <int> InputTypes;
   bool clip;
   float clipmin,clipmax;
-  
-
-public:
-  FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg);
-  ~FGSummer ( ) { }       //Destructor
-
-  bool Run (void );
+  void Debug(void);
 };
 
 #endif
index db856cdf7e6cb15fab349ec9ae3ba85734786133..2b29a72aa5b67edc89175e0aad98e0c5222382ac 100644 (file)
@@ -1,4 +1,3 @@
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Module:       FGSwitch.cpp
@@ -38,27 +37,35 @@ COMMENTS, REFERENCES,  and NOTES
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include "FGSwitch.h"                                  
+#include "FGSwitch.h"
 
-static const char *IdSrc = "$Header$";
+static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_SWITCH;
 
+extern short debug_lvl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+
 FGSwitch::FGSwitch(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
                                                        AC_cfg(AC_cfg)
 {
   Type = AC_cfg->GetValue("TYPE");
   Name = AC_cfg->GetValue("NAME");
+
+  if (debug_lvl & 2) cout << "Instantiated: FGSwitch" << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+FGSwitch::~FGSwitch()
+{
+  if (debug_lvl & 2) cout << "Destroyed:    FGSwitch" << endl;
 }
 
-// *****************************************************************************
-//  Function:   Run
-//  Purpose:    
-//  Parameters: void 
-//  Comments:   
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 bool FGSwitch::Run(void )
 {
@@ -67,3 +74,10 @@ bool FGSwitch::Run(void )
   return true;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGSwitch::Debug(void)
+{
+    //TODO: Add your source code here
+}
+
index 04518f126fee0ff8ab36cd20de4a7e555eda66e9..9d5997b3166e98df6e70f97f31fcf36c3a341d37 100644 (file)
@@ -1,4 +1,3 @@
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGSwitch.h
@@ -49,7 +48,7 @@ INCLUDES
 DEFINES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_SWITCH "$Header"
+#define ID_SWITCH "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
@@ -57,14 +56,16 @@ CLASS DECLARATION
 
 class FGSwitch  : public FGFCSComponent
 {
-  FGFCS* fcs;
-  FGConfigFile* AC_cfg;
-
 public:
   FGSwitch(FGFCS* fcs, FGConfigFile* AC_cfg);
- ~ FGSwitch ( ) { }       //Destructor
+  ~FGSwitch();
 
-  bool Run (void )  ;
+  bool Run(void);
+
+private:
+  void Debug(void);
+  FGFCS* fcs;
+  FGConfigFile* AC_cfg;
 };
 
 #endif