108 throw(
"No such source tank is available for this engine");
157 }
else if (thruster_element->
FindElement(
"nozzle")) {
160 }
else if (thruster_element->
FindElement(
"rotor")) {
163 }
else if (thruster_element->
FindElement(
"direct")) {
167 cerr << thruster_element->
ReadFrom() <<
" Unknown thruster type" << endl;
168 throw(
"Failed to load the thruster");
191 local_element = parent_element->
FindElement(
"location");
194 <<
"Engine location ignored, only thruster location is used." << endl;
196 local_element = parent_element->
FindElement(
"orient");
199 <<
"Engine orientation ignored, only thruster orientation is used." << endl;
202 local_element = parent_element->
FindElement(
"thruster");
206 }
catch (std::string& str) {
207 throw(
"Error loading engine " +
Name +
". " + str);
210 cerr <<
"No thruster definition supplied with engine definition." << endl;
216 local_element = parent_element->
FindElement(
"feed");
217 while (local_element) {
223 string property_name, base_property_name;
226 property_name = base_property_name +
"/set-running";
228 property_name = base_property_name +
"/thrust-lbs";
230 property_name = base_property_name +
"/fuel-flow-rate-pps";
232 property_name = base_property_name +
"/fuel-flow-rate-gph";
234 property_name = base_property_name +
"/fuel-used-lbs";
272 cout <<
" X = " <<
Thruster->GetLocationX() << endl;
273 cout <<
" Y = " <<
Thruster->GetLocationY() << endl;
274 cout <<
" Z = " <<
Thruster->GetLocationZ() << endl;
280 if (from == 0) cout <<
"Instantiated: FGEngine" << endl;
281 if (from == 1) cout <<
"Destroyed: FGEngine" << endl;
std::string ReadFrom(void) const
Return a string that contains a description of the location where the current XML element was read fr...
Element * GetParent(void)
Returns a pointer to the parent of an element.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
double GetDataAsNumber(void)
Converts the element data to a number.
Element * FindElement(const std::string &el="")
Searches for a specified element.
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
This class implements a 3 element column vector.
virtual double GetThrust(void) const
virtual bool GetRunning(void) const
virtual const FGColumnVector3 & GetMoments(void)
bool Load(FGFDMExec *exec, Element *el)
void LoadThruster(FGFDMExec *exec, Element *el)
unsigned int GetSourceTank(unsigned int i) const
std::vector< int > SourceTanks
virtual double CalcFuelNeed(void)
The fuel need is calculated based on power levels and flow rate for that power level.
void LoadThrusterInputs()
virtual void SetRunning(bool bb)
FGEngine(int engine_number, struct Inputs &input)
virtual double GetFuelFlowRateGPH(void) const
virtual const FGColumnVector3 & GetBodyForces(void)
virtual double GetFuelFlowRate(void) const
virtual void ResetToIC(void)
Resets the Engine parameters to the initial conditions.
virtual double GetFuelUsedLbs(void) const
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
static constexpr double radtodeg
static std::string CreateIndexedPropertyName(const std::string &Property, int index)
void PostLoad(Element *el, FGFDMExec *fdmex, std::string prefix="")
bool Load(Element *el, FGFDMExec *fdmex, std::string prefix="")
FGPropeller models a propeller given the tabular data for Ct (thrust) and Cp (power),...
void Tie(const std::string &name, T *pointer)
Tie a property to an external variable.
Models a helicopter rotor.
Base class for specific thrusting devices such as propellers, nozzles, etc.
double GetThrust(void) const