Show Daily Stress on Performance Plot

Since the daily stress values are readily available
from the stress calculator this patch shows them on the
chart to show the make-up of the training that has resulted
in th short term and long term stress scores.

Ideally, we would also show the relative intensity for each day
too so you can view, at a glance, the intensity AND volume of the
ongoing training load -- but the intensity is not readily available
in the calculator or the stress.cache file.
This commit is contained in:
Mark Liversedge
2010-01-03 14:16:16 +00:00
committed by Sean Rhea
parent 1b849c501b
commit de86047992
3 changed files with 21 additions and 2 deletions

View File

@@ -28,7 +28,7 @@
#include "PerfPlot.h"
#include "StressCalculator.h"
PerfPlot::PerfPlot() : STScurve(NULL), LTScurve(NULL), SBcurve(NULL)
PerfPlot::PerfPlot() : STScurve(NULL), LTScurve(NULL), SBcurve(NULL), DAYcurve(NULL)
{
@@ -36,6 +36,8 @@ PerfPlot::PerfPlot() : STScurve(NULL), LTScurve(NULL), SBcurve(NULL)
setCanvasBackground(Qt::white);
setAxisTitle(yLeft, "Stress (BS/Day)");
setAxisTitle(xBottom, "Time (days)");
setAxisTitle(yRight, "Stress (Daily)");
enableAxis(yRight, true);
grid = new QwtPlotGrid();
grid->enableX(false);
@@ -83,6 +85,20 @@ void PerfPlot::plot() {
setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw(startDate));
if (DAYcurve) {
DAYcurve->detach();
delete DAYcurve;
}
DAYcurve = new QwtPlotCurve(tr("Daily"));
DAYcurve->setRenderHint(QwtPlotItem::RenderAntialiased);
QPen daypen = QPen(Qt::lightGray);
daypen.setWidth(1.0);
DAYcurve->setPen(daypen);
DAYcurve->setStyle(QwtPlotCurve::Sticks);
DAYcurve->setData(_sc->getDays()+xmin,_sc->getDAYvalues()+xmin,num);
DAYcurve->setYAxis(yRight);
DAYcurve->attach(this);
if (STScurve) {
STScurve->detach();
delete STScurve;