#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)
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;
*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 )
{
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGDeadBand::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_DEADBAND "$Header"
+#define ID_DEADBAND "$Id$"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
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);
};
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
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)
{
return true;
}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFCSComponent::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_FCSCOMPONENT "$Header"
+#define ID_FCSCOMPONENT "$Id$"
using std::string;
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;
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"
#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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
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) {
*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;
PreviousInput2 = PreviousInput1;
PreviousInput1 = Input;
+ if (IsOutput) SetOutput();
+
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFilter::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGFilter.h
- Author:
- Date started:
+ Author: Jon S. Berndt
+ Date started: 4/2000
------------- Copyright (C) -------------
HISTORY
--------------------------------------------------------------------------------
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SENTRY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#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>
+
+ <COMPONENT NAME="Elevator Filter" TYPE="LAG_FILTER">
+ ID 16
+ INPUT 15
+ C1 600
+ OUTPUT FG_ELEVATOR_POS
+ </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;
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
#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;
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;
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();
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGFlaps::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGFlap.h
#ifdef FGFS
# include <simgear/compiler.h>
-# ifdef SG_HAVE_STD_INCLUDES
+# ifdef FG_HAVE_STD_INCLUDES
# include <vector>
# else
# include <vector.h>
DEFINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_FLAPS "$Header"
+#define ID_FLAPS "$Id$"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
public:
FGFlaps(FGFCS* fcs, FGConfigFile* AC_cfg);
- ~FGFlaps ( ) { } //Destructor
-
-
-
+ ~FGFlaps();
bool Run (void );
+
+private:
+ void Debug(void);
};
#endif
#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)
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;
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;
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGGain::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGGain.h
#ifdef FGFS
# include <simgear/compiler.h>
-# ifdef SG_HAVE_STD_INCLUDES
+# ifdef FG_HAVE_STD_INCLUDES
# include <vector>
# else
# include <vector.h>
DEFINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_GAIN "$Header"
+#define ID_GAIN "$Id$"
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;
float Min, Max;
eParam ScheduledBy;
-public:
- FGGain(FGFCS* fcs, FGConfigFile* AC_cfg);
- ~FGGain ( ) { } //Destructor
-
- bool Run (void);
+ void Debug(void);
};
#endif
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 )
{
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGGradient::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGGradient.h
DEFINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_GRADIENT "$Header"
+#define ID_GRADIENT "$Id$"
class FGFCS;
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
#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)
{
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") {
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 )
{
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGSummer::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGSummer.h
#ifdef FGFS
# include <simgear/compiler.h>
-# ifdef SG_HAVE_STD_INCLUDES
+# ifdef FG_HAVE_STD_INCLUDES
# include <vector>
# else
# include <vector.h>
DEFINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_SUMMER "$Header"
+#define ID_SUMMER "$Id$"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Module: FGSwitch.cpp
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 )
{
return true;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGSwitch::Debug(void)
+{
+ //TODO: Add your source code here
+}
+
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Header: FGSwitch.h
DEFINES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_SWITCH "$Header"
+#define ID_SWITCH "$Id$"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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