mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 08:59:55 +00:00
Delta Watts, Torque, Cadence and HR
.. Following on from the recent update to add acceleration this update adds other derived data series based upon the rate of change. .. Added to the ride plot and the CP plot. Not sure of the overall utility of these updates but bear in mind that they are targetting sprinting and track users and analysis. As well as the positive side of this (development of power cadence etc) we also want to think about and collect data on fatigue rate (possibly only power and torque) - fatigue over time - fatigue over pedal stroke
This commit is contained in:
@@ -147,6 +147,21 @@ AllPlotWindow::AllPlotWindow(Context *context) :
|
||||
showGrid = new QCheckBox(tr("Grid"), this);
|
||||
showGrid->setCheckState(Qt::Checked);
|
||||
cl1->addRow(new QLabel(""), showGrid);
|
||||
cl1->addRow(new QLabel(""), new QLabel(""));
|
||||
cl1->addRow(new QLabel("Delta Series"), new QLabel(""));
|
||||
|
||||
showPowerD = new QCheckBox(tr("Power Δ"), this);
|
||||
showPowerD->setCheckState(Qt::Unchecked);
|
||||
cl1->addRow(new QLabel(""), showPowerD);
|
||||
showCadD = new QCheckBox(tr("Cadence Δ"), this);
|
||||
showCadD->setCheckState(Qt::Unchecked);
|
||||
cl1->addRow(new QLabel(""), showCadD);
|
||||
showTorqueD = new QCheckBox(tr("Torque Δ"), this);
|
||||
showTorqueD->setCheckState(Qt::Unchecked);
|
||||
cl1->addRow(new QLabel(""), showTorqueD);
|
||||
showHrD = new QCheckBox(tr("Heartrate Δ"), this);
|
||||
showHrD->setCheckState(Qt::Unchecked);
|
||||
cl1->addRow(new QLabel(""), showHrD);
|
||||
|
||||
showHr = new QCheckBox(tr("Heart Rate"), this);
|
||||
showHr->setCheckState(Qt::Checked);
|
||||
@@ -471,18 +486,22 @@ AllPlotWindow::AllPlotWindow(Context *context) :
|
||||
|
||||
// common controls
|
||||
connect(showPower, SIGNAL(currentIndexChanged(int)), this, SLOT(setShowPower(int)));
|
||||
connect(showCad, SIGNAL(stateChanged(int)), this, SLOT(setShowCad(int)));
|
||||
connect(showTorque, SIGNAL(stateChanged(int)), this, SLOT(setShowTorque(int)));
|
||||
connect(showHr, SIGNAL(stateChanged(int)), this, SLOT(setShowHr(int)));
|
||||
connect(showPowerD, SIGNAL(stateChanged(int)), this, SLOT(setShowPowerD(int)));
|
||||
connect(showCadD, SIGNAL(stateChanged(int)), this, SLOT(setShowCadD(int)));
|
||||
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(showXP, SIGNAL(stateChanged(int)), this, SLOT(setShowXP(int)));
|
||||
connect(showAP, SIGNAL(stateChanged(int)), this, SLOT(setShowAP(int)));
|
||||
connect(showHr, SIGNAL(stateChanged(int)), this, SLOT(setShowHr(int)));
|
||||
connect(showSpeed, SIGNAL(stateChanged(int)), this, SLOT(setShowSpeed(int)));
|
||||
connect(showAccel, SIGNAL(stateChanged(int)), this, SLOT(setShowAccel(int)));
|
||||
connect(showCad, SIGNAL(stateChanged(int)), this, SLOT(setShowCad(int)));
|
||||
connect(showAlt, SIGNAL(stateChanged(int)), this, SLOT(setShowAlt(int)));
|
||||
connect(showTemp, SIGNAL(stateChanged(int)), this, SLOT(setShowTemp(int)));
|
||||
connect(showWind, SIGNAL(stateChanged(int)), this, SLOT(setShowWind(int)));
|
||||
connect(showW, SIGNAL(stateChanged(int)), this, SLOT(setShowW(int)));
|
||||
connect(showTorque, SIGNAL(stateChanged(int)), this, SLOT(setShowTorque(int)));
|
||||
connect(showBalance, SIGNAL(stateChanged(int)), this, SLOT(setShowBalance(int)));
|
||||
connect(showGrid, SIGNAL(stateChanged(int)), this, SLOT(setShowGrid(int)));
|
||||
connect(showFull, SIGNAL(stateChanged(int)), this, SLOT(setShowFull(int)));
|
||||
@@ -703,14 +722,18 @@ AllPlotWindow::compareChanged()
|
||||
// work out what we want to see
|
||||
QList<RideFile::SeriesType> wanted;
|
||||
if (showPower->currentIndex() < 2) wanted << RideFile::watts;
|
||||
if (showPowerD->isChecked()) wanted << RideFile::wattsd;
|
||||
if (showHr->isChecked()) wanted << RideFile::hr;
|
||||
if (showHrD->isChecked()) wanted << RideFile::hrd;
|
||||
if (showSpeed->isChecked()) wanted << RideFile::kph;
|
||||
if (showAccel->isChecked()) wanted << RideFile::kphd;
|
||||
if (showCad->isChecked()) wanted << RideFile::cad;
|
||||
if (showCadD->isChecked()) wanted << RideFile::cadd;
|
||||
if (showTorque->isChecked()) wanted << RideFile::nm;
|
||||
if (showTorqueD->isChecked()) wanted << RideFile::nmd;
|
||||
if (showAlt->isChecked()) wanted << RideFile::alt;
|
||||
if (showTemp->isChecked()) wanted << RideFile::temp;
|
||||
if (showWind->isChecked()) wanted << RideFile::headwind;
|
||||
if (showTorque->isChecked()) wanted << RideFile::nm;
|
||||
if (showNP->isChecked()) wanted << RideFile::NP;
|
||||
if (showXP->isChecked()) wanted << RideFile::xPower;
|
||||
if (showAP->isChecked()) wanted << RideFile::aPower;
|
||||
@@ -1252,21 +1275,29 @@ AllPlotWindow::setAllPlotWidgets(RideItem *ride)
|
||||
const RideFileDataPresent *dataPresent = ride->ride()->areDataPresent();
|
||||
if (ride->ride() && ride->ride()->deviceType() != QString("Manual CSV")) {
|
||||
|
||||
showPowerD->setEnabled(dataPresent->watts);
|
||||
showCadD->setEnabled(dataPresent->cad);
|
||||
showTorqueD->setEnabled(dataPresent->nm);
|
||||
showHrD->setEnabled(dataPresent->hr);
|
||||
showPower->setEnabled(dataPresent->watts);
|
||||
showCad->setEnabled(dataPresent->cad);
|
||||
showTorque->setEnabled(dataPresent->nm);
|
||||
showHr->setEnabled(dataPresent->hr);
|
||||
showSpeed->setEnabled(dataPresent->kph);
|
||||
showAccel->setEnabled(dataPresent->kph);
|
||||
showCad->setEnabled(dataPresent->cad);
|
||||
showAlt->setEnabled(dataPresent->alt);
|
||||
showTemp->setEnabled(dataPresent->temp);
|
||||
showWind->setEnabled(dataPresent->headwind);
|
||||
showTorque->setEnabled(dataPresent->nm);
|
||||
showBalance->setEnabled(dataPresent->lrbalance);
|
||||
} else {
|
||||
showAccel->setEnabled(false);
|
||||
showPowerD->setEnabled(false);
|
||||
showCadD->setEnabled(false);
|
||||
showTorqueD->setEnabled(false);
|
||||
showHrD->setEnabled(false);
|
||||
showPower->setEnabled(false);
|
||||
showHr->setEnabled(false);
|
||||
showSpeed->setEnabled(false);
|
||||
showAccel->setEnabled(false);
|
||||
showCad->setEnabled(false);
|
||||
showAlt->setEnabled(false);
|
||||
showTemp->setEnabled(false);
|
||||
@@ -1846,6 +1877,86 @@ AllPlotWindow::setShowAccel(int value)
|
||||
forceSetupSeriesStackPlots(); // scope changed so force redraw
|
||||
}
|
||||
|
||||
void
|
||||
AllPlotWindow::setShowPowerD(int value)
|
||||
{
|
||||
showPowerD->setChecked(value);
|
||||
|
||||
// compare mode selfcontained update
|
||||
if (isCompare()) {
|
||||
compareChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
bool checked = ( ( value == Qt::Checked ) && showPowerD->isEnabled()) ? true : false;
|
||||
|
||||
allPlot->setShowPowerD(checked);
|
||||
foreach (AllPlot *plot, allPlots)
|
||||
plot->setShowPowerD(checked);
|
||||
// and the series stacks too
|
||||
forceSetupSeriesStackPlots(); // scope changed so force redraw
|
||||
}
|
||||
|
||||
void
|
||||
AllPlotWindow::setShowCadD(int value)
|
||||
{
|
||||
showCadD->setChecked(value);
|
||||
|
||||
// compare mode selfcontained update
|
||||
if (isCompare()) {
|
||||
compareChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
bool checked = ( ( value == Qt::Checked ) && showCadD->isEnabled()) ? true : false;
|
||||
|
||||
allPlot->setShowCadD(checked);
|
||||
foreach (AllPlot *plot, allPlots)
|
||||
plot->setShowCadD(checked);
|
||||
// and the series stacks too
|
||||
forceSetupSeriesStackPlots(); // scope changed so force redraw
|
||||
}
|
||||
|
||||
void
|
||||
AllPlotWindow::setShowTorqueD(int value)
|
||||
{
|
||||
showTorqueD->setChecked(value);
|
||||
|
||||
// compare mode selfcontained update
|
||||
if (isCompare()) {
|
||||
compareChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
bool checked = ( ( value == Qt::Checked ) && showTorqueD->isEnabled()) ? true : false;
|
||||
|
||||
allPlot->setShowTorqueD(checked);
|
||||
foreach (AllPlot *plot, allPlots)
|
||||
plot->setShowTorqueD(checked);
|
||||
// and the series stacks too
|
||||
forceSetupSeriesStackPlots(); // scope changed so force redraw
|
||||
}
|
||||
|
||||
void
|
||||
AllPlotWindow::setShowHrD(int value)
|
||||
{
|
||||
showHrD->setChecked(value);
|
||||
|
||||
// compare mode selfcontained update
|
||||
if (isCompare()) {
|
||||
compareChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
bool checked = ( ( value == Qt::Checked ) && showHrD->isEnabled()) ? true : false;
|
||||
|
||||
allPlot->setShowHrD(checked);
|
||||
foreach (AllPlot *plot, allPlots)
|
||||
plot->setShowHrD(checked);
|
||||
// and the series stacks too
|
||||
forceSetupSeriesStackPlots(); // scope changed so force redraw
|
||||
}
|
||||
|
||||
void
|
||||
AllPlotWindow::setShowCad(int value)
|
||||
{
|
||||
@@ -2361,14 +2472,18 @@ AllPlotWindow::setupSeriesStackPlots()
|
||||
|
||||
// lets get a list of what we need to plot -- plot is same order as options in settings
|
||||
if (showPower->currentIndex() < 2 && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::watts;
|
||||
if (showPowerD->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::wattsd;
|
||||
if (showHr->isChecked() && rideItem->ride()->areDataPresent()->hr) serieslist << RideFile::hr;
|
||||
if (showHrD->isChecked() && rideItem->ride()->areDataPresent()->hr) serieslist << RideFile::hrd;
|
||||
if (showSpeed->isChecked() && rideItem->ride()->areDataPresent()->kph) serieslist << RideFile::kph;
|
||||
if (showAccel->isChecked() && rideItem->ride()->areDataPresent()->kph) serieslist << RideFile::kphd;
|
||||
if (showCad->isChecked() && rideItem->ride()->areDataPresent()->cad) serieslist << RideFile::cad;
|
||||
if (showCadD->isChecked() && rideItem->ride()->areDataPresent()->cad) serieslist << RideFile::cadd;
|
||||
if (showTorque->isChecked() && rideItem->ride()->areDataPresent()->nm) serieslist << RideFile::nm;
|
||||
if (showTorqueD->isChecked() && rideItem->ride()->areDataPresent()->nm) serieslist << RideFile::nmd;
|
||||
if (showAlt->isChecked() && rideItem->ride()->areDataPresent()->alt) serieslist << RideFile::alt;
|
||||
if (showTemp->isChecked() && rideItem->ride()->areDataPresent()->temp) serieslist << RideFile::temp;
|
||||
if (showWind->isChecked() && rideItem->ride()->areDataPresent()->headwind) addHeadwind=true; //serieslist << RideFile::headwind;
|
||||
if (showTorque->isChecked() && rideItem->ride()->areDataPresent()->nm) serieslist << RideFile::nm;
|
||||
if (showNP->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::NP;
|
||||
if (showXP->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::xPower;
|
||||
if (showAP->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::aPower;
|
||||
@@ -2539,6 +2654,10 @@ AllPlotWindow::setupStackPlots()
|
||||
_allPlot->setShowHr( (showHr->isEnabled()) ? ( showHr->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowSpeed((showSpeed->isEnabled()) ? ( showSpeed->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowAccel((showAccel->isEnabled()) ? ( showAccel->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowPowerD((showPowerD->isEnabled()) ? ( showPowerD->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowCadD((showCadD->isEnabled()) ? ( showCadD->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowTorqueD((showTorqueD->isEnabled()) ? ( showTorqueD->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowHrD((showHrD->isEnabled()) ? ( showHrD->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowCad((showCad->isEnabled()) ? ( showCad->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowAlt((showAlt->isEnabled()) ? ( showAlt->checkState() == Qt::Checked ) : false );
|
||||
_allPlot->setShowTemp((showTemp->isEnabled()) ? ( showTemp->checkState() == Qt::Checked ) : false );
|
||||
|
||||
Reference in New Issue
Block a user