]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAircraft.h
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGAircraft.h
index 48bfbdc1868e05213e9409ed0385b59a78f56ed1..7d4b0be6145d63e3f5c992c776b4e54653b460d9 100644 (file)
@@ -55,7 +55,9 @@ INCLUDES
 #include "FGModel.h"
 #include "FGPropulsion.h"
 #include "FGConfigFile.h"
-#include "FGMatrix.h"
+#include "FGMatrix33.h"
+#include "FGColumnVector3.h"
+#include "FGColumnVector4.h"
 #include "FGLGear.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -70,9 +72,9 @@ FORWARD DECLARATIONS
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -82,10 +84,7 @@ CLASS DOCUMENTATION
     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.<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
@@ -100,6 +99,10 @@ CLASS DOCUMENTATION
      Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
      <li>Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
      1982 ISBN 0-471-08936-2</li></ol>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAircraft.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Header File </a>
+    @see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAircraft.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
+         Source File </a>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -107,11 +110,6 @@ CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGAircraft : public FGModel {
-  enum {eL=1, eM, eN};
-  enum {eX=1, eY, eZ};
-  enum {eP=1, eQ, eR};
-  enum {ePhi=1, eTht, ePsi};
-
 public:
   /** Constructor
       @param Executive a pointer to the parent executive object */
@@ -135,91 +133,57 @@ public:
       @return the name of the aircraft as a string type */
   inline string GetAircraftName(void) { return AircraftName; }
   
-  /** Gets the gear status
-      @return true if gear is not deployed */
-  inline bool GetGearUp(void) { return GearUp; }
-  /** Gets the number of gear units defined for the aircraft
-      @return number of gear units defined */
-  inline int GetNumGearUnits(void) { return lGear.size(); }
-  /** Gets a gear instance
-      @param gear index of gear instance
-      @return a pointer to the FGLGear instance of the gear unit requested */
-  inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); }
   /// Gets the wing area
-  inline float GetWingArea(void) { return WingArea; }
+  double GetWingArea(void) const { return WingArea; }
   /// Gets the wing span
-  inline float GetWingSpan(void) { return WingSpan; }
+  double GetWingSpan(void) const { return WingSpan; }
   /// Gets the average wing chord
-  inline float Getcbar(void) { return cbar; }
-  inline FGColumnVector GetMoments(void) { return vMoments; }
-  inline FGColumnVector GetForces(void) { return vForces; }
-  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 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 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; }
-
-  string GetGroundReactionStrings(void);
-  string GetGroundReactionValues(void);
-
-  /// Subsystem types for specifying which will be output in the FDM data logging
-  enum  SubSystems {
-    /** Subsystem: Simulation (= 1)          */ ssSimulation      = 1,
-    /** Subsystem: Aerosurfaces (= 2)        */ ssAerosurfaces    = 2,
-    /** Subsystem: Body rates (= 4)          */ ssRates           = 4,
-    /** Subsystem: Velocities (= 8)          */ ssVelocities      = 8,
-    /** Subsystem: Forces (= 16)             */ ssForces          = 16,
-    /** Subsystem: Moments (= 32)            */ ssMoments         = 32,
-    /** Subsystem: Atmosphere (= 64)         */ ssAtmosphere      = 64,
-    /** Subsystem: Mass Properties (= 128)   */ ssMassProps       = 128,
-    /** Subsystem: Coefficients (= 256)      */ ssCoefficients    = 256,
-    /** Subsystem: Position (= 512)          */ ssPosition        = 512,
-    /** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024,
-    /** Subsystem: FCS (= 2048)              */ ssFCS             = 2048,
-    /** Subsystem: Propulsion (= 4096)       */ ssPropulsion      = 4096
-  } subsystems;
+  double Getcbar(void) const { return cbar; }
+  inline double GetWingIncidence(void) const { return WingIncidence; }
+  inline double GetHTailArea(void) const { return HTailArea; }
+  inline double GetHTailArm(void)  const { return HTailArm; }
+  inline double GetVTailArea(void) const { return VTailArea; }
+  inline double GetVTailArm(void)  const { return VTailArm; }
+  inline double Getlbarh(void) const { return lbarh; } // HTailArm / cbar
+  inline double Getlbarv(void) const { return lbarv; } // VTailArm / cbar
+  inline double Getvbarh(void) const { return vbarh; } // H. Tail Volume
+  inline double Getvbarv(void) const { return vbarv; } // V. Tail Volume
+  inline FGColumnVector3& GetMoments(void) { return vMoments; }
+  inline double GetMoments(int idx) const { return vMoments(idx); }
+  inline FGColumnVector3& GetForces(void) { return vForces; }
+  inline double GetForces(int idx) const { return vForces(idx); }
+  inline FGColumnVector3& GetBodyAccel(void) { return vBodyAccel; }
+  inline FGColumnVector3& GetNcg   (void)  { return vNcg; }
+  inline FGColumnVector3& GetXYZrp(void) { return vXYZrp; }
+  inline FGColumnVector3& GetXYZep(void) { return vXYZep; }
+  inline double GetXYZrp(int idx) const { return vXYZrp(idx); }
+  inline double GetXYZep(int idx) const { return vXYZep(idx); }
+  inline void SetAircraftName(string name) {AircraftName = name;}
+
+  float GetNlf(void);
+
+  inline FGColumnVector3& GetNwcg(void) { return vNwcg; }
+
+  void bind(void);
+  void unbind(void);
 
 private:
-  void GetState(void);
-  void FMAero(void);
-  void FMGear(void);
-  void FMMass(void);
-  void FMProp(void);
-  FGColumnVector vMoments;
-  FGColumnVector vForces;
-  FGColumnVector vXYZrp;
-  FGColumnVector vXYZep;
-  FGColumnVector vEuler;
-  FGColumnVector vDXYZcg;
-  FGColumnVector vAeroBodyForces;
-  float alpha, beta;
-  float WingArea, WingSpan, cbar;
-  float alphaclmax,alphaclmin;
-  float dt;
-  string CFGVersion;
+  FGColumnVector3 vMoments;
+  FGColumnVector3 vForces;
+  FGColumnVector3 vXYZrp;
+  FGColumnVector3 vXYZep;
+  FGColumnVector3 vEuler;
+  FGColumnVector3 vDXYZcg;
+  FGColumnVector3 vBodyAccel;
+  FGColumnVector3 vNcg;
+  FGColumnVector3 vNwcg;
+
+  double WingArea, WingSpan, cbar, WingIncidence;
+  double HTailArea, VTailArea, HTailArm, VTailArm;
+  double lbarh,lbarv,vbarh,vbarv;
   string AircraftName;
 
-  bool GearUp;
-
-  vector <FGLGear> lGear;
-
-  void ReadMetrics(FGConfigFile*);
-  void ReadPropulsion(FGConfigFile*);
-  void ReadFlightControls(FGConfigFile*);
-  void ReadAerodynamics(FGConfigFile*);
-  void ReadUndercarriage(FGConfigFile*);
-  void ReadPrologue(FGConfigFile*);
-  void ReadOutput(FGConfigFile*);
-  void Debug(void);
+  void Debug(int from);
 };
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%