mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix intervals in Compare Pane are 1 sample short
The fake rides created for intervals in Compare Pane don't include the last sample, so they are 1 sample short and 1 sec intervals don't appear. WPrime calculations are avoided when the ride has only 1 sample to avoid crashes, besides it doesn't make any sense. Fixes #4552
This commit is contained in:
@@ -699,7 +699,7 @@ ComparePane::dropEvent(QDropEvent *event)
|
||||
|
||||
foreach(RideFilePoint *p, ride->dataPoints()) {
|
||||
|
||||
if (p->secs >= stop) break;
|
||||
if (p->secs > stop) break;
|
||||
|
||||
if (p->secs >= start) {
|
||||
|
||||
@@ -746,7 +746,7 @@ ComparePane::dropEvent(QDropEvent *event)
|
||||
|
||||
foreach(XDataPoint *p, xi.value()->datapoints) {
|
||||
|
||||
if (p->secs >= stop) break;
|
||||
if (p->secs > stop) break;
|
||||
|
||||
if (p->secs >= start) {
|
||||
|
||||
|
||||
@@ -123,8 +123,8 @@ WPrime::setRide(RideFile *input)
|
||||
|
||||
EXP = PCP_ = CP = WPRIME = TAU=0;
|
||||
|
||||
// no data or no power data then forget it.
|
||||
if (!input || input->dataPoints().count() == 0 || input->areDataPresent()->watts == false) {
|
||||
// less than 2 samples or no power data then forget it.
|
||||
if (!input || input->dataPoints().count() < 2 || input->areDataPresent()->watts == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user