namespace JSBSim {
-static const char *IdSrc = "$Id: FGRocket.cpp,v 1.19 2010/02/25 05:21:36 jberndt Exp $";
+static const char *IdSrc = "$Id: FGRocket.cpp,v 1.23 2011/01/24 13:01:56 jberndt Exp $";
static const char *IdHdr = ID_ROCKET;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FGRocket::FGRocket(FGFDMExec* exec, Element *el, int engine_number)
: FGEngine(exec, el, engine_number)
{
+ Type = etRocket;
Element* thrust_table_element = 0;
ThrustTable = 0L;
BurnTime = 0.0;
It = 0.0;
ThrustVariation = 0.0;
TotalIspVariation = 0.0;
+ Flameout = false;
// Defaults
MinThrottle = 0.0;
bindmodel();
Debug(0);
-
- Type = etRocket;
- Flameout = false;
-
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-double FGRocket::Calculate(void)
+void FGRocket::Calculate(void)
{
+ if (FDMExec->IntegrationSuspended()) return;
+
double dT = FDMExec->GetDeltaT()*Propulsion->GetRate();
- double thrust;
+
+ RunPreFunctions();
if (!Flameout && !Starved) ConsumeFuel();
} // End thrust calculations
- thrust = Thruster->Calculate(VacThrust);
- It += thrust * dT;
+ It += Thruster->Calculate(VacThrust) * dT;
- return thrust;
+ RunPostFunctions();
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
double Fshortage=0, Oshortage=0, TanksWithFuel=0, TanksWithOxidizer=0;
if (FuelFreeze) return;
- if (TrimMode) return;
+ if (FDMExec->GetTrimStatus()) return;
// Count how many assigned tanks have fuel for this engine at this time.
// If there is/are fuel tanks but no oxidizer tanks, this indicates
if (Tank->GetContents() > 0.0 && Tank->GetSelected() && SourceTanks[i] > 0) ++TanksWithFuel;
break;
case FGTank::ttOXIDIZER:
- if (Tank->GetContents() > 0.0 && Tank->GetSelected() && SourceTanks[i] > 0) {
+ if (Tank->GetSelected() && SourceTanks[i] > 0) {
haveOxTanks = true;
- ++TanksWithOxidizer;
+ if (Tank->GetContents() > 0.0) ++TanksWithOxidizer;
}
break;
}