From 1ead8e0922bd0956609a862ebb5a6d15a05ebf30 Mon Sep 17 00:00:00 2001 From: peret2000 <19463568+peret2000@users.noreply.github.com> Date: Tue, 26 Oct 2021 19:42:13 +0200 Subject: [PATCH] Estimate Power: corrected adjustment of CdA when not set (#4051) When CdA is not set, it is estimated at every sample, using cadence. Beforehand, it was computed with the first sample Co-authored-by: Peret --- src/FileIO/FixDerivePower.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FileIO/FixDerivePower.cpp b/src/FileIO/FixDerivePower.cpp index 9270b1c16..7e58ccb35 100644 --- a/src/FileIO/FixDerivePower.cpp +++ b/src/FileIO/FixDerivePower.cpp @@ -230,6 +230,7 @@ FixDerivePower::postProcess(RideFile *ride, DataProcessorConfig *config=0, QStri windSpeed = ((FixDerivePowerConfig*)(config))->windSpeed->value(); // kph windHeading = ((FixDerivePowerConfig*)(config))->windHeading->value() / 180 * MATHCONST_PI; // rad } + bool CdANotSet = (CdA == 0.0); // Do nothing for swims and runs if (ride->isSwim() || ride->isRun()) return false; @@ -307,7 +308,7 @@ FixDerivePower::postProcess(RideFile *ride, DataProcessorConfig *config=0, QStri double vw=V+W; // Wind speed against cyclist = cyclist speed + wind speed - if (CdA == 0) { + if (CdANotSet) { double CwaRider = (1 + cad * cCad) * afCd * adipos * (((hRider - adipos) * afSin) + adipos); CdA = CwaRider + CwaBike; }