1
0
Fork 0
flightgear/src/FDM/JSBSim/FGCoefficient.h

131 lines
3.9 KiB
C
Raw Normal View History

1999-02-05 21:26:01 +00:00
/*******************************************************************************
Header: FGCoefficient.h
Author: Jon Berndt
Date started: 12/28/98
------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
Further information about the GNU General Public License can also be found on
the world wide web at http://www.gnu.org.
HISTORY
--------------------------------------------------------------------------------
12/28/98 JSB Created
********************************************************************************
1999-02-05 21:26:01 +00:00
SENTRY
*******************************************************************************/
#ifndef FGCOEFFICIENT_H
#define FGCOEFFICIENT_H
/*******************************************************************************
INCLUDES
*******************************************************************************/
#ifdef FGFS
2000-02-15 03:30:01 +00:00
# include <simgear/compiler.h>
#endif
1999-02-05 21:26:01 +00:00
2000-10-02 23:07:30 +00:00
#include <vector>
#include <string>
2000-04-24 23:49:06 +00:00
#include "FGConfigFile.h"
#include "FGDefs.h"
1999-02-05 21:26:01 +00:00
/*******************************************************************************
DEFINES
*******************************************************************************/
1999-05-08 03:19:08 +00:00
1999-02-05 21:26:01 +00:00
/*******************************************************************************
FORWARD DECLARATIONS
1999-02-05 21:26:01 +00:00
*******************************************************************************/
2000-10-02 23:07:30 +00:00
class FGFDMExec;
class FGState;
class FGAtmosphere;
class FGFCS;
class FGAircraft;
class FGTranslation;
class FGRotation;
class FGPosition;
class FGAuxiliary;
class FGOutput;
/*******************************************************************************
COMMENTS, REFERENCES, and NOTES
********************************************************************************
This class models the stability derivative coefficient lookup tables or
equations. Note that the coefficients need not be calculated each delta-t.
********************************************************************************
CLASS DECLARATION
*******************************************************************************/
2000-10-02 23:07:30 +00:00
using std::vector;
1999-02-05 21:26:01 +00:00
class FGCoefficient
{
2000-10-02 23:07:30 +00:00
typedef vector <eParam> MultVec;
enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
2000-04-24 23:49:06 +00:00
int numInstances;
string filename;
string description;
string name;
string method;
1999-02-05 21:26:01 +00:00
float StaticValue;
2000-10-02 23:07:30 +00:00
float **Table;
eParam LookupR, LookupC;
MultVec multipliers;
1999-02-05 21:26:01 +00:00
int rows, columns;
Type type;
float SD; // Actual stability derivative (or other coefficient) value
1999-02-05 21:26:01 +00:00
FGFDMExec* FDMExec;
FGState* State;
FGAtmosphere* Atmosphere;
FGFCS* FCS;
FGAircraft* Aircraft;
FGTranslation* Translation;
FGRotation* Rotation;
FGPosition* Position;
FGAuxiliary* Auxiliary;
FGOutput* Output;
2000-10-02 23:07:30 +00:00
bool DeAllocate(void);
bool Allocate(int, int);
public:
FGCoefficient(FGFDMExec*, FGConfigFile*);
~FGCoefficient(void);
float Value(float, float);
float Value(float);
float Value(void);
float TotalValue(void);
inline string Getname(void) {return name;}
inline float GetSD(void) {return SD;}
inline MultVec Getmultipliers(void) {return multipliers;}
void DumpSD(void);
1999-02-05 21:26:01 +00:00
};
/******************************************************************************/
#endif