X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGPropulsion.h;h=50dd860cde4809db61d5ba19cd89fe546f79a568;hb=53e8fbfcbb3ddac0dc261043fea7bd24dfa6e62d;hp=3ef37afec42e122035a6a6fc58519f6bcac100ec;hpb=0f0f25512d4b5a4c1b56de2ad975abc7285c9bf5;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGPropulsion.h b/src/FDM/JSBSim/models/FGPropulsion.h index 3ef37afec..50dd860cd 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.h +++ b/src/FDM/JSBSim/models/FGPropulsion.h @@ -39,11 +39,9 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include -#include +#include #include "FGModel.h" -#include "models/propulsion/FGEngine.h" -#include "models/propulsion/FGTank.h" #include "math/FGMatrix33.h" #include "input_output/FGXMLFileRead.h" @@ -51,7 +49,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_PROPULSION "$Id$" +#define ID_PROPULSION "$Id: FGPropulsion.h,v 1.26 2010/11/18 12:38:06 jberndt Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -59,6 +57,9 @@ FORWARD DECLARATIONS namespace JSBSim { +class FGTank; +class FGEngine; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DOCUMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -90,7 +91,7 @@ CLASS DOCUMENTATION @endcode @author Jon S. Berndt - @version $Id$ + @version $Id: FGPropulsion.h,v 1.26 2010/11/18 12:38:06 jberndt Exp $ @see FGEngine FGTank @@ -124,32 +125,32 @@ public: bool Load(Element* el); /// Retrieves the number of engines defined for the aircraft. - inline unsigned int GetNumEngines(void) const {return (unsigned int)Engines.size();} + unsigned int GetNumEngines(void) const {return (unsigned int)Engines.size();} /** Retrieves an engine object pointer from the list of engines. @param index the engine index within the vector container @return the address of the specific engine, or zero if no such engine is available */ - inline FGEngine* GetEngine(unsigned int index) { - if (index <= Engines.size()-1) return Engines[index]; - else return 0L; } + FGEngine* GetEngine(unsigned int index) const { + if (index < Engines.size()) return Engines[index]; + else return 0L; } /// Retrieves the number of tanks defined for the aircraft. - inline unsigned int GetNumTanks(void) const {return (unsigned int)Tanks.size();} + unsigned int GetNumTanks(void) const {return (unsigned int)Tanks.size();} /** Retrieves a tank object pointer from the list of tanks. @param index the tank index within the vector container @return the address of the specific tank, or zero if no such tank is available */ - inline FGTank* GetTank(unsigned int index) { - if (index <= Tanks.size()-1) return Tanks[index]; - else return 0L; } + FGTank* GetTank(unsigned int index) const { + if (index < Tanks.size()) return Tanks[index]; + else return 0L; } /** Returns the number of fuel tanks currently actively supplying fuel */ - inline int GetnumSelectedFuelTanks(void) const {return numSelectedFuelTanks;} + int GetnumSelectedFuelTanks(void) const {return numSelectedFuelTanks;} /** Returns the number of oxidizer tanks currently actively supplying oxidizer */ - inline int GetnumSelectedOxiTanks(void) const {return numSelectedOxiTanks;} + int GetnumSelectedOxiTanks(void) const {return numSelectedOxiTanks;} /** Loops the engines until thrust output steady (used for trimming) */ bool GetSteadyState(void); @@ -157,18 +158,18 @@ public: /** Sets up the engines as running */ void InitRunning(int n); - string GetPropulsionStrings(string delimeter); - string GetPropulsionValues(string delimeter); + std::string GetPropulsionStrings(const std::string& delimiter) const; + std::string GetPropulsionValues(const std::string& delimiter) const; - 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);} + const FGColumnVector3& GetForces(void) const {return vForces; } + double GetForces(int n) const { return vForces(n);} + const FGColumnVector3& GetMoments(void) const {return vMoments;} + double GetMoments(int n) const {return vMoments(n);} - 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;} + bool GetRefuel(void) const {return refuel;} + void SetRefuel(bool setting) {refuel = setting;} + bool GetFuelDump(void) const {return dump;} + void SetFuelDump(bool setting) {dump = setting;} double Transfer(int source, int target, double amount); void DoRefuel(double time_slice); void DumpFuel(double time_slice); @@ -176,8 +177,8 @@ public: FGColumnVector3& GetTanksMoment(void); double GetTanksWeight(void); - ifstream* FindEngineFile(string filename); - string FindEngineFullPathname(string engine_filename); + 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;} double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;} @@ -190,8 +191,8 @@ public: FGMatrix33& CalculateTankInertias(void); private: - vector Engines; - vector Tanks; + std::vector Engines; + std::vector Tanks; unsigned int numSelectedFuelTanks; unsigned int numSelectedOxiTanks; unsigned int numFuelTanks;