From a7b2e3f22699eb55ef2bb698d7d9a3620d64ab24 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 28 Aug 2014 22:05:07 +0100 Subject: [PATCH] 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. --- src/FixDerivePower.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/FixDerivePower.cpp b/src/FixDerivePower.cpp index 5d03c6221..d4c1488b8 100644 --- a/src/FixDerivePower.cpp +++ b/src/FixDerivePower.cpp @@ -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