From fe2643eb65b7d8a76a6d7ed28dffef75e442c041 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Sat, 3 Jul 2021 18:47:35 -0300 Subject: [PATCH] Workout Editor - Change the representation of 1 point workout When you start with a single click the workout is represented graphically as a ramp from zero, but the qwkcode and erg code generated starts with a block. Additionally an initial ramp starting from zero neither works. This was reported at the forum and, although it is mostly cosmetic, it can be annoying, so this change fixes both. --- src/Train/WorkoutWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Train/WorkoutWidget.cpp b/src/Train/WorkoutWidget.cpp index b2ce34669..72c7e97f4 100644 --- a/src/Train/WorkoutWidget.cpp +++ b/src/Train/WorkoutWidget.cpp @@ -1808,7 +1808,7 @@ WorkoutWidget::qwkcode() // just loop through for now doing xx@yy and optionally add rxx if (points_.count() == 1) { // just a single point? - codeStrings << QString("%1@%2").arg(qduration(points_[0]->x)).arg(round(points_[0]->y)); + codeStrings << QString("%1@0-%2").arg(qduration(points_[0]->x)).arg(round(points_[0]->y)); codePoints<<0; } @@ -2159,7 +2159,7 @@ WorkoutWidget::apply(QString code) // EFFORT // add a point for starting watts if not already there - if (w1 != watts) { + if (w1 != watts || points_.isEmpty()) { index++; new WWPoint(this, secs, w1); bool addLap = laps_.isEmpty() ? secs != 0 : (laps_.last().x != secs*1000) && secs != 0;