Stress Metric Prototypes

Added a few new training stress metrics whilst discussing
and working on a multicomponent view of training stress.

This is all a wip falling out of discussions around stress
metrics beyond the old TSS/BikeScore models.

For now this just includes;
1. Aerobic Training Impact Scoring System on PM/PMC
2. Work (Kj) above/below CP on PM/PMC
3. Aerobic TISS on the Ride Plot

There is lots more to come; specifically around Anaerobic TISS,
looking again at polarised training and personalised training stress
based upon the individual's CP model.
This commit is contained in:
Mark Liversedge
2014-03-17 20:51:57 +00:00
parent a47ebb9c07
commit f92d8a5b79
12 changed files with 573 additions and 24 deletions

View File

@@ -196,6 +196,10 @@ AllPlotWindow::AllPlotWindow(Context *context) :
showTorque->setCheckState(Qt::Checked);
cl2->addRow(new QLabel(""), showTorque);
showATISS = new QCheckBox(tr("Aerobic TISS"), this);
showATISS->setCheckState(Qt::Unchecked);
cl2->addRow(new QLabel(""), showATISS);
showNP = new QCheckBox(tr("Normalized Power"), this);
showNP->setCheckState(Qt::Unchecked);
cl2->addRow(new QLabel(""), showNP);
@@ -495,6 +499,7 @@ AllPlotWindow::AllPlotWindow(Context *context) :
connect(showTorqueD, SIGNAL(stateChanged(int)), this, SLOT(setShowTorqueD(int)));
connect(showHrD, SIGNAL(stateChanged(int)), this, SLOT(setShowHrD(int)));
connect(showNP, SIGNAL(stateChanged(int)), this, SLOT(setShowNP(int)));
connect(showATISS, SIGNAL(stateChanged(int)), this, SLOT(setShowATISS(int)));
connect(showXP, SIGNAL(stateChanged(int)), this, SLOT(setShowXP(int)));
connect(showAP, SIGNAL(stateChanged(int)), this, SLOT(setShowAP(int)));
connect(showSpeed, SIGNAL(stateChanged(int)), this, SLOT(setShowSpeed(int)));
@@ -738,6 +743,7 @@ AllPlotWindow::compareChanged()
if (showTemp->isChecked()) wanted << RideFile::temp;
if (showWind->isChecked()) wanted << RideFile::headwind;
if (showNP->isChecked()) wanted << RideFile::NP;
if (showATISS->isChecked()) wanted << RideFile::aTISS;
if (showXP->isChecked()) wanted << RideFile::xPower;
if (showAP->isChecked()) wanted << RideFile::aPower;
if (showW->isChecked()) wanted << RideFile::wprime;
@@ -1794,6 +1800,29 @@ AllPlotWindow::setShowNP(int value)
forceSetupSeriesStackPlots(); // scope changed so force redraw
}
void
AllPlotWindow::setShowATISS(int value)
{
showATISS->setChecked(value);
// compare mode selfcontained update
if (isCompare()) {
compareChanged();
return;
}
bool checked = ( ( value == Qt::Checked ) && showATISS->isEnabled()) ? true : false;
// recalc only does it if it needs to
if (value && current && current->ride()) current->ride()->recalculateDerivedSeries();
allPlot->setShowATISS(checked);
foreach (AllPlot *plot, allPlots)
plot->setShowATISS(checked);
// and the series stacks too
forceSetupSeriesStackPlots(); // scope changed so force redraw
}
void
AllPlotWindow::setShowXP(int value)
{
@@ -2488,6 +2517,7 @@ AllPlotWindow::setupSeriesStackPlots()
if (showTemp->isChecked() && rideItem->ride()->areDataPresent()->temp) serieslist << RideFile::temp;
if (showWind->isChecked() && rideItem->ride()->areDataPresent()->headwind) addHeadwind=true; //serieslist << RideFile::headwind;
if (showNP->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::NP;
if (showATISS->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::aTISS;
if (showXP->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::xPower;
if (showAP->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::aPower;
if (showW->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::wprime;
@@ -2666,6 +2696,7 @@ AllPlotWindow::setupStackPlots()
_allPlot->setShowTemp((showTemp->isEnabled()) ? ( showTemp->checkState() == Qt::Checked ) : false );
_allPlot->setShowTorque((showTorque->isEnabled()) ? ( showTorque->checkState() == Qt::Checked ) : false );
_allPlot->setShowW((showW->isEnabled()) ? ( showW->checkState() == Qt::Checked ) : false );
_allPlot->setShowATISS((showATISS->isEnabled()) ? ( showATISS->checkState() == Qt::Checked ) : false );
_allPlot->setShowGrid(showGrid->checkState() == Qt::Checked);
_allPlot->setPaintBrush(paintBrush->checkState());
_allPlot->setSmoothing(smoothSlider->value());