From d3cafc4aed01183a353dd4a7f85dbc7cb1bcb545 Mon Sep 17 00:00:00 2001 From: Ale Martinez Date: Sat, 31 Oct 2020 19:01:55 -0300 Subject: [PATCH] Fix laps in crs files generated by Workout Wizard Fixes #3652 --- src/Train/WorkoutWizard.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Train/WorkoutWizard.cpp b/src/Train/WorkoutWizard.cpp index 6ee73868b..0d3dc4686 100644 --- a/src/Train/WorkoutWizard.cpp +++ b/src/Train/WorkoutWizard.cpp @@ -615,9 +615,16 @@ void GradientPage::SaveWorkout() QPair p; foreach (p,rawData) { - // header indicates metric units, so convert accordingly - double currentX = p.first.toDouble()*(metricUnits ? 1.0 : KM_PER_MILE); - stream << currentX << " " << p.second << " 0" << endl; + if(p.first == "LAP") + { + stream << "LAP" << endl; + } + else + { + // header indicates metric units, so convert accordingly + double currentX = p.first.toDouble()*(metricUnits ? 1.0 : KM_PER_MILE); + stream << currentX << " " << p.second << " 0" << endl; + } } stream << "[END COURSE DATA]" << endl; f.close();