Fix Average Speed aggregation

It didn't set count so it defaulted to duration,
when it should use Moving Time for that purpose.
Also changed Recovery Points to 2*ln(RMSSD).
This commit is contained in:
Alejandro Martinez
2024-04-28 15:48:53 -03:00
parent 62993743d9
commit 76dedfb482
3 changed files with 5 additions and 2 deletions

View File

@@ -1055,6 +1055,7 @@ class AvgSpeed : public RideMetric {
}
setValue(secsMoving ? km / secsMoving * 3600.0 : 0.0);
setCount(secsMoving);
} else {
@@ -1062,6 +1063,7 @@ class AvgSpeed : public RideMetric {
assert(deps.contains("workout_time"));
secsMoving = deps.value("workout_time")->value(true);
setValue(secsMoving ? km / secsMoving * 3600.0 : 0.0);
setCount(secsMoving);
}
}

View File

@@ -827,7 +827,7 @@ public:
if (item->getHrvMeasure("RECOVERY_POINTS") > 0)
setValue(item->getHrvMeasure("RECOVERY_POINTS"));
else if (item->getHrvMeasure("RMSSD") > 0)
setValue(1.5 * log(item->getHrvMeasure("RMSSD")) + 2);
setValue(2 * log(item->getHrvMeasure("RMSSD")));
else
setValue(0.0);
setCount(0);

View File

@@ -166,8 +166,9 @@
// 156 18 Mar 2021 Ale Martinez Added Time and % in Zones I, II and III
// 157 27 May 2021 Ale Martinez Added Pace Row
// 158 28 Feb 2024 Ale Martinez Enabled Pace for Walking
// 159 28 Apr 2024 Ale Martinez Fix Avg Speed aggregation
int DBSchemaVersion = 158;
int DBSchemaVersion = 159;
RideMetricFactory *RideMetricFactory::_instance;
QVector<QString> RideMetricFactory::noDeps;