]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAircraft.h
Check return value of FDM::init().
[flightgear.git] / src / FDM / JSBSim / FGAircraft.h
index df74d0fe96e584a3dbedc880aea861e0523d6151..b8fe04ca59eea2a4102ba2fb9089aaf9f87c4474 100644 (file)
@@ -100,13 +100,16 @@ INCLUDES
 #  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
 
@@ -118,10 +121,32 @@ INCLUDES
 #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
 *******************************************************************************/
@@ -133,16 +158,38 @@ class FGAircraft : public FGModel {
   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 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; }
@@ -230,7 +277,8 @@ private:
   bool GearUp;
 
   string Axis[6];
-  vector <FGLGear*> lGear;
+  vector <FGLGear> lGear;
+
   string AircraftPath;
   string EnginePath;
   void ReadMetrics(FGConfigFile*);