]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGEngine.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGEngine.h
index 14d15149bc59e4e7209046dc8716c23f84a1cbbb..0bd7776ef26785b59558ba783844bc1472999a9c 100644 (file)
@@ -59,6 +59,8 @@ INCLUDES
 #endif
 
 #include "FGJSBBase.h"
+#include "FGThruster.h"
+#include "FGPropertyManager.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -69,27 +71,23 @@ DEFINITIONS
 using std::string;
 using std::vector;
 
-namespace JSBSim {
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGFDMExec;
 class FGState;
 class FGAtmosphere;
 class FGFCS;
 class FGAircraft;
-class FGTranslation;
-class FGRotation;
+class FGPropagate;
 class FGPropulsion;
-class FGPosition;
 class FGAuxiliary;
 class FGOutput;
-
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+class FGThruster;
+class FGConfigFile;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -99,7 +97,7 @@ CLASS DOCUMENTATION
     This base class contains methods and members common to all engines, such as
     logic to drain fuel from the appropriate tank, etc.
     @author Jon S. Berndt
-    @version $Id$ 
+    @version $Id$
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -109,61 +107,44 @@ CLASS DECLARATION
 class FGEngine : public FGJSBBase
 {
 public:
-  FGEngine(FGFDMExec* exec);
+  FGEngine(FGFDMExec* exec, int engine_number);
   virtual ~FGEngine();
 
-  enum EngineType {etUnknown, etRocket, etPiston, etTurbine};
+  enum EngineType {etUnknown, etRocket, etPiston, etTurbine, etElectric};
+
+  EngineType      GetType(void) { return Type; }
+  virtual string  GetName(void) { return Name; }
+  string GetThrusterFileName(void) {return thrusterFileName;}
+  void SetEngineFileName(string eng) {engineFileName = eng;}
+  string GetEngineFileName(void) {return engineFileName;}
 
+  // Engine controls
   virtual double  GetThrottleMin(void) { return MinThrottle; }
   virtual double  GetThrottleMax(void) { return MaxThrottle; }
   virtual double  GetThrottle(void) { return Throttle; }
   virtual double  GetMixture(void) { return Mixture; }
-  virtual int     GetMagnetos(void) { return Magnetos; }
   virtual bool    GetStarter(void) { return Starter; }
-  virtual double  GetThrust(void) { return Thrust; }
-  virtual bool    GetStarved(void) { return Starved; }
-  virtual bool    GetFlameout(void) { return Flameout; }
-  virtual bool    GetRunning(void) { return Running; }
-  virtual bool    GetCranking(void) { return Cranking; }
-  virtual int     GetType(void) { return Type; }
-  virtual string  GetName(void) { return Name; }
 
-  virtual double getFuelFlow_gph () const {
-    return FuelFlow_gph;
-  }
-
-  virtual double getManifoldPressure_inHg () const {
-    return ManifoldPressure_inHg;
-  }
-  virtual double getExhaustGasTemp_degF () const {
-    return (ExhaustGasTemp_degK - 273) * (9.0 / 5.0) + 32.0;
-  }
-  virtual double getCylinderHeadTemp_degF () const {
-    return (CylinderHeadTemp_degK - 273) * (9.0 / 5.0) + 32.0;
-  }
-  virtual double getOilPressure_psi () const {
-    return OilPressure_psi;
-  }
-  virtual double getOilTemp_degF () const {
-    return (OilTemp_degK - 273.0) * (9.0 / 5.0) + 32.0;
-  }
-
-  virtual void SetStarved(bool tt) {Starved = tt;}
-  virtual void SetStarved(void)    {Starved = true;}
+  virtual double getFuelFlow_gph () const {return FuelFlow_gph;}
+  virtual double getFuelFlow_pph () const {return FuelFlow_pph;}
+  virtual double GetThrust(void) { return Thrust; }
+  virtual bool   GetStarved(void) { return Starved; }
+  virtual bool   GetRunning(void) { return Running; }
+  virtual bool   GetCranking(void) { return Cranking; }
+
+  virtual void SetStarved(bool tt) { Starved = tt; }
+  virtual void SetStarved(void)    { Starved = true; }
 
   virtual void SetRunning(bool bb) { Running=bb; }
-  virtual void SetName(string name) {Name = name;}
+  virtual void SetName(string name) { Name = name; }
   virtual void AddFeedTank(int tkID);
+  virtual void SetFuelFreeze(bool f) { FuelFreeze = f; }
 
-  virtual void SetMagnetos(int m) { Magnetos = m; }
-  virtual void SetStarter(bool s) { Starter = s;}
+  virtual void SetStarter(bool s) { Starter = s; }
 
   /** Calculates the thrust of the engine, and other engine functions.
-      @param PowerRequired this is the power required to run the thrusting device
-             such as a propeller. This resisting effect must be provided to the 
-             engine model.
       @return Thrust in pounds */
-  virtual double Calculate(double PowerRequired) {return 0.0;};
+  virtual double Calculate(void) {return 0.0;}
 
   /** Reduces the fuel in the active tanks by the amount required.
       This function should be called from within the
@@ -186,17 +167,34 @@ public:
 
   /// Sets engine placement information
   virtual void SetPlacement(double x, double y, double z, double pitch, double yaw);
-
-  /// Sets the engine number
-  virtual void SetEngineNumber(int nn) {EngineNumber = nn;}
+  double GetPlacementX(void) const {return X;}
+  double GetPlacementY(void) const {return Y;}
+  double GetPlacementZ(void) const {return Z;}
+  double GetPitch(void) const {return EnginePitch;}
+  double GetYaw(void) const {return EngineYaw;}
 
   virtual double GetPowerAvailable(void) {return 0.0;};
 
   virtual bool GetTrimMode(void) {return TrimMode;}
   virtual void SetTrimMode(bool state) {TrimMode = state;}
 
+  virtual FGColumnVector3& GetBodyForces(void);
+  virtual FGColumnVector3& GetMoments(void);
+
+  bool LoadThruster(FGConfigFile* AC_cfg);
+  FGThruster* GetThruster(void) {return Thruster;}
+
+  virtual string GetEngineLabels(string delimeter) = 0;
+  virtual string GetEngineValues(string delimeter) = 0;
+  int GetNumSourceTanks(void) {return SourceTanks.size();}
+  int GetSourceTank(int t) {return SourceTanks[t];}
+
 protected:
+  FGPropertyManager* PropertyManager;
   string Name;
+  string thrusterFileName;
+  string engineFileName;
+  const int   EngineNumber;
   EngineType Type;
   double X, Y, Z;
   double EnginePitch;
@@ -209,23 +207,18 @@ protected:
   double Thrust;
   double Throttle;
   double Mixture;
-  int   Magnetos;
+  double FuelNeed;
+  double OxidizerNeed;
+  double PctPower;
   bool  Starter;
-  double FuelNeed, OxidizerNeed;
   bool  Starved;
-  bool  Flameout;
   bool  Running;
   bool  Cranking;
-  double PctPower;
-  int   EngineNumber;
   bool  TrimMode;
+  bool  FuelFreeze;
 
   double FuelFlow_gph;
-  double ManifoldPressure_inHg;
-  double ExhaustGasTemp_degK;
-  double CylinderHeadTemp_degK;
-  double OilPressure_psi;
-  double OilTemp_degK;
+  double FuelFlow_pph;
 
   FGFDMExec*      FDMExec;
   FGState*        State;
@@ -233,14 +226,13 @@ protected:
   FGFCS*          FCS;
   FGPropulsion*   Propulsion;
   FGAircraft*     Aircraft;
-  FGTranslation*  Translation;
-  FGRotation*     Rotation;
-  FGPosition*     Position;
+  FGPropagate*    Propagate;
   FGAuxiliary*    Auxiliary;
   FGOutput*       Output;
+  FGThruster*     Thruster;
 
   vector <int> SourceTanks;
-  virtual void Debug(int from);
+  void Debug(int from);
 };
 }
 #include "FGState.h"
@@ -248,12 +240,12 @@ protected:
 #include "FGAtmosphere.h"
 #include "FGFCS.h"
 #include "FGAircraft.h"
-#include "FGTranslation.h"
-#include "FGRotation.h"
+#include "FGPropagate.h"
 #include "FGPropulsion.h"
-#include "FGPosition.h"
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
+#include "FGThruster.h"
+#include "FGConfigFile.h"
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif