# include <simgear/compiler.h>
# ifdef FG_HAVE_STD_INCLUDES
# include <vector>
+# include <iterator>
# include <map>
# else
# include <vector.h>
+# include <iterator.h>
# include <map.h>
# endif
#else
# include <vector>
+# include <iterator>
# include <map>
#endif
#include "FGConfigFile.h"
#include "FGMatrix.h"
+#define ID_AIRCRAFT "$Header$"
+
/*******************************************************************************
DEFINITIONS
*******************************************************************************/
+/** Encapsulates an Aircraft and its systems.
+ Owns all the parts (other classes) which make
+ up this aircraft. This includes the Engines, Tanks, Propellers, Nozzles,
+ aerodynamic and mass properties, landing gear, etc.
+ @author Jon S. Berndt
+ @version $Id$
+ @see
+ [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
+ Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
+ School, January 1994
+ [2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
+ JSC 12960, July 1977
+ [3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
+ NASA-Ames", NASA CR-2497, January 1975
+ [4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
+ Wiley & Sons, 1979 ISBN 0-471-03032-5
+ [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
+ 1982 ISBN 0-471-08936-2
+ */
+
/*******************************************************************************
CLASS DECLARATION
*******************************************************************************/
enum {ePhi=1, eTht, ePsi};
public:
- FGAircraft(FGFDMExec*);
+ /** Constructor
+ @param Executive a pointer to the parent executive object
+ */
+ FGAircraft(FGFDMExec *Executive);
+
+ /// Destructor
~FGAircraft(void);
+ /** Runs the model; called by the Executive
+ @see JSBSim.cpp documentation
+ @return bool returns false if no error
+ */
bool Run(void);
- bool LoadAircraft(string, string, string);
+
+ /** Loads the aircraft.
+ The executive calls this method to load the aircraft into JSBSim.
+ @param apath path to the aircraft files (e.g. "aircraft/X15/")
+ @param epath path to engine files (e.g. "engine/")
+ @param acname name of aircraft (e.g. "X15")
+ @return true if succesful
+ */
+ bool LoadAircraft(string apath, string epath, string acname);
+
+ /** Retrieves the aircraft name
+ @return the name of the aircraft as a string type
+ */
inline string GetAircraftName(void) { return AircraftName; }
+
inline void SetGearUp(bool tt) { GearUp = tt; }
inline bool GetGearUp(void) { return GearUp; }
+ inline int GetNumGearUnits(void) { return lGear.size(); }
+ inline FGLGear* GetGearUnit(int ii) { return &(lGear[ii]); }
inline float GetWingArea(void) { return WingArea; }
inline float GetWingSpan(void) { return WingSpan; }
inline float Getcbar(void) { return cbar; }
inline unsigned int GetNumEngines(void) { return numEngines; }
inline FGColumnVector GetXYZcg(void) { return vXYZcg; }
inline FGColumnVector GetXYZrp(void) { return vXYZrp; }
+ inline FGColumnVector GetXYZep(void) { return vXYZep; }
inline float GetNlf(void) { return nlf; }
inline float GetAlphaCLMax(void) { return alphaclmax; }
inline float GetAlphaCLMin(void) { return alphaclmin; }
inline void SetAlphaCLMax(float tt) { alphaclmax=tt; }
inline void SetAlphaCLMin(float tt) { alphaclmin=tt; }
-
+ inline FGCoefficient* GetCoeff(int axis, int idx) { return Coeff[axis][idx]; }
string GetCoefficientStrings(void);
string GetCoefficientValues(void);
string GetGroundReactionStrings(void);
unsigned int numEngines;
unsigned int numSelectedOxiTanks;
unsigned int numSelectedFuelTanks;
- FGTank* Tank[MAX_TANKS];
- FGEngine *Engine[MAX_ENGINES];
+ FGTank* Tank[MAX_TANKS]; // need to make a vector
+ FGEngine *Engine[MAX_ENGINES]; // need to make a vector
typedef map<string,int> AxisIndex;
AxisIndex AxisIdx;
- typedef vector<FGCoefficient> CoeffArray;
- typedef vector<CoeffArray> CoeffVector;
+ typedef vector<FGCoefficient*> CoeffArray;
+
+ CoeffArray* Coeff;
- CoeffVector Coeff;
-
- void DisplayCoeffFactors(int multipliers);
+ void DisplayCoeffFactors(vector <eParam> multipliers);
bool GearUp;
string Axis[6];
- vector <FGLGear*> lGear;
+ vector <FGLGear> lGear;
+
string AircraftPath;
string EnginePath;
void ReadMetrics(FGConfigFile*);