/******************************************************************************/
+void checkTied ( FGPropertyManager *node )
+{
+ int N = node->nChildren();
+ string name;
+
+ for (int i=0; i<N; i++) {
+ if (node->getChild(i)->nChildren() ) {
+ checkTied( (FGPropertyManager*)node->getChild(i) );
+ }
+ if ( node->getChild(i)->isTied() ) {
+ name = ((FGPropertyManager*)node->getChild(i))->GetFullyQualifiedName();
+ node->Untie(name);
+ }
+ }
+}
+
+/******************************************************************************/
+
+void FGJSBsim::unbind()
+{
+ SGPropertyNode* instance = globals->get_props()->getNode("/fdm/jsbsim");
+ checkTied((FGPropertyManager*)instance);
+ FGInterface::unbind();
+}
+
+/******************************************************************************/
+
// Run an iteration of the EOM (equations of motion)
void FGJSBsim::update( double dt )
try {
if (type == "piston_engine") {
HavePistonEngine = true;
+ if (!IsBound) bind();
Engines.push_back(new FGPiston(FDMExec, document, numEngines));
} else if (type == "turbine_engine") {
HaveTurbineEngine = true;
+ if (!IsBound) bind();
Engines.push_back(new FGTurbine(FDMExec, document, numEngines));
} else if (type == "turboprop_engine") {
HaveTurboPropEngine = true;
+ if (!IsBound) bind();
Engines.push_back(new FGTurboProp(FDMExec, document, numEngines));
} else if (type == "rocket_engine") {
HaveRocketEngine = true;
+ if (!IsBound) bind();
Engines.push_back(new FGRocket(FDMExec, document, numEngines));
} else if (type == "electric_engine") {
HaveElectricEngine = true;
+ if (!IsBound) bind();
Engines.push_back(new FGElectric(FDMExec, document, numEngines));
} else {
cerr << "Unknown engine type: " << type << endl;
if (el->FindElement("dump-rate"))
DumpRate = el->FindElementValueAsNumberConvertTo("dump-rate", "LBS/MIN");
- if (!IsBound) bind();
PostLoad(el, PropertyManager);
return true;
typedef int (FGPropulsion::*iPMF)(void) const;
IsBound = true;
- PropertyManager->Tie("propulsion/set-running", this, (iPMF)0, &FGPropulsion::InitRunning, true);
+ PropertyManager->Tie("propulsion/set-running", this, (iPMF)0, &FGPropulsion::InitRunning, false);
if (HaveTurbineEngine) {
PropertyManager->Tie("propulsion/starter_cmd", this, (iPMF)0, &FGPropulsion::SetStarter, true);
PropertyManager->Tie("propulsion/cutoff_cmd", this, (iPMF)0, &FGPropulsion::SetCutoff, true);