#include <vector>
#include <string>
#include "FGConfigFile.h"
-#include "FGDefs.h"
+#include "FGTable.h"
+#include "FGJSBBase.h"
+#include "FGPropertyManager.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_COEFFICIENT "$Header"
+#define ID_COEFFICIENT "$Id$"
using std::vector;
is called and the coefficient value is calculated.
@author Jon S. Berndt
@version $Id$
- @see -
+ @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGCoefficient.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+ Header File </a>
+ @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGCoefficient.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+ Source File </a>
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-class FGCoefficient
+class FGCoefficient : public FGJSBBase
{
- typedef vector <eParam> MultVec;
+public:
+ FGCoefficient(FGFDMExec*);
+ virtual ~FGCoefficient();
+
+ virtual bool Load(FGConfigFile* AC_cfg);
+
+ typedef vector <FGPropertyManager*> MultVec;
+ virtual double TotalValue(void);
+ virtual inline double GetValue(void) const { return totalValue; }
+ virtual inline string Getname(void) const {return name;}
+ virtual inline double GetSD(void) const { return SD;}
+ inline MultVec Getmultipliers(void) {return multipliers;}
+ void DumpSD(void);
+
+ /** Outputs coefficient information.
+ Non-dimensionalizing parameter descriptions are output
+ for each aero coefficient defined.
+ @param multipliers the list of multipliers for this coefficient.*/
+ virtual void DisplayCoeffFactors(void);
+ virtual inline string GetCoefficientStrings(void) { return name; }
+ virtual string GetCoefficientValues(void);
+
+ inline void setBias(double b) { bias=b; }
+ inline void setGain(double g) { gain=g; };
+ inline double getBias(void) const { return bias; }
+ inline double getGain(void) const { return gain; }
+
+ virtual void bind(FGPropertyManager *parent);
+ virtual void unbind(void);
+
+protected:
+ FGFDMExec* FDMExec;
+
+
+private:
enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
int numInstances;
- string filename;
string description;
string name;
+ string filename;
string method;
- float StaticValue;
- float **Table;
- eParam LookupR, LookupC;
+ string multparms;
+ string multparmsRow;
+ string multparmsCol;
+ double Value(double, double);
+ double Value(double);
+ double Value(void);
+ double StaticValue;
+ double totalValue;
+ double bias,gain;
+ FGPropertyManager *LookupR, *LookupC;
+
+ FGPropertyManager *node; // must be private!!
+
MultVec multipliers;
int rows, columns;
Type type;
- float SD; // Actual stability derivative (or other coefficient) value
- float gain,bias;
+ double SD; // Actual stability derivative (or other coefficient) value
+ FGTable *Table;
- FGFDMExec* FDMExec;
FGState* State;
FGAtmosphere* Atmosphere;
FGFCS* FCS;
FGPosition* Position;
FGAuxiliary* Auxiliary;
FGOutput* Output;
-
- 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);
-
- inline float GetGain(void) { return gain; }
- inline float GetBias(void) { return bias; }
- inline void SetGain(float tt) { gain = tt; }
- inline void SetBias(float tt) { bias = tt; }
- inline void ResetGB(void) { gain = 1.0; bias = 0.0; }
+ FGPropertyManager* PropertyManager;
+ virtual void Debug(int from);
};
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#endif
+