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 f42a093d4d
commit 12230958d6
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;

View File

@@ -57,7 +57,7 @@ class PerfPlot : public QwtPlot
private:
QwtPlotGrid *grid;
QwtPlotCurve *STScurve, *LTScurve, *SBcurve;
QwtPlotCurve *STScurve, *LTScurve, *SBcurve, *DAYcurve;
int days;
QDateTime startDate;
StressCalculator *_sc;
@@ -68,6 +68,7 @@ class PerfPlot : public QwtPlot
double getSTS(int i) { return STScurve->y(i - xmin); }
double getLTS(int i) { return LTScurve->y(i - xmin); }
double getSB(int i) { return SBcurve->y(i - xmin); }
double getDAY(int i) { return DAYcurve->y(i - xmin); }
int n(void) { return days; }
int max(void) { return xmax; }
int min(void) { return xmin; }

View File

@@ -57,6 +57,8 @@ class StressCalculator:public QObject {
double *getSTSvalues() { return stsvalues.data(); }
double *getLTSvalues() { return ltsvalues.data(); }
double *getSBvalues() { return sbvalues.data(); }
double *getDAYvalues() { return list.data(); }
// y axis
double *getDays() { return xdays.data(); }
int n() { return days; }