diff --git a/src/ErgFile.cpp b/src/ErgFile.cpp index 596fb7c8c..5380f2844 100644 --- a/src/ErgFile.cpp +++ b/src/ErgFile.cpp @@ -272,8 +272,8 @@ void ErgFile::parseComputrainer(QString p) Qt::CaseInsensitive); // Lap marker in an ERG/MRC file - QRegExp lapmarker("^[ \\t]*([0-9\\.]+)[ \\t]*LAP[ \\t\\n]*$", Qt::CaseInsensitive); - QRegExp crslapmarker("^[ \\t]*LAP[ \\t\\n]*$", Qt::CaseInsensitive); + QRegExp lapmarker("^[ \\t]*([0-9\\.]+)[ \\t]*LAP[ \\t\\n]*(.*)$", Qt::CaseInsensitive); + QRegExp crslapmarker("^[ \\t]*LAP[ \\t\\n]*(.*)$", Qt::CaseInsensitive); // ok. opened ok lets parse. QTextStream inputStream(&ergFile); @@ -321,6 +321,7 @@ void ErgFile::parseComputrainer(QString p) add.x = lapmarker.cap(1).toDouble() * 60000; // from mins to 1000ths of a second add.LapNum = ++lapcounter; + add.name = lapmarker.cap(2).simplified(); Laps.append(add); } else if (crslapmarker.exactMatch(line)) { @@ -329,6 +330,7 @@ void ErgFile::parseComputrainer(QString p) add.x = rdist; add.LapNum = ++lapcounter; + add.name = lapmarker.cap(2).simplified(); Laps.append(add); } else if (settings.exactMatch(line)) { diff --git a/src/ErgFile.h b/src/ErgFile.h index 7c42fdaf6..44e3b90d9 100644 --- a/src/ErgFile.h +++ b/src/ErgFile.h @@ -60,6 +60,7 @@ class ErgFileLap public: long x; // when does this LAP marker occur? (time in msecs or distance in meters int LapNum; // from 1 - n + QString name; }; class ErgFile diff --git a/src/ErgFilePlot.cpp b/src/ErgFilePlot.cpp index 1528a072f..7e3a84a78 100644 --- a/src/ErgFilePlot.cpp +++ b/src/ErgFilePlot.cpp @@ -225,7 +225,7 @@ ErgFilePlot::setData(ErgFile *ergfile) for(int i=0; i < ergFile->Laps.count(); i++) { // Show Lap Number - QwtText text(QString::number(ergFile->Laps.at(i).LapNum)); + QwtText text(ergFile->Laps.at(i).name != "" ? ergFile->Laps.at(i).name : QString::number(ergFile->Laps.at(i).LapNum)); text.setFont(QFont("Helvetica", 10, QFont::Bold)); text.setColor(GColor(CPLOTMARKER));