AllPlot: Add secondary Scope to plot speed and headwind in the same together

This commit is contained in:
Damien
2013-12-26 15:39:47 +01:00
parent 7d00cba9df
commit 0fa9aec9cd
3 changed files with 11 additions and 4 deletions

View File

@@ -228,7 +228,7 @@ class TimeScaleDraw: public QwtScaleDraw
static inline double
max(double a, double b) { if (a > b) return a; else return b; }
AllPlot::AllPlot(AllPlotWindow *parent, Context *context, RideFile::SeriesType scope, bool wanttext):
AllPlot::AllPlot(AllPlotWindow *parent, Context *context, RideFile::SeriesType scope, RideFile::SeriesType secScope, bool wanttext):
QwtPlot(parent),
rideItem(NULL),
shade_zones(true),
@@ -246,6 +246,7 @@ AllPlot::AllPlot(AllPlotWindow *parent, Context *context, RideFile::SeriesType s
showBalance(true),
bydist(false),
scope(scope),
secondaryScope(secScope),
context(context),
parent(parent),
wanttext(wanttext)
@@ -1762,6 +1763,10 @@ AllPlot::setDataFromPlot(AllPlot *plot)
{
ourCurve = speedCurve;
thereCurve = referencePlot->speedCurve;
if (secondaryScope == RideFile::headwind) {
ourICurve = windCurve;
thereICurve = referencePlot->windCurve;
}
title = tr("Speed");
}
break;