From 8c65721333fefc7aeae24f5251c7906d46dc9ec9 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sat, 20 Aug 2011 17:24:06 +0100 Subject: [PATCH] Reinstate CP/AWC CP curve parameters on CP plot --- src/CpintPlot.cpp | 6 ++++++ src/CpintPlot.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/CpintPlot.cpp b/src/CpintPlot.cpp index a41bd4c08..b25d146bb 100644 --- a/src/CpintPlot.cpp +++ b/src/CpintPlot.cpp @@ -76,6 +76,10 @@ CpintPlot::CpintPlot(MainWindow *main, QString p, const Zones *zones) : grid->enableX(true); grid->attach(this); + curveTitle.attach(this); + curveTitle.setXValue(5); + curveTitle.setYValue(20); + zoomer = new penTooltip(this->canvas()); zoomer->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier); @@ -341,6 +345,7 @@ CpintPlot::plot_CP_curve(CpintPlot *thisPlot, // the plot we're currently di #else curve_title.sprintf("CP=%.0f W; AWC=%.0f kJ", cp, cp * tau * 60.0 / 1000.0); #endif + if (series == RideFile::watts) curveTitle.setLabel(QwtText(curve_title, QwtText::PlainText)); CPCurve = new QwtPlotCurve(curve_title); if (appsettings->value(this, GC_ANTIALIAS, false).toBool() == true) @@ -506,6 +511,7 @@ CpintPlot::calculate(RideItem *rideItem) // // PLOT MODEL CURVE (DERIVED) // + curveTitle.setLabel(QwtText("", QwtText::PlainText)); // default to no title if (series == RideFile::xPower || series == RideFile::NP || series == RideFile::watts || series == RideFile::none) { if (bests->meanMaxArray(series).size() > 1) { diff --git a/src/CpintPlot.h b/src/CpintPlot.h index 1a3ca1ac0..701977263 100644 --- a/src/CpintPlot.h +++ b/src/CpintPlot.h @@ -24,6 +24,7 @@ #include #include +#include #include class QwtPlotCurve; @@ -108,6 +109,7 @@ class CpintPlot : public QwtPlot QwtPlotCurve *CPCurve; QList allCurves; QwtPlotCurve *allCurve; // bests but not zoned + QwtPlotMarker curveTitle; QList allZoneLabels; void clear_CP_Curves(); QStringList filterForSeason(QStringList cpints, QDate startDate, QDate endDate);