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.
This commit is contained in:
Alejandro Martinez
2021-07-03 18:47:35 -03:00
parent 6ecff9e2d1
commit fe2643eb65

View File

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