From d4b9ca371c14f76b82fb3070b4ad3a0dcbf516d3 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 18 Oct 2003 20:07:46 +0000 Subject: [PATCH] Set the RPM from the property tree with each iteration. This allows a YASim prop model to start with the prop spinning. --- src/FDM/YASim/FGFDM.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/FDM/YASim/FGFDM.cpp b/src/FDM/YASim/FGFDM.cpp index 44ee1e8b3..abe884351 100644 --- a/src/FDM/YASim/FGFDM.cpp +++ b/src/FDM/YASim/FGFDM.cpp @@ -308,6 +308,8 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts) void FGFDM::getExternalInput(float dt) { + char buf[256]; + // The control axes ControlMap* cm = _airplane.getControlMap(); cm->reset(); @@ -324,6 +326,17 @@ void FGFDM::getExternalInput(float dt) WeightRec* wr = (WeightRec*)_weights.get(i); _airplane.setWeight(wr->handle, LBS2KG * fgGetFloat(wr->prop)); } + + for(i=0; i<_thrusters.size(); i++) { + EngRec* er = (EngRec*)_thrusters.get(i); + Thruster* t = er->eng; + + if(t->getPropEngine()) { + PropEngine* p = t->getPropEngine(); + sprintf(buf, "%s/rpm", er->prefix); + p->setOmega(fgGetFloat(buf) * RPM2RAD); + } + } } void FGFDM::setOutputProperties() -- 2.39.5