]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGTrim.h
Fixes from Cameron Moore:
[flightgear.git] / src / FDM / JSBSim / FGTrim.h
index 810e385d853407469958afe95365936b760daef3..0e6019efc0dabefd9bd7150ce1c27c756248f8a3 100644 (file)
@@ -70,7 +70,9 @@ DEFINITIONS
 
 #define ID_TRIM "$Id$"
 
-typedef enum { tLongitudinal, tFull, tGround, tCustom, tNone } TrimMode;
+typedef enum { tLongitudinal, tFull, tGround, tPullup, 
+               tCustom, tNone, tTurn 
+             } TrimMode;
 
 #ifdef _MSC_VER
 #define snprintf _snprintf
@@ -145,10 +147,10 @@ class FGTrim : public FGJSBBase
 private:
 
   vector<FGTrimAxis*> TrimAxes;
-  int current_axis;
+  unsigned int current_axis;
   int N, Nsub;
   TrimMode mode;
-  int Debug;
+  int DebugLevel, Debug;
   double Tolerance, A_Tolerance;
   double wdot,udot,qdot;
   double dth;
@@ -161,9 +163,13 @@ private:
   bool trimudot;
   bool gamma_fallback;
   bool trim_failed;
-  int axis_count;
+  unsigned int axis_count;
   int solutionDomain;
   double xlo,xhi,alo,ahi;
+  double targetNlf;
+  int debug_axis;
+  
+  double psidot,thetadot;
 
   FGFDMExec* fdmex;
   FGInitialCondition* fgic;
@@ -180,6 +186,13 @@ private:
   bool findInterval(void);
 
   bool checkLimits(void);
+  
+  void setupPullup(void);
+  void setupTurn(void);
+  
+  void updateRates(void);
+
+  void setDebug(void);
 
 public:
   /** Initializes the trimming class
@@ -270,10 +283,21 @@ public:
     A_Tolerance = tt / 10;
   }
   
-  //Debug level 1 shows results of each top-level iteration
-  //Debug level 2 shows level 1 & results of each per-axis iteration
-  inline void SetDebug(int level) { Debug = level; }
-  inline void ClearDebug(void) { Debug = 0; }
+  /** 
+    Debug level 1 shows results of each top-level iteration
+    Debug level 2 shows level 1 & results of each per-axis iteration
+  */  
+  inline void SetDebug(int level) { DebugLevel = level; }
+  inline void ClearDebug(void) { DebugLevel = 0; }
+  
+  /**
+    Output debug data for one of the axes
+    The State enum is defined in FGTrimAxis.h
+  */  
+  inline void DebugState(State state) { debug_axis=state; }
+  
+  inline void SetTargetNlf(float nlf) { targetNlf=nlf; }
+  inline double GetTargetNlf(void) { return targetNlf; }
 
 };