X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGPropulsion.h;h=b812f19680c6274bcb3dedc178f7306e20f430b9;hb=b7ebc7d78dbf320d432bad3ed0e384b2e1308eed;hp=19329865a4917abcb87e3d7d2a05e9285e7a0aa9;hpb=32e9505eedffe7f98de028513de8a809a366bd98;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGPropulsion.h b/src/FDM/JSBSim/models/FGPropulsion.h index 19329865a..b812f1968 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.h +++ b/src/FDM/JSBSim/models/FGPropulsion.h @@ -38,22 +38,8 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#ifdef FGFS -# include -# ifdef SG_HAVE_STD_INCLUDES -# include -# include -# include -# else -# include -# include -# include -# endif -#else -# include -# include -# include -#endif +#include +#include #include "FGModel.h" #include @@ -80,12 +66,29 @@ CLASS DOCUMENTATION /** Propulsion management class. The Propulsion class is the container for the entire propulsion system, which is comprised of engines, and tanks. Once the Propulsion class gets the config file, - it reads in information which is specific to a type of engine. Then: + it reads in the \ section. Then: -# The appropriate engine type instance is created -# At least one tank object is created, and is linked to an engine. - At Run time each engines Calculate() method is called. + At Run time each engine's Calculate() method is called. + +

Configuration File Format:

+ + @code + + + ... see FGEngine, FGThruster, and class for engine type ... + + ... more engines ... + + ... see FGTank ... + + ... more tanks ... + {number} + + @endcode + @author Jon S. Berndt @version $Id$ @see @@ -112,6 +115,8 @@ public: [Note: Should we be checking the Starved flag here?] */ bool Run(void); + bool InitModel(void); + /** Loads the propulsion system (engine[s] and tank[s]). Characteristics of the propulsion system are read in from the config file. @param el pointer to an XML element that contains the engine information. @@ -149,28 +154,30 @@ public: /** Loops the engines until thrust output steady (used for trimming) */ bool GetSteadyState(void); - /** starts the engines in IC mode (dt=0). All engine-specific setup must - be done before calling this (i.e. magnetos, starter engage, etc.) */ - bool ICEngineStart(void); + /** Sets up the engines as running */ + void InitRunning(int n); - std::string GetPropulsionStrings(std::string delimeter); - std::string GetPropulsionValues(std::string delimeter); + string GetPropulsionStrings(string delimeter); + string GetPropulsionValues(string delimeter); inline FGColumnVector3& GetForces(void) {return vForces; } inline double GetForces(int n) const { return vForces(n);} inline FGColumnVector3& GetMoments(void) {return vMoments;} inline double GetMoments(int n) const {return vMoments(n);} - inline bool GetRefuel(void) {return refuel;} + inline bool GetRefuel(void) const {return refuel;} inline void SetRefuel(bool setting) {refuel = setting;} + inline bool GetFuelDump(void) const {return dump;} + inline void SetFuelDump(bool setting) {dump = setting;} double Transfer(int source, int target, double amount); void DoRefuel(double time_slice); + void DumpFuel(double time_slice); FGColumnVector3& GetTanksMoment(void); double GetTanksWeight(void); - std::ifstream* FindEngineFile(std::string filename); - std::string FindEngineFullPathname(std::string engine_filename); + ifstream* FindEngineFile(string filename); + string FindEngineFullPathname(string engine_filename); inline int GetActiveEngine(void) const {return ActiveEngine;} inline bool GetFuelFreeze(void) {return fuel_freeze;} double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;} @@ -182,13 +189,9 @@ public: void SetFuelFreeze(bool f); FGMatrix33& CalculateTankInertias(void); - void bind(); - void unbind(); - private: - std::vector Engines; - std::vector Tanks; - std::vector ::iterator iTank; + vector Engines; + vector Tanks; unsigned int numSelectedFuelTanks; unsigned int numSelectedOxiTanks; unsigned int numFuelTanks; @@ -202,8 +205,10 @@ private: FGColumnVector3 vXYZtank_arm; FGMatrix33 tankJ; bool refuel; + bool dump; bool fuel_freeze; double TotalFuelQuantity; + double DumpRate; bool IsBound; bool HavePistonEngine; bool HaveTurbineEngine; @@ -211,6 +216,10 @@ private: bool HaveRocketEngine; bool HaveElectricEngine; + int InitializedEngines; + bool HasInitializedEngines; + + void bind(); void Debug(int from); }; }