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 <mail@mail.com>
This commit is contained in:
peret2000
2021-10-26 19:42:13 +02:00
committed by GitHub
parent 3f66fec5f7
commit 1ead8e0922

View File

@@ -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;
}