]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPiston.cpp
Fixes from Cameron Moore:
[flightgear.git] / src / FDM / JSBSim / FGPiston.cpp
index 56f511a479e11b2e9785dbbfc1c504b276a3772a..b8eb6a5efe40a08aa98e13dfaf85a54db880dcb2 100644 (file)
@@ -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();
 }