From b8ee673fd718c5bf2c1879cc5e87a1e5a3bf0c7d Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 24 Jul 2014 09:29:53 +0100 Subject: [PATCH] AllPlot Calibration Markers Tweak .. only show them on power plots .. don't show text .. make them /really/ faint NOTE: This is because crank based powermeters (e.g. SRM) will send calibration messages every time you freewheel for 3 secs or more and modern headunits (e.g. Nav2Coach) will record and adopt them. As you can guess, I have an N2C + SRMs and get > 20 or 30 calibrations every ride with the latest N2C firmware, so this one is for me. --- src/AllPlot.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 2104a8e18..17a8db261 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -1715,6 +1715,13 @@ AllPlot::refreshCalibrationMarkers() } standard->cal_mrk.clear(); + // only on power based charts + if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && scope != RideFile::anTISS && + scope != RideFile::NP && scope != RideFile::aPower && scope != RideFile::xPower) return; + + QColor color = GColor(CPOWER); + color.setAlpha(15); // almost invisble ! + if (rideItem && rideItem->ride()) { foreach(const RideFileCalibration &calibration, rideItem->ride()->calibrations()) { QwtPlotMarker *mrk = new QwtPlotMarker; @@ -1722,16 +1729,18 @@ AllPlot::refreshCalibrationMarkers() mrk->attach(this); mrk->setLineStyle(QwtPlotMarker::VLine); mrk->setLabelAlignment(Qt::AlignRight | Qt::AlignTop); - mrk->setLinePen(QPen(Qt::gray, 0, Qt::DashLine)); - QwtText text(wanttext ? ("\n\n"+calibration.name) : ""); - text.setFont(QFont("Helvetica", 9, QFont::Bold)); - text.setColor(Qt::gray); + mrk->setLinePen(QPen(color, 0, Qt::SolidLine)); if (!bydist) mrk->setValue(calibration.start / 60.0, 0.0); else mrk->setValue((context->athlete->useMetricUnits ? 1 : MILES_PER_KM) * rideItem->ride()->timeToDistance(calibration.start), 0.0); - mrk->setLabel(text); + + //Lots of markers can clutter things, so avoid texts for now + //QwtText text(false ? ("\n\n"+calibration.name) : ""); + //text.setFont(QFont("Helvetica", 9, QFont::Bold)); + //text.setColor(Qt::gray); + //mrk->setLabel(text); } } }