From: david Date: Sat, 19 Jan 2002 18:24:02 +0000 (+0000) Subject: - fixed fuel-need calculations X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2008529299e7ec7aed1e87d1e8ad4d2f3b2d380f;p=flightgear.git - fixed fuel-need calculations - stop engine when no fuel is available --- diff --git a/src/FDM/JSBSim/FGPiston.cpp b/src/FDM/JSBSim/FGPiston.cpp index 56f511a47..b8eb6a5ef 100644 --- a/src/FDM/JSBSim/FGPiston.cpp +++ b/src/FDM/JSBSim/FGPiston.cpp @@ -136,7 +136,6 @@ FGPiston::~FGPiston() double FGPiston::Calculate(double PowerRequired) { - // FIXME: calculate from actual fuel flow ConsumeFuel(); Throttle = FCS->GetThrottlePos(EngineNumber); @@ -180,9 +179,6 @@ double FGPiston::Calculate(double PowerRequired) void FGPiston::doEngineStartup(void) { - // TODO: check magnetos, spark, starter, etc. and decide whether - // engine is running - // Check parameters that may alter the operating state of the engine. // (spark, fuel, starter motor etc) bool spark; @@ -206,7 +202,7 @@ void FGPiston::doEngineStartup(void) if (Magnetos > 1) Magneto_Right = true; // Assume we have fuel for now - fuel = true; + fuel = !Starved; // Check if we are turning the starter motor if (Cranking != Starter) { @@ -586,6 +582,5 @@ void FGPiston::Debug(int from) double FGPiston::CalcFuelNeed(void) { - // FIXME: is this right? - return FuelFlow_gph * State->Getdt() * Propulsion->GetRate(); + return FuelFlow_gph / 3600 * State->Getdt() * Propulsion->GetRate(); }