From eed9bb73dec5f91e30e1ae9efd699932cb8a35b9 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Tue, 11 Feb 2014 18:16:34 +0000 Subject: [PATCH] WKO+ Interval Markers Rather than skip over the 'standard' interval markers because they have such verbose names we now plot the vertical marker only. This is to indicate there is an interval at a particular point to signpost to the user that they can hover over this point to get an interval summary. --- src/AllPlot.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index cd62d0690..55c4fcb80 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -1256,26 +1256,35 @@ AllPlot::refreshIntervalMarkers() QRegExp wkoAuto("^(Peak *[0-9]*(s|min)|Entire workout|Find #[0-9]*) *\\([^)]*\\)$"); if (rideItem->ride()) { foreach(const RideFileInterval &interval, rideItem->ride()->intervals()) { + + bool wko = false; + // skip WKO autogenerated peak intervals - if (wkoAuto.exactMatch(interval.name)) - continue; + if (wkoAuto.exactMatch(interval.name)) wko = true; + QwtPlotMarker *mrk = new QwtPlotMarker; standard->d_mrk.append(mrk); mrk->attach(this); mrk->setLineStyle(QwtPlotMarker::VLine); mrk->setLabelAlignment(Qt::AlignRight | Qt::AlignTop); - mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashDotLine)); + + if (wko) mrk->setLinePen(QPen(QColor(127,127,127,127), 0, Qt::DashLine)); + else mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashLine)); // put matches on second line down QString name(interval.name); if (interval.name.startsWith(tr("Match"))) name = QString("\n%1").arg(interval.name); - QwtText text(wanttext ? name : ""); - text.setFont(QFont("Helvetica", 10, QFont::Bold)); - if (interval.name.startsWith(tr("Match"))) - text.setColor(GColor(CWBAL)); - else - text.setColor(GColor(CPLOTMARKER)); + QwtText text(wanttext && !wko ? name : ""); + + if (!wko) { + text.setFont(QFont("Helvetica", 10, QFont::Bold)); + if (interval.name.startsWith(tr("Match"))) + text.setColor(GColor(CWBAL)); + else + text.setColor(GColor(CPLOTMARKER)); + } + if (!bydist) mrk->setValue(interval.start / 60.0, 0.0); else @@ -1302,7 +1311,7 @@ AllPlot::refreshCalibrationMarkers() mrk->attach(this); mrk->setLineStyle(QwtPlotMarker::VLine); mrk->setLabelAlignment(Qt::AlignRight | Qt::AlignTop); - mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashDotLine)); + mrk->setLinePen(QPen(GColor(CPLOTMARKER), 0, Qt::DashLine)); QwtText text(wanttext ? ("\n\n"+calibration.name) : ""); text.setFont(QFont("Helvetica", 9, QFont::Bold)); text.setColor(GColor(CPLOTMARKER));