]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAircraft.h
Added recent ground effect modeling changes.
[flightgear.git] / src / FDM / JSBSim / FGAircraft.h
index 05c9de0b4cec5b6846c2af737a6f123e64090029..48bfbdc1868e05213e9409ed0385b59a78f56ed1 100644 (file)
@@ -19,7 +19,7 @@
  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  Place - Suite 330, Boston, MA  02111-1307, USA.
+
  Further information about the GNU General Public License can also be found on
  the world wide web at http://www.gnu.org.
  
@@ -40,34 +40,29 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
-#  ifdef FG_HAVE_STD_INCLUDES
+#  ifdef SG_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 "FGModel.h"
-#include "FGCoefficient.h"
-#include "FGEngine.h"
-#include "FGTank.h"
-#include "FGLGear.h"
+#include "FGPropulsion.h"
 #include "FGConfigFile.h"
 #include "FGMatrix.h"
+#include "FGLGear.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_AIRCRAFT "$Header$"
+#define ID_AIRCRAFT "$Id$"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -86,7 +81,11 @@ CLASS DOCUMENTATION
     the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties,
     landing gear, etc. These constituent parts may actually run as separate
     JSBSim models themselves, but the responsibility for initializing them and
-    for retrieving their force and moment contributions falls to FGAircraft.
+    for retrieving their force and moment contributions falls to FGAircraft.<br>
+    When an aircraft model is loaded the config file is parsed and for each of the
+    sections of the config file (propulsion, flight control, etc.) the
+    corresponding "ReadXXX()" method is called. From within this method the 
+    "Load()" method of that system is called (e.g. LoadFCS).
     @author Jon S. Berndt
     @version $Id$
     @see
@@ -119,7 +118,7 @@ public:
   FGAircraft(FGFDMExec *Executive);
   
   /// Destructor
-  ~FGAircraft(void);
+  ~FGAircraft();
 
   /** Runs the Aircraft model; called by the Executive
       @see JSBSim.cpp documentation
@@ -128,11 +127,9 @@ public:
   
   /** 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);
+      @param AC_cfg a pointer to the config file instance
+      @return true if successful */
+  bool Load(FGConfigFile* AC_cfg);
   
   /** Gets the aircraft name
       @return the name of the aircraft as a string type */
@@ -154,38 +151,23 @@ public:
   inline float GetWingSpan(void) { return WingSpan; }
   /// Gets the average wing chord
   inline float Getcbar(void) { return cbar; }
-  /** Gets an engine instance.
-      @param engine index of the engine instance
-      @return a pointer to the FGEngine instance of the requested engine */
-  inline FGEngine* GetEngine(int engine) { return Engine[engine]; }
-  /** Gets a tank instance.
-      @param tank index of the tank instance
-      @return a pointer to the FGTank instance of the requested tank */
-  inline FGTank* GetTank(int tank) { return Tank[tank]; }
-  inline float GetWeight(void) { return Weight; }
-  inline float GetMass(void) { return Mass; }
   inline FGColumnVector GetMoments(void) { return vMoments; }
   inline FGColumnVector GetForces(void) { return vForces; }
-  inline FGColumnVector GetvFs(void) { return vFs; }
-  inline float GetIxx(void) { return Ixx; }
-  inline float GetIyy(void) { return Iyy; }
-  inline float GetIzz(void) { return Izz; }
-  inline float GetIxz(void) { return Ixz; }
-  inline unsigned int GetNumEngines(void) { return numEngines; }
-  inline FGColumnVector GetXYZcg(void) { return vXYZcg; }
+  inline FGColumnVector GetAeroBodyForces(void) { return vAeroBodyForces; }
+  inline float GetAeroBodyForces(int axis) { return vAeroBodyForces(axis); }
   inline FGColumnVector GetXYZrp(void) { return vXYZrp; }
   inline FGColumnVector GetXYZep(void) { return vXYZep; }
-  inline float GetNlf(void) { return nlf; }
+  inline float GetXYZrp(int idx) { return vXYZrp(idx); }
+  inline float GetXYZep(int idx) { return vXYZep(idx); }
   inline float GetAlphaCLMax(void) { return alphaclmax; }
   inline float GetAlphaCLMin(void) { return alphaclmin; }
 
-  inline void SetGearUp(bool tt) { GearUp = tt; }
+  inline void SetGear(bool tt) { GearUp = tt; }
+  inline void SetGearUp(void) { GearUp = true; }
+  inline void SetGearDown(bool tt) { GearUp = false; }
   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);
   string GetGroundReactionValues(void);
 
@@ -201,7 +183,9 @@ public:
     /** Subsystem: Mass Properties (= 128)   */ ssMassProps       = 128,
     /** Subsystem: Coefficients (= 256)      */ ssCoefficients    = 256,
     /** Subsystem: Position (= 512)          */ ssPosition        = 512,
-    /** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024
+    /** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024,
+    /** Subsystem: FCS (= 2048)              */ ssFCS             = 2048,
+    /** Subsystem: Propulsion (= 4096)       */ ssPropulsion      = 4096
   } subsystems;
 
 private:
@@ -210,48 +194,24 @@ private:
   void FMGear(void);
   void FMMass(void);
   void FMProp(void);
-  void MassChange(void);
   FGColumnVector vMoments;
   FGColumnVector vForces;
-  FGColumnVector vFs;
   FGColumnVector vXYZrp;
-  FGColumnVector vbaseXYZcg;
-  FGColumnVector vXYZcg;
   FGColumnVector vXYZep;
   FGColumnVector vEuler;
-  float baseIxx, baseIyy, baseIzz, baseIxz, EmptyMass, Mass;
-  float Ixx, Iyy, Izz, Ixz;
+  FGColumnVector vDXYZcg;
+  FGColumnVector vAeroBodyForces;
   float alpha, beta;
   float WingArea, WingSpan, cbar;
-  float Weight, EmptyWeight;
-  float nlf,alphaclmax,alphaclmin;
+  float alphaclmax,alphaclmin;
   float dt;
   string CFGVersion;
   string AircraftName;
 
-  unsigned int numTanks;
-  unsigned int numEngines;
-  unsigned int numSelectedOxiTanks;
-  unsigned int numSelectedFuelTanks;
-  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;
-  
-  CoeffArray* Coeff;
-
-  void DisplayCoeffFactors(vector <eParam> multipliers);
-
   bool GearUp;
 
-  string Axis[6];
   vector <FGLGear> lGear;
 
-  string AircraftPath;
-  string EnginePath;
   void ReadMetrics(FGConfigFile*);
   void ReadPropulsion(FGConfigFile*);
   void ReadFlightControls(FGConfigFile*);
@@ -259,7 +219,9 @@ private:
   void ReadUndercarriage(FGConfigFile*);
   void ReadPrologue(FGConfigFile*);
   void ReadOutput(FGConfigFile*);
+  void Debug(void);
 };
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+