namespace JSBSim {
-static const char *IdSrc = "$Id: FGEngine.cpp,v 1.38 2010/06/02 04:05:13 jberndt Exp $";
+static const char *IdSrc = "$Id: FGEngine.cpp,v 1.40 2010/10/15 11:32:41 jberndt Exp $";
static const char *IdHdr = ID_ENGINE;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Name = engine_element->GetAttributeValue("name");
+ Load(engine_element, PropertyManager, to_string(EngineNumber)); // Call ModelFunctions loader
+
// Find and set engine location
local_element = engine_element->GetParent()->FindElement("location");
// Load thruster
local_element = engine_element->GetParent()->FindElement("thruster");
if (local_element) {
- if (!LoadThruster(local_element)) exit(-1);
+ try {
+ if (!LoadThruster(local_element)) exit(-1);
+ } catch (std::string str) {
+ throw("Error loading engine " + Name + ". " + str);
+ }
} else {
cerr << "No thruster definition supplied with engine definition." << endl;
}
property_name = base_property_name + "/fuel-flow-rate-pps";
PropertyManager->Tie( property_name.c_str(), this, &FGEngine::GetFuelFlowRate);
+ PostLoad(engine_element, PropertyManager, to_string(EngineNumber));
+
//cout << "Engine[" << EngineNumber << "] using fuel density: " << FuelDensity << endl;
Debug(0);