41 #include "FGThruster.h" 42 #include "input_output/FGXMLElement.h" 48 IDENT(IdSrc,
"$Id: FGThruster.cpp,v 1.22 2015/09/27 10:03:53 bcoconni Exp $");
49 IDENT(IdHdr,ID_THRUSTER);
63 SetTransformType(FGForce::tCustom);
74 element = thruster_element->
FindElement(
"location");
76 else cerr <<
fgred <<
" No thruster location found." <<
reset << endl;
78 SetLocation(location);
80 string property_name, base_property_name;
81 base_property_name = CreateIndexedPropertyName(
"propulsion/engine", EngineNum);
83 element = thruster_element->
FindElement(
"pointing");
90 mT(1,1) = pointing(1);
91 mT(2,1) = pointing(2);
92 mT(3,1) = pointing(3);
99 SetAnglesToBody(orientation);
100 property_name = base_property_name +
"/pitch-angle-rad";
101 PropertyManager->
Tie( property_name.c_str(), (
FGForce *)
this, &FGForce::GetPitch, &FGForce::SetPitch);
102 property_name = base_property_name +
"/yaw-angle-rad";
103 PropertyManager->
Tie( property_name.c_str(), (
FGForce *)
this, &FGForce::GetYaw, &FGForce::SetYaw);
108 property_name = base_property_name +
"/reverser-angle-rad";
109 PropertyManager->
Tie( property_name.c_str(), (
FGThruster *)
this, &FGThruster::GetReverserAngle,
110 &FGThruster::SetReverserAngle);
129 void FGThruster::ResetToIC(
void)
138 string FGThruster::GetThrusterLabels(
int id,
const string& delimeter)
140 std::ostringstream buf;
142 buf << Name <<
" Thrust (engine " <<
id <<
" in lbs)";
149 string FGThruster::GetThrusterValues(
int id,
const string& delimeter)
151 std::ostringstream buf;
177 void FGThruster::Debug(
int from)
179 if (debug_lvl <= 0)
return;
186 if (debug_lvl & 2 ) {
187 if (from == 0) cout <<
"Instantiated: FGThruster" << endl;
188 if (from == 1) cout <<
"Destroyed: FGThruster" << endl;
190 if (debug_lvl & 4 ) {
192 if (debug_lvl & 8 ) {
194 if (debug_lvl & 16) {
196 if (debug_lvl & 64) {
198 cout << IdSrc << endl;
199 cout << IdHdr << endl;
Element * GetParent(void)
Returns a pointer to the parent of an element.
void SetActingLocation(double x, double y, double z)
Acting point of application.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
static char reset[5]
resets text properties
Element * FindElement(const std::string &el="")
Searches for a specified element.
Base class for specific thrusting devices such as propellers, nozzles, etc.
virtual ~FGThruster()
Destructor.
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
static char fgred[6]
red text
void Tie(const std::string &name, bool *pointer, bool useDefault=true)
Tie a property to an external bool variable.
const std::string & GetName(void) const
Retrieves the element name.
This class implements a 3 element column vector.
void InitMatrix(void)
Initialize the matrix.
Encapsulates the JSBSim simulation executive.
Utility class that aids in the conversion of forces between coordinate systems and calculation of mom...
FGColumnVector3 FindElementTripletConvertTo(const std::string &target_units)
Composes a 3-element column vector for the supplied location or orientation.