Fix Derive Power fixup for auto run

.. if power is already present, or alt or speed are missing
   then the fix derive power postProcess won't try and derive
   power for the ride

.. this is so you can add it as an 'auto' tool and derive power
   values for rides that don't have power but do have speed and
   altitude.
This commit is contained in:
Mark Liversedge
2014-08-28 22:05:07 +01:00
parent ba5be12bb7
commit a7b2e3f226

View File

@@ -101,6 +101,12 @@ FixDerivePower::postProcess(RideFile *ride, DataProcessorConfig *config=0)
{
Q_UNUSED(config);
// if its already there do nothing !
if (ride->areDataPresent()->watts) return false;
// no dice if we don't have alt and speed
if (!ride->areDataPresent()->alt || !ride->areDataPresent()->kph) return false;
// Power Estimation Constants
double hRider = 1.7 ; //Height in m
double M = ride->getWeight(); //Weight kg