]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGEngine.h
Andreas Gaeb: fix #222 (JSBSIm reset problems)
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGEngine.h
index 0e79e3a725d106c8ed219a88ca2c2ada3af5ffc5..c25eebfc0a4abdca19e431987e1ebe11bc49cc8a 100644 (file)
@@ -43,10 +43,11 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <FGJSBBase.h>
-#include "FGThruster.h"
-#include <input_output/FGPropertyManager.h>
-#include <input_output/FGXMLFileRead.h>
+#include "math/FGModelFunctions.h"
+#include "input_output/FGXMLFileRead.h"
+#include "input_output/FGXMLElement.h"
+#include "models/FGFCS.h"
+#include "math/FGColumnVector3.h"
 #include <vector>
 #include <string>
 
@@ -54,10 +55,7 @@ INCLUDES
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_ENGINE "$Id$"
-
-using std::string;
-using std::vector;
+#define ID_ENGINE "$Id: FGEngine.h,v 1.21 2010/08/21 17:13:48 jberndt Exp $"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -66,15 +64,14 @@ FORWARD DECLARATIONS
 namespace JSBSim {
 
 class FGFDMExec;
-class FGState;
 class FGAtmosphere;
-class FGFCS;
 class FGAircraft;
 class FGPropagate;
 class FGPropulsion;
 class FGAuxiliary;
 class FGThruster;
 class Element;
+class FGPropertyManager;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
@@ -116,20 +113,19 @@ CLASS DOCUMENTATION
 @endcode
 <pre>
     NOTES:
-       Engines feed from all tanks equally.
-
+       
        Not all thruster types can be matched with a given engine type.  See the class
        documentation for engine and thruster classes.
 </pre>     
     @author Jon S. Berndt
-    @version $Id$
+    @version $Id: FGEngine.h,v 1.21 2010/08/21 17:13:48 jberndt Exp $
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGEngine : public FGJSBBase, public FGXMLFileRead
+class FGEngine : public FGModelFunctions, public FGXMLFileRead
 {
 public:
   FGEngine(FGFDMExec* exec, Element* el, int engine_number);
@@ -159,7 +155,7 @@ public:
 
   virtual void SetRunning(bool bb) { Running=bb; }
   virtual void SetName(string name) { Name = name; }
-  virtual void AddFeedTank(int tkID);
+  virtual void AddFeedTank(int tkID, int priority);
   virtual void SetFuelFreeze(bool f) { FuelFreeze = f; }
 
   virtual void SetStarter(bool s) { Starter = s; }
@@ -169,9 +165,8 @@ public:
   /** Resets the Engine parameters to the initial conditions */
   void ResetToIC(void);
 
-  /** Calculates the thrust of the engine, and other engine functions.
-      @return Thrust in pounds */
-  virtual double Calculate(void) {return 0.0;}
+  /** Calculates the thrust of the engine, and other engine functions. */
+  virtual void Calculate(void) = 0;
 
   /// Sets engine placement information
   virtual void SetPlacement(FGColumnVector3& location, FGColumnVector3& orientation);
@@ -187,8 +182,8 @@ public:
   bool LoadThruster(Element *el);
   FGThruster* GetThruster(void) {return Thruster;}
 
-  virtual string GetEngineLabels(string delimeter) = 0;
-  virtual string GetEngineValues(string delimeter) = 0;
+  virtual std::string GetEngineLabels(const std::string& delimiter) = 0;
+  virtual std::string GetEngineValues(const std::string& delimiter) = 0;
 
 protected:
   /** Reduces the fuel in the active tanks by the amount required.
@@ -205,7 +200,7 @@ protected:
   virtual double CalcFuelNeed(void);
 
   FGPropertyManager* PropertyManager;
-  string Name;
+  std::string Name;
   const int   EngineNumber;
   EngineType Type;
   double X, Y, Z;
@@ -229,9 +224,9 @@ protected:
 
   double FuelFlow_gph;
   double FuelFlow_pph;
+  double FuelDensity;
 
   FGFDMExec*      FDMExec;
-  FGState*        State;
   FGAtmosphere*   Atmosphere;
   FGFCS*          FCS;
   FGPropulsion*   Propulsion;
@@ -240,20 +235,11 @@ protected:
   FGAuxiliary*    Auxiliary;
   FGThruster*     Thruster;
 
-  vector <int> SourceTanks;
+  std::vector <int> SourceTanks;
+
   void Debug(int from);
 };
 }
-#include <FGState.h>
-#include <FGFDMExec.h>
-#include <models/FGAtmosphere.h>
-#include <models/FGFCS.h>
-#include <models/FGAircraft.h>
-#include <models/FGPropagate.h>
-#include <models/FGPropulsion.h>
-#include <models/FGAuxiliary.h>
-#include <models/propulsion/FGThruster.h>
-#include <input_output/FGXMLElement.h>
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif