static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_PROPULSION;
+extern short debug_lvl;
+
+#if defined (__APPLE__)
+/* Not all systems have the gcvt function */
+inline char* gcvt (double value, int ndigits, char *buf) {
+ /* note that this is not exactly what gcvt is supposed to do! */
+ snprintf (buf, ndigits+1, "%f", value);
+ return buf;
+}
+#endif
+
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
numSelectedFuelTanks = numSelectedOxiTanks = 0;
numTanks = numEngines = numThrusters = 0;
numOxiTanks = numFuelTanks = 0;
+ dt = 0.0;
bind();
Debug(0);
}
PowerAvailable = Engines[i]->Calculate(Thrusters[i]->GetPowerRequired());
lastThrust = currentThrust;
currentThrust = Thrusters[i]->Calculate(PowerAvailable);
- if(fabs(lastThrust-currentThrust) < 0.0001) {
+ if (fabs(lastThrust-currentThrust) < 0.0001) {
steady_count++;
- if(steady_count > 120) { steady=true; }
+ if (steady_count > 120) { steady=true; }
} else {
steady_count=0;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-FGColumnVector3& FGPropulsion::GetTanksCG(void)
+FGColumnVector3& FGPropulsion::GetTanksMoment(void)
{
iTank = Tanks.begin();
vXYZtank.InitMatrix();
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-void FGPropulsion::bind(void){
+void FGPropulsion::bind(void)
+{
+ typedef double (FGPropulsion::*PMF)(int) const;
/* PropertyManager->Tie("propulsion/num-engines", this,
&FGPropulsion::GetNumEngines);
PropertyManager->Tie("propulsion/num-tanks", this,
PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
&FGPropulsion::GetnumSelectedOxiTanks);
PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
- &FGPropulsion::GetForces);
+ (PMF)&FGPropulsion::GetForces);
PropertyManager->Tie("forces/fby-prop-lbs", this,2,
- &FGPropulsion::GetForces);
+ (PMF)&FGPropulsion::GetForces);
PropertyManager->Tie("forces/fbz-prop-lbs", this,3,
- &FGPropulsion::GetForces);
+ (PMF)&FGPropulsion::GetForces);
PropertyManager->Tie("moments/l-prop-lbsft", this,1,
- &FGPropulsion::GetMoments);
+ (PMF)&FGPropulsion::GetMoments);
PropertyManager->Tie("moments/m-prop-lbsft", this,2,
- &FGPropulsion::GetMoments);
+ (PMF)&FGPropulsion::GetMoments);
PropertyManager->Tie("moments/n-prop-lbsft", this,3,
- &FGPropulsion::GetMoments);
+ (PMF)&FGPropulsion::GetMoments);
//PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
// &FGPropulsion::GetTanksWeight);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-void FGPropulsion::unbind(void){
+void FGPropulsion::unbind(void)
+{
/* PropertyManager->Untie("propulsion/num-engines");
PropertyManager->Untie("propulsion/num-tanks"); */
PropertyManager->Untie("propulsion/num-sel-fuel-tanks");