1
0
Fork 0

Updated from JSBSim cvs.

This commit is contained in:
curt 2001-04-02 02:27:45 +00:00
parent 626969d0cc
commit 7c81992a2d
16 changed files with 344 additions and 164 deletions

View 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;
}
// *****************************************************************************
// Function: Run
// Purpose:
// Parameters: void
// Comments:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGDeadBand::~FGDeadBand()
{
if (debug_lvl & 2) cout << "Destroyed: FGDeadBand" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGDeadBand::Run(void )
{
@ -85,3 +88,10 @@ bool FGDeadBand::Run(void )
return true;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGDeadBand::Debug(void)
{
//TODO: Add your source code here
}

View 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);
};
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View 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
}

View 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"

View 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;
}
// *****************************************************************************
// Function: Run
// Purpose:
// Parameters: void
// Comments:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGFilter::~FGFilter()
{
if (debug_lvl & 2) cout << "Destroyed: FGFilter" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
}

View file

@ -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:
<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

View 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
}

View 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

View 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;
}
// *****************************************************************************
// Function: Run
// Purpose:
// Parameters: void
// Comments:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGGain::Run(void )
FGGain::~FGGain()
{
if (debug_lvl & 2) cout << "Destroyed: FGGain" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
}

View 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

View 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
}

View 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

View 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
}

View 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

View 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;
}
// *****************************************************************************
// Function: Run
// Purpose:
// Parameters: void
// Comments:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGSwitch::~FGSwitch()
{
if (debug_lvl & 2) cout << "Destroyed: FGSwitch" << endl;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGSwitch::Run(void )
{
@ -67,3 +74,10 @@ bool FGSwitch::Run(void )
return true;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGSwitch::Debug(void)
{
//TODO: Add your source code here
}

View 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