From: curt Date: Mon, 2 Apr 2001 02:27:45 +0000 (+0000) Subject: Updated from JSBSim cvs. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7c81992a2dfd2d33ce910404bd75471f46d9c2da;p=flightgear.git Updated from JSBSim cvs. --- diff --git a/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp b/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp index 2130f9a70..da45f2266 100644 --- a/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp +++ b/src/FDM/JSBSim/filtersjb/FGDeadBand.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGDeadBand.h b/src/FDM/JSBSim/filtersjb/FGDeadBand.h index 3f3498d1d..9f91dfe0e 100644 --- a/src/FDM/JSBSim/filtersjb/FGDeadBand.h +++ b/src/FDM/JSBSim/filtersjb/FGDeadBand.h @@ -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); }; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp b/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp index 2eba3c579..6e94d530e 100644 --- a/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp +++ b/src/FDM/JSBSim/filtersjb/FGFCSComponent.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGFCSComponent.h b/src/FDM/JSBSim/filtersjb/FGFCSComponent.h index fb65abab1..1cece8d45 100644 --- a/src/FDM/JSBSim/filtersjb/FGFCSComponent.h +++ b/src/FDM/JSBSim/filtersjb/FGFCSComponent.h @@ -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" diff --git a/src/FDM/JSBSim/filtersjb/FGFilter.cpp b/src/FDM/JSBSim/filtersjb/FGFilter.cpp index 9bddef588..fe57b1b43 100644 --- a/src/FDM/JSBSim/filtersjb/FGFilter.cpp +++ b/src/FDM/JSBSim/filtersjb/FGFilter.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGFilter.h b/src/FDM/JSBSim/filtersjb/FGFilter.h index 9fdf4bd2c..12eb347b7 100644 --- a/src/FDM/JSBSim/filtersjb/FGFilter.h +++ b/src/FDM/JSBSim/filtersjb/FGFilter.h @@ -1,8 +1,8 @@ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGFilter.h - Author: - Date started: + Author: Jon S. Berndt + Date started: 4/2000 ------------- Copyright (C) ------------- @@ -26,10 +26,6 @@ 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: +
  1. Lag
  2. +
  3. Lead-Lag
  4. +
  5. Washout
  6. +
  7. Integrator
+ The filter is specified in the config file like this: +
+    
+    <COMPONENT NAME="Elevator Filter" TYPE="LAG_FILTER">
+      ID           16
+      INPUT        15
+      C1           600
+      OUTPUT       FG_ELEVATOR_POS
+    </COMPONENT>
+    
+ @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 diff --git a/src/FDM/JSBSim/filtersjb/FGFlaps.cpp b/src/FDM/JSBSim/filtersjb/FGFlaps.cpp index ee714527a..0ac76d357 100644 --- a/src/FDM/JSBSim/filtersjb/FGFlaps.cpp +++ b/src/FDM/JSBSim/filtersjb/FGFlaps.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGFlaps.h b/src/FDM/JSBSim/filtersjb/FGFlaps.h index ff71071d7..4b2643752 100644 --- a/src/FDM/JSBSim/filtersjb/FGFlaps.h +++ b/src/FDM/JSBSim/filtersjb/FGFlaps.h @@ -1,4 +1,3 @@ - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGFlap.h @@ -44,7 +43,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -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 diff --git a/src/FDM/JSBSim/filtersjb/FGGain.cpp b/src/FDM/JSBSim/filtersjb/FGGain.cpp index 52f8d66a1..ada0b3db6 100644 --- a/src/FDM/JSBSim/filtersjb/FGGain.cpp +++ b/src/FDM/JSBSim/filtersjb/FGGain.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGGain.h b/src/FDM/JSBSim/filtersjb/FGGain.h index d8efd9601..44f66e633 100644 --- a/src/FDM/JSBSim/filtersjb/FGGain.h +++ b/src/FDM/JSBSim/filtersjb/FGGain.h @@ -1,4 +1,3 @@ - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGGain.h @@ -44,7 +43,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -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 diff --git a/src/FDM/JSBSim/filtersjb/FGGradient.cpp b/src/FDM/JSBSim/filtersjb/FGGradient.cpp index a1f09c022..fd7cdbbfd 100644 --- a/src/FDM/JSBSim/filtersjb/FGGradient.cpp +++ b/src/FDM/JSBSim/filtersjb/FGGradient.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGGradient.h b/src/FDM/JSBSim/filtersjb/FGGradient.h index 814944bd1..66d335d50 100644 --- a/src/FDM/JSBSim/filtersjb/FGGradient.h +++ b/src/FDM/JSBSim/filtersjb/FGGradient.h @@ -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 diff --git a/src/FDM/JSBSim/filtersjb/FGSummer.cpp b/src/FDM/JSBSim/filtersjb/FGSummer.cpp index 6abed084c..b73af9af8 100644 --- a/src/FDM/JSBSim/filtersjb/FGSummer.cpp +++ b/src/FDM/JSBSim/filtersjb/FGSummer.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGSummer.h b/src/FDM/JSBSim/filtersjb/FGSummer.h index 2ae397b34..1a91e4084 100644 --- a/src/FDM/JSBSim/filtersjb/FGSummer.h +++ b/src/FDM/JSBSim/filtersjb/FGSummer.h @@ -1,4 +1,3 @@ - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Header: FGSummer.h @@ -44,7 +43,7 @@ INCLUDES #ifdef FGFS # include -# ifdef SG_HAVE_STD_INCLUDES +# ifdef FG_HAVE_STD_INCLUDES # include # else # include @@ -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 InputIndices; vector InputTypes; bool clip; float clipmin,clipmax; - - -public: - FGSummer(FGFCS* fcs, FGConfigFile* AC_cfg); - ~FGSummer ( ) { } //Destructor - - bool Run (void ); + void Debug(void); }; #endif diff --git a/src/FDM/JSBSim/filtersjb/FGSwitch.cpp b/src/FDM/JSBSim/filtersjb/FGSwitch.cpp index db856cdf7..2b29a72aa 100644 --- a/src/FDM/JSBSim/filtersjb/FGSwitch.cpp +++ b/src/FDM/JSBSim/filtersjb/FGSwitch.cpp @@ -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 +} + diff --git a/src/FDM/JSBSim/filtersjb/FGSwitch.h b/src/FDM/JSBSim/filtersjb/FGSwitch.h index 04518f126..9d5997b31 100644 --- a/src/FDM/JSBSim/filtersjb/FGSwitch.h +++ b/src/FDM/JSBSim/filtersjb/FGSwitch.h @@ -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