X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2FFGCoefficient.h;h=1a076907dc8092e61ae58596441111bf10591dd5;hb=4a854fcc3ec4e9508ec6d70d50fb1a92183cb04e;hp=9c8bdf3ad235a499887100998693bfad00c672b7;hpb=0f98d21dd7cd2ab63e191d8f506825b3aaac50a0;p=flightgear.git diff --git a/src/FDM/JSBSim/FGCoefficient.h b/src/FDM/JSBSim/FGCoefficient.h index 9c8bdf3ad..1a076907d 100644 --- a/src/FDM/JSBSim/FGCoefficient.h +++ b/src/FDM/JSBSim/FGCoefficient.h @@ -45,13 +45,15 @@ INCLUDES #include #include #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; @@ -87,33 +89,79 @@ CLASS DOCUMENTATION is called and the coefficient value is calculated. @author Jon S. Berndt @version $Id$ - @see - + @see + Header File + @see + Source File */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -class FGCoefficient +class FGCoefficient : public FGJSBBase { - typedef vector MultVec; +public: + FGCoefficient(FGFDMExec*); + virtual ~FGCoefficient(); + + virtual bool Load(FGConfigFile* AC_cfg); + + typedef vector 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; @@ -123,30 +171,11 @@ class FGCoefficient 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 +