}
_airplane.calcFuelWeights();
- setOutputProperties();
+ setOutputProperties(dt);
}
Airplane* FGFDM::getAirplane()
}
}
-void FGFDM::setOutputProperties()
+// Linearly "seeks" a property by the specified fraction of the way to
+// the target value. Used to emulate "slowly changing" output values.
+static void moveprop(SGPropertyNode* node, const char* prop,
+ float target, float frac)
+{
+ float val = node->getFloatValue(prop);
+ if(frac > 1) frac = 1;
+ if(frac < 0) frac = 0;
+ val += (target - val) * frac;
+ node->setFloatValue(prop, val);
+}
+
+void FGFDM::setOutputProperties(float dt)
{
// char buf[256];
int i;
node->setFloatValue("epr", j->getEPR());
node->setFloatValue("egr-degf",
j->getEGT() * K2DEGF + K2DEGFOFFSET);
+
+ // These are "unmodeled" values that are still needed for
+ // many cockpits. Tie them all to the N1 speed, but
+ // normalize the numbers to the range [0:1] so the
+ // cockpit code can scale them to the right values.
+ float pnorm = j->getPerfNorm();
+ moveprop(node, "oilp-norm", pnorm, dt/3); // 3s seek time
+ moveprop(node, "oilt-norm", pnorm, dt/30); // 30s
+ moveprop(node, "itt-norm", pnorm, dt/1); // 1s
}
}
}
struct PropOut { SGPropertyNode* prop; int handle, type; bool left;
float min, max; };
- void setOutputProperties();
+ void setOutputProperties(float dt);
Rotor* parseRotor(XMLAttributes* a, const char* name);
Wing* parseWing(XMLAttributes* a, const char* name);