diff --git a/src/CPPlot.cpp b/src/CPPlot.cpp index 27c4c9330..bb0da800f 100644 --- a/src/CPPlot.cpp +++ b/src/CPPlot.cpp @@ -307,6 +307,7 @@ CPPlot::plotModel() break; case 4 : // multimodel pdModel = new MultiModel(context); + pdModel->setVariant(modelVariant); break; } @@ -519,6 +520,7 @@ CPPlot::plotModel(QVector vector, QColor plotColor, PDModel *baseline) break; case 4 : // multimodel pdmodel = new MultiModel(context); + pdmodel->setVariant(modelVariant); break; } @@ -1602,6 +1604,7 @@ CPPlot::calculateForDateRanges(QList compareDateRanges) break; case 4 : // multimodel baselineModel = new MultiModel(context); + baselineModel->setVariant(modelVariant); break; } @@ -1671,13 +1674,14 @@ CPPlot::calculateForDateRanges(QList compareDateRanges) } } - if (rideSeries == RideFile::watts) { + if (!showDelta && rideSeries == RideFile::watts) { // set ymax to nearest 100 if power int max = ymax * 1.1f; max = ((max/100) + 1) * 100; - setAxisScale(yLeft, ymin, max); + setAxisScale(yLeft, 0, max); + } else { // or just add 10% headroom diff --git a/src/PDModel.h b/src/PDModel.h index db8d19d34..faf8c6923 100644 --- a/src/PDModel.h +++ b/src/PDModel.h @@ -65,6 +65,10 @@ class PDModel : public QObject, public QwtSyntheticPointData PDModel(Context *context); + // set which variant of the model to use (if the model + // supports such a thing it needs to reimplement) + virtual void setVariant(int) {} + // set data using doubles or float always void setData(QVector meanMaxPower); void setData(QVector meanMaxPower);