]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAircraft.h
Make yasim accept the launchbar and hook properties. They are not tied to anything...
[flightgear.git] / src / FDM / JSBSim / FGAircraft.h
index 055373cc18301d069d87adf5e9ed43fba5b00b57..acf0b54e37f95ab7d97f1e6fb1038ce96797c219 100644 (file)
@@ -53,12 +53,8 @@ INCLUDES
 #endif
 
 #include "FGModel.h"
-#include "FGPropulsion.h"
 #include "FGConfigFile.h"
-#include "FGMatrix33.h"
 #include "FGColumnVector3.h"
-#include "FGColumnVector4.h"
-#include "FGLGear.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -70,50 +66,9 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-Longitudinal
-  CL0 - Reference lift at zero alpha
-  CD0 - Reference drag at zero alpha
-  CDM - Drag due to Mach
-  CLa - Lift curve slope (w.r.t. alpha)
-  CDa - Drag curve slope (w.r.t. alpha)
-  CLq - Lift due to pitch rate
-  CLM - Lift due to Mach
-  CLadt - Lift due to alpha rate
-  Cmadt - Pitching Moment due to alpha rate
-  Cm0 - Reference Pitching moment at zero alpha
-  Cma - Pitching moment slope (w.r.t. alpha)
-  Cmq - Pitch damping (pitch moment due to pitch rate)
-  CmM - Pitch Moment due to Mach
-Lateral
-  Cyb - Side force due to sideslip
-  Cyr - Side force due to yaw rate
-  Clb - Dihedral effect (roll moment due to sideslip)
-  Clp - Roll damping (roll moment due to roll rate)
-  Clr - Roll moment due to yaw rate
-  Cnb - Weathercocking stability (yaw moment due to sideslip)
-  Cnp - Rudder adverse yaw (yaw moment due to roll rate)
-  Cnr - Yaw damping (yaw moment due to yaw rate)
-Control
-  CLDe - Lift due to elevator
-  CDDe - Drag due to elevator
-  CyDr - Side force due to rudder
-  CyDa - Side force due to aileron
-  CmDe - Pitch moment due to elevator
-  ClDa - Roll moment due to aileron
-  ClDr - Roll moment due to rudder
-  CnDr - Yaw moment due to rudder
-  CnDa - Yaw moment due to aileron
+namespace JSBSim {
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
@@ -122,25 +77,20 @@ 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.<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).
+    for retrieving their force and moment contributions falls to FGAircraft.
     @author Jon S. Berndt
     @version $Id$
-    @see
-     <ol><li>Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
+    @see 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</li>
-     <li>D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
-     JSC 12960, July 1977</li>
-     <li>Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
-     NASA-Ames", NASA CR-2497, January 1975</li>
-     <li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
-     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>
+          School, January 1994
+    @see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
+     JSC 12960, July 1977
+    @see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
+     NASA-Ames", NASA CR-2497, January 1975
+    @see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
+     Wiley & Sons, 1979 ISBN 0-471-03032-5
+    @see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
+     1982 ISBN 0-471-08936-2
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -172,75 +122,63 @@ public:
   inline string GetAircraftName(void) { return AircraftName; }
   
   /// 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 float GetWingIncidence(void) { return WingIncidence; }
-  inline float GetHTailArea(void) { return HTailArea; }
-  inline float GetHTailArm(void)  { return HTailArm; }
-  inline float GetVTailArea(void) { return VTailArea; }
-  inline float GetVTailArm(void)  { return VTailArm; }
-  inline float Getlbarh(void) { return lbarh; } // HTailArm / cbar
-  inline float Getlbarv(void) { return lbarv; } // VTailArm / cbar
-  inline float Getvbarh(void) { return vbarh; } // H. Tail Volume
-  inline float Getvbarv(void) { return vbarv; } // V. Tail Volume
+  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 double GetBodyAccel(int idx) { return vBodyAccel(idx); }
+  inline FGColumnVector3& GetNcg   (void)  { return vNcg; }
+  inline double GetNcg(int idx)  { return vNcg(idx); }
   inline FGColumnVector3& GetXYZrp(void) { return vXYZrp; }
+  inline FGColumnVector3& GetXYZvrp(void) { return vXYZvrp; }
   inline FGColumnVector3& 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 SetAlphaCLMax(float tt) { alphaclmax=tt; }
-  inline void SetAlphaCLMin(float tt) { alphaclmin=tt; }
-
-  /// 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;
+  inline double GetXYZrp(int idx) const { return vXYZrp(idx); }
+  inline double GetXYZvrp(int idx) const { return vXYZvrp(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:
   FGColumnVector3 vMoments;
   FGColumnVector3 vForces;
   FGColumnVector3 vXYZrp;
+  FGColumnVector3 vXYZvrp;
   FGColumnVector3 vXYZep;
-  FGColumnVector3 vEuler;
   FGColumnVector3 vDXYZcg;
   FGColumnVector3 vBodyAccel;
-  float WingArea, WingSpan, cbar, WingIncidence;
-  float HTailArea, VTailArea, HTailArm, VTailArm;
-  float lbarh,lbarv,vbarh,vbarv;
-  float alphaclmax,alphaclmin;
-  string CFGVersion;
+  FGColumnVector3 vNcg;
+  FGColumnVector3 vNwcg;
+
+  double WingArea, WingSpan, cbar, WingIncidence;
+  double HTailArea, VTailArea, HTailArm, VTailArm;
+  double lbarh,lbarv,vbarh,vbarv;
   string AircraftName;
 
-  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);
 };
 
+} // namespace JSBSim
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif