]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGCoefficient.h
Updated to latest JSBSim, including preliminary support for
[flightgear.git] / src / FDM / JSBSim / FGCoefficient.h
index 9c8bdf3ad235a499887100998693bfad00c672b7..7c7083d0b2225ee2d7b740e474a95d855da4fdd2 100644 (file)
@@ -45,13 +45,14 @@ INCLUDES
 #include <vector>
 #include <string>
 #include "FGConfigFile.h"
-#include "FGDefs.h"
+#include "FGTable.h"
+#include "FGJSBBase.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_COEFFICIENT "$Header"
+#define ID_COEFFICIENT "$Id$"
 
 using std::vector;
 
@@ -94,9 +95,35 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGCoefficient
+class FGCoefficient : public FGJSBBase
 {
+public:
+  FGCoefficient(FGFDMExec*);
+  virtual ~FGCoefficient();
+  
+  virtual bool Load(FGConfigFile* AC_cfg);
+  
   typedef vector <eParam> MultVec;
+  virtual double TotalValue(void);
+  virtual inline string Getname(void) {return name;}
+  virtual inline double GetSD(void) { 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) { return bias; }
+  inline double getGain(void) { return gain; }
+
+private:
   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
 
   int numInstances;
@@ -104,14 +131,20 @@ class FGCoefficient
   string description;
   string name;
   string method;
-  float StaticValue;
-  float **Table;
+  string multparms;
+  string multparmsRow;
+  string multparmsCol;
+  double Value(double, double);
+  double Value(double);
+  double Value(void);
+  double StaticValue;
+  double bias,gain;
   eParam LookupR, LookupC;
   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;
@@ -123,30 +156,10 @@ 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; }
 
+  virtual void Debug(int from);
 };
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+