]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGCoefficient.h
JSBSim tweaks.
[flightgear.git] / src / FDM / JSBSim / FGCoefficient.h
index aab3d957ae54f2974a20edebeef3c063e19c979b..5cd6799c31cf52039caad5095f43a66b68a72bf7 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGCoefficient.h
  Author:       Jon Berndt
@@ -27,16 +27,16 @@ HISTORY
 --------------------------------------------------------------------------------
 12/28/98   JSB   Created
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGCOEFFICIENT_H
 #define FGCOEFFICIENT_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
@@ -46,14 +46,19 @@ INCLUDES
 #include <string>
 #include "FGConfigFile.h"
 #include "FGDefs.h"
+#include "FGTable.h"
 
-/*******************************************************************************
-DEFINES
-*******************************************************************************/
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*******************************************************************************
+#define ID_COEFFICIENT "$Id$"
+
+using std::vector;
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGFDMExec;
 class FGState;
@@ -66,18 +71,29 @@ class FGPosition;
 class FGAuxiliary;
 class FGOutput;
 
-/*******************************************************************************
-COMMENTS, REFERENCES,  and NOTES
-********************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-This class models the stability derivative coefficient lookup tables or 
-equations. Note that the coefficients need not be calculated each delta-t.
+Note that the coefficients need not be calculated each delta-t. This is
+something that may be fixed someday.
 
-********************************************************************************
-CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using std::vector;
+/** This class models the stability derivative coefficient lookup tables.
+    Each coefficient for an axis is stored in that axes' vector of coefficients.
+    Each FDM execution frame the Run() method of the [currently] FGAircraft model
+    is called and the coefficient value is calculated.
+    @author Jon S. Berndt
+    @version $Id$
+    @see -
+*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGCoefficient
 {
@@ -90,12 +106,12 @@ class FGCoefficient
   string name;
   string method;
   float StaticValue;
-  float **Table;
   eParam LookupR, LookupC;
   MultVec multipliers;
   int rows, columns;
   Type type;
   float SD; // Actual stability derivative (or other coefficient) value
+  FGTable *Table;
 
   FGFDMExec*      FDMExec;
   FGState*        State;
@@ -107,14 +123,11 @@ class FGCoefficient
   FGPosition*     Position;
   FGAuxiliary*    Auxiliary;
   FGOutput*       Output;
-  
-  bool DeAllocate(void);
-  bool Allocate(int, int);
 
 public:
   FGCoefficient(FGFDMExec*, FGConfigFile*);
-  ~FGCoefficient(void);
-  
+  ~FGCoefficient();
+
   float Value(float, float);
   float Value(float);
   float Value(void);
@@ -123,8 +136,10 @@ public:
   inline float GetSD(void) {return SD;}
   inline MultVec Getmultipliers(void) {return multipliers;}
   void DumpSD(void);
-
+private:
+  void Debug(void);
 };
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+