mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 00:49:55 +00:00
CPPlot Show Best Option
.. sometimes its useful just to see the model and not the bests curve. So added an option to get rid of the bests curve and show the model on its own.
This commit is contained in:
@@ -54,8 +54,10 @@ CPPlot::CPPlot(QWidget *parent, Context *context, bool rangemode) : QwtPlot(pare
|
||||
model(0), modelVariant(0),
|
||||
|
||||
// state
|
||||
context(context), rideCache(NULL), bestsCache(NULL), rideSeries(RideFile::watts), isFiltered(false), shadeMode(2),
|
||||
shadeIntervals(true), rangemode(rangemode), showPercent(false), showHeat(false), showHeatByDate(false),
|
||||
context(context), rideCache(NULL), bestsCache(NULL), rideSeries(RideFile::watts),
|
||||
isFiltered(false), shadeMode(2),
|
||||
shadeIntervals(true), rangemode(rangemode),
|
||||
showBest(true), showPercent(false), showHeat(false), showHeatByDate(false),
|
||||
plotType(0),
|
||||
|
||||
// curves and plot objects
|
||||
@@ -327,7 +329,7 @@ CPPlot::plotModel()
|
||||
QPen pen(GColor(CCP));
|
||||
double width = appsettings->value(this, GC_LINEWIDTH, 1.0).toDouble();
|
||||
pen.setWidth(width);
|
||||
pen.setStyle(Qt::DashLine);
|
||||
if (showBest) pen.setStyle(Qt::DashLine);
|
||||
modelCurve->setPen(pen);
|
||||
modelCurve->attach(this);
|
||||
|
||||
@@ -575,6 +577,7 @@ CPPlot::plotBests()
|
||||
work[t] = values[t] * t / 1000; // kJ not Joules
|
||||
}
|
||||
|
||||
if (showBest) {
|
||||
if (shadingCP == 0) {
|
||||
|
||||
// PLAIN CURVE
|
||||
@@ -758,6 +761,7 @@ CPPlot::plotBests()
|
||||
++zone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// X-AXIS
|
||||
@@ -998,7 +1002,7 @@ CPPlot::setRide(RideItem *rideItem)
|
||||
void
|
||||
CPPlot::pointHover(QwtPlotCurve *curve, int index)
|
||||
{
|
||||
if (curve == modelCurve) return; // ignore model curve hover
|
||||
if (showBest && curve == modelCurve) return; // ignore model curve hover
|
||||
|
||||
if (index >= 0) {
|
||||
|
||||
@@ -1103,6 +1107,13 @@ CPPlot::setShowHeat(bool x)
|
||||
clearCurves();
|
||||
}
|
||||
|
||||
void
|
||||
CPPlot::setShowBest(bool x)
|
||||
{
|
||||
showBest = x;
|
||||
clearCurves();
|
||||
}
|
||||
|
||||
void
|
||||
CPPlot::setShowPercent(bool x)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user