X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGPropulsion.h;h=4be73b1698acb0814b0ce5e533a5445c45bc5c6d;hb=642735ab18421db87a07d6841dd720fd4615bfff;hp=50dd860cde4809db61d5ba19cd89fe546f79a568;hpb=674a295896a1e56d605f39874262d6f146a586a3;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGPropulsion.h b/src/FDM/JSBSim/models/FGPropulsion.h index 50dd860cd..4be73b169 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.h +++ b/src/FDM/JSBSim/models/FGPropulsion.h @@ -42,6 +42,7 @@ INCLUDES #include #include "FGModel.h" +#include "propulsion/FGEngine.h" #include "math/FGMatrix33.h" #include "input_output/FGXMLFileRead.h" @@ -49,7 +50,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_PROPULSION "$Id: FGPropulsion.h,v 1.26 2010/11/18 12:38:06 jberndt Exp $" +#define ID_PROPULSION "$Id: FGPropulsion.h,v 1.31 2011/10/31 14:54:41 bcoconni Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -91,7 +92,7 @@ CLASS DOCUMENTATION @endcode @author Jon S. Berndt - @version $Id: FGPropulsion.h,v 1.26 2010/11/18 12:38:06 jberndt Exp $ + @version $Id: FGPropulsion.h,v 1.31 2011/10/31 14:54:41 bcoconni Exp $ @see FGEngine FGTank @@ -112,9 +113,13 @@ public: /** Executes the propulsion model. The initial plan for the FGPropulsion class calls for Run() to be executed, calculating the power available from the engine. - - [Note: Should we be checking the Starved flag here?] */ - bool Run(void); + Can pass in a value indicating if the executive is directing the simulation to Hold. + @param Holding if true, the executive has been directed to hold the sim from + advancing time. Some models may ignore this flag, such as the Input + model, which may need to be active to listen on a socket for the + "Resume" command to be given. + @return false if no error */ + bool Run(bool Holding); bool InitModel(void); @@ -160,6 +165,7 @@ public: std::string GetPropulsionStrings(const std::string& delimiter) const; std::string GetPropulsionValues(const std::string& delimiter) const; + std::string GetPropulsionTankReport(); const FGColumnVector3& GetForces(void) const {return vForces; } double GetForces(int n) const { return vForces(n);} @@ -174,13 +180,13 @@ public: void DoRefuel(double time_slice); void DumpFuel(double time_slice); - FGColumnVector3& GetTanksMoment(void); - double GetTanksWeight(void); + const FGColumnVector3& GetTanksMoment(void); + double GetTanksWeight(void) const; std::ifstream* FindEngineFile(const std::string& filename); std::string FindEngineFullPathname(const std::string& engine_filename); inline int GetActiveEngine(void) const {return ActiveEngine;} - inline bool GetFuelFreeze(void) {return fuel_freeze;} + inline bool GetFuelFreeze(void) const {return FuelFreeze;} double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;} void SetMagnetos(int setting); @@ -188,7 +194,9 @@ public: void SetCutoff(int setting=0); void SetActiveEngine(int engine); void SetFuelFreeze(bool f); - FGMatrix33& CalculateTankInertias(void); + const FGMatrix33& CalculateTankInertias(void); + + struct FGEngine::Inputs in; private: std::vector Engines; @@ -207,7 +215,7 @@ private: FGMatrix33 tankJ; bool refuel; bool dump; - bool fuel_freeze; + bool FuelFreeze; double TotalFuelQuantity; double DumpRate; bool IsBound; @@ -216,6 +224,7 @@ private: bool HaveTurboPropEngine; bool HaveRocketEngine; bool HaveElectricEngine; + void ConsumeFuel(FGEngine* engine); int InitializedEngines; bool HasInitializedEngines;