 |
JSBSim Flight Dynamics Model
1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
|
34 #ifndef FGPROPULSION_H
35 #define FGPROPULSION_H
44 #include "simgear/props/propertyObject.hxx"
46 #include "propulsion/FGEngine.h"
47 #include "math/FGMatrix33.h"
116 bool Run(
bool Holding)
override;
118 bool InitModel(
void)
override;
127 unsigned int GetNumEngines(
void)
const {
return (
unsigned int)Engines.size();}
134 if (index < Engines.size())
return Engines[index];
138 unsigned int GetNumTanks(
void)
const {
return (
unsigned int)Tanks.size();}
145 if (index < Tanks.size())
return Tanks[index];
160 std::string GetPropulsionStrings(
const std::string& delimiter)
const;
161 std::string GetPropulsionValues(
const std::string& delimiter)
const;
162 std::string GetPropulsionTankReport();
165 double GetForces(
int n)
const {
return vForces(n);}
166 const FGColumnVector3& GetMoments(
void)
const {
return vMoments;}
167 double GetMoments(
int n)
const {
return vMoments(n);}
169 double Transfer(
int source,
int target,
double amount);
170 void DoRefuel(
double time_slice);
171 void DumpFuel(
double time_slice);
173 const FGColumnVector3& GetTanksMoment(
void);
174 double GetTanksWeight(
void)
const;
176 SGPath FindFullPathName(
const SGPath& path)
const override;
177 inline int GetActiveEngine(
void)
const {
return ActiveEngine;}
178 inline bool GetFuelFreeze(
void)
const {
return FuelFreeze;}
180 void SetMagnetos(
int setting);
181 void SetStarter(
int setting);
182 int GetStarter(
void)
const;
183 void SetCutoff(
int setting=0);
184 int GetCutoff(
void)
const;
185 void SetActiveEngine(
int engine);
186 void SetFuelFreeze(
bool f);
187 const FGMatrix33& CalculateTankInertias(
void);
189 struct FGEngine::Inputs in;
192 std::vector <FGEngine*> Engines;
193 std::vector <FGTank*> Tanks;
194 unsigned int numSelectedFuelTanks;
195 unsigned int numSelectedOxiTanks;
196 unsigned int numFuelTanks;
197 unsigned int numOxiTanks;
198 unsigned int numEngines;
199 unsigned int numTanks;
201 FGColumnVector3 vForces;
202 FGColumnVector3 vMoments;
203 FGColumnVector3 vTankXYZ;
204 FGColumnVector3 vXYZtank_arm;
206 simgear::PropertyObject<bool> refuel;
207 simgear::PropertyObject<bool> dump;
209 simgear::PropertyObject<double> TotalFuelQuantity;
210 simgear::PropertyObject<double> TotalOxidizerQuantity;
214 bool HavePistonEngine;
215 bool HaveTurbineEngine;
216 bool HaveTurboPropEngine;
217 bool HaveRocketEngine;
218 bool HaveElectricEngine;
219 void ConsumeFuel(FGEngine* engine);
224 void Debug(
int from)
override;
Encapsulates the JSBSim simulation executive.
This class implements a 3 element column vector.
Base class for all scheduled JSBSim models.
FGPropulsion(FGFDMExec *)
Constructor.
FGEngine * GetEngine(unsigned int index) const
Retrieves an engine object pointer from the list of engines.
bool GetSteadyState(void)
Loops the engines until thrust output steady (used for trimming)
unsigned int GetNumTanks(void) const
Retrieves the number of tanks defined for the aircraft.
int GetnumSelectedFuelTanks(void) const
Returns the number of fuel tanks currently actively supplying fuel.
void InitRunning(int n)
Sets up the engines as running.
unsigned int GetNumEngines(void) const
Retrieves the number of engines defined for the aircraft.
FGTank * GetTank(unsigned int index) const
Retrieves a tank object pointer from the list of tanks.
bool Run(bool Holding) override
Executes the propulsion model.
Propulsion management class.
int GetnumSelectedOxiTanks(void) const
Returns the number of oxidizer tanks currently actively supplying oxidizer.
Base class for all engines.
~FGPropulsion() override
Destructor.
bool Load(Element *el) override
Loads the propulsion system (engine[s] and tank[s]).