#include "FGFDMExec.h"
#include "FGJSBBase.h"
-#include "FGRotation.h"
-#include "FGAtmosphere.h"
-#include "FGState.h"
-#include "FGFCS.h"
-#include "FGAircraft.h"
-#include "FGTranslation.h"
-#include "FGPosition.h"
-#include "FGAuxiliary.h"
-#include "FGOutput.h"
+#include "FGInitialCondition.h"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_TRIMAXIS "$Id$"
#define DEFAULT_TOLERANCE 0.001
-const string StateNames[7]= { "udot","vdot","wdot","qdot","pdot","rdot","hmgt" };
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+namespace JSBSim {
+
+const string StateNames[10]= { "all","udot","vdot","wdot","qdot","pdot","rdot",
+ "hmgt","nlf"
+ };
const string ControlNames[14]= { "Throttle","Sideslip","Angle of Attack",
"Elevator","Ailerons","Rudder",
"Altitude AGL", "Pitch Angle",
"Heading"
};
+class FGInitialCondition;
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Models an aircraft axis for purposes of trimming.
+ */
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-enum State { tUdot,tVdot,tWdot,tQdot,tPdot,tRdot,tHmgt };
+enum State { tAll,tUdot,tVdot,tWdot,tQdot,tPdot,tRdot,tHmgt,tNlf };
enum Control { tThrottle, tBeta, tAlpha, tElevator, tAileron, tRudder, tAltAGL,
tTheta, tPhi, tGamma, tPitchTrim, tRollTrim, tYawTrim, tHeading };
class FGTrimAxis : public FGJSBBase
{
public:
- FGTrimAxis(FGFDMExec* fdmex, FGInitialCondition *ic, State st,
+ FGTrimAxis(FGFDMExec* fdmex,
+ FGInitialCondition *ic,
+ State st,
Control ctrl );
~FGTrimAxis();
void SetThetaOnGround(double ff);
void SetPhiOnGround(double ff);
+ inline void SetStateTarget(float target) { state_target=target; }
+ inline float GetStateTarget(void) { return state_target; }
+
bool initTheta(void);
void AxisReport(void);
State state;
Control control;
-
- double state_value;
- double control_value;
+
+ float state_target;
+
+ float state_value;
+ float control_value;
double control_min;
double control_max;
double computeHmgt(void);
- void Debug(void);
+ void Debug(int from);
};
-
+}
#endif