mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user