From fd68d3df248fb8a35758bea24735198db6b2b7f0 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 16 Oct 2014 10:15:43 +0100 Subject: [PATCH] Ride Plot Running Dynamics and Moxy (1 of 2) .. plotting the new running dynamics data series; ground contact time, vertical oscillation and cadence .. plotting the moxy data; muscle oxygen (absolute) and haemoglobin mass (relative) .. just added to the controls (AllPlotWindow) .. part 2 is the slog to add to the plots (ugh) --- src/AllPlot.cpp | 70 ++++++++++++++++++++++ src/AllPlot.h | 10 ++++ src/AllPlotWindow.cpp | 131 ++++++++++++++++++++++++++++++++++++++++++ src/AllPlotWindow.h | 22 +++++++ 4 files changed, 233 insertions(+) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 6debb462f..47ecfa278 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -646,6 +646,11 @@ AllPlot::AllPlot(AllPlotWindow *parent, Context *context, RideFile::SeriesType s showWind(true), showTorque(true), showBalance(true), + showRV(true), + showRGCT(true), + showRCad(true), + showSmO2(true), + showtHb(true), bydist(false), scope(scope), secondaryScope(secScope), @@ -4385,6 +4390,71 @@ AllPlot::setShowTemp(bool show) replot(); } +void +AllPlot::setShowRV(bool show) +{ + showRV = show; + //standard->windCurve->setVisible(show); + setYMax(); + + // remember the curves and colors + isolation = false; + curveColors->saveState(); + replot(); +} + +void +AllPlot::setShowRGCT(bool show) +{ + showRGCT = show; + //standard->windCurve->setVisible(show); + setYMax(); + + // remember the curves and colors + isolation = false; + curveColors->saveState(); + replot(); +} + +void +AllPlot::setShowRCad(bool show) +{ + showRCad = show; + //standard->windCurve->setVisible(show); + setYMax(); + + // remember the curves and colors + isolation = false; + curveColors->saveState(); + replot(); +} + +void +AllPlot::setShowSmO2(bool show) +{ + showSmO2 = show; + //standard->windCurve->setVisible(show); + setYMax(); + + // remember the curves and colors + isolation = false; + curveColors->saveState(); + replot(); +} + +void +AllPlot::setShowtHb(bool show) +{ + showtHb = show; + //standard->windCurve->setVisible(show); + setYMax(); + + // remember the curves and colors + isolation = false; + curveColors->saveState(); + replot(); +} + void AllPlot::setShowWind(bool show) { diff --git a/src/AllPlot.h b/src/AllPlot.h index 7196ddbe0..da65f2678 100644 --- a/src/AllPlot.h +++ b/src/AllPlot.h @@ -512,6 +512,11 @@ class AllPlot : public QwtPlot void setShowAlt(bool show); void setShowTemp(bool show); void setShowWind(bool show); + void setShowRV(bool show); + void setShowRGCT(bool show); + void setShowRCad(bool show); + void setShowSmO2(bool show); + void setShowtHb(bool show); void setShowW(bool show); void setShowTorque(bool show); void setShowBalance(bool show); @@ -568,6 +573,11 @@ class AllPlot : public QwtPlot bool showBalance; bool showTE; bool showPS; + bool showRV; + bool showRGCT; + bool showRCad; + bool showSmO2; + bool showtHb; // plot objects AllPlotObject *standard; diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index 7488392b8..e40af01aa 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -208,6 +208,32 @@ AllPlotWindow::AllPlotWindow(Context *context) : showPS->setCheckState(Qt::Unchecked); seriesRight->addRow(new QLabel(""), showPS); + // running ! + seriesRight->addRow(new QLabel(""), new QLabel("")); + + showRV = new QCheckBox(tr("Vertical Oscillation"), this); + showRV->setCheckState(Qt::Checked); + seriesRight->addRow(new QLabel(tr("Running")), showRV); + + showRGCT = new QCheckBox(tr("Ground Contact Time"), this); + showRGCT->setCheckState(Qt::Checked); + seriesRight->addRow(new QLabel(""), showRGCT); + + showRCad = new QCheckBox(tr("Cadence"), this); + showRCad->setCheckState(Qt::Checked); + seriesRight->addRow(new QLabel(""), showRCad); + + seriesRight->addRow(new QLabel(""), new QLabel("")); + + showSmO2 = new QCheckBox(tr("SmO2"), this); + showSmO2->setCheckState(Qt::Checked); + seriesRight->addRow(new QLabel(tr("Moxy")), showSmO2); + + showtHb = new QCheckBox(tr("tHb"), this); + showtHb->setCheckState(Qt::Checked); + seriesRight->addRow(new QLabel(""), showtHb); + + // "standard" showHr = new QCheckBox(tr("Heart Rate"), this); showHr->setCheckState(Qt::Checked); seriesLeft->addRow(new QLabel(tr("Data series")), showHr); @@ -2314,6 +2340,111 @@ AllPlotWindow::setShowTemp(int value) forceSetupSeriesStackPlots(); // scope changed so force redraw } +void +AllPlotWindow::setShowRV(int value) +{ + showRV->setChecked(value); + + // compare mode selfcontained update + if (isCompare()) { + compareChanged(); + return; + } + + bool checked = (( value == Qt::Checked ) && showRV->isEnabled()) ? true : false; + + allPlot->setShowRV(checked); + foreach (AllPlot *plot, allPlots) + plot->setShowRV(checked); + + // and the series stacks too + forceSetupSeriesStackPlots(); // scope changed so force redraw +} + +void +AllPlotWindow::setShowRGCT(int value) +{ + showRGCT->setChecked(value); + + // compare mode selfcontained update + if (isCompare()) { + compareChanged(); + return; + } + + bool checked = (( value == Qt::Checked ) && showRGCT->isEnabled()) ? true : false; + + allPlot->setShowRGCT(checked); + foreach (AllPlot *plot, allPlots) + plot->setShowRGCT(checked); + + // and the series stacks too + forceSetupSeriesStackPlots(); // scope changed so force redraw +} + +void +AllPlotWindow::setShowRCad(int value) +{ + showRCad->setChecked(value); + + // compare mode selfcontained update + if (isCompare()) { + compareChanged(); + return; + } + + bool checked = (( value == Qt::Checked ) && showRCad->isEnabled()) ? true : false; + + allPlot->setShowRCad(checked); + foreach (AllPlot *plot, allPlots) + plot->setShowRCad(checked); + + // and the series stacks too + forceSetupSeriesStackPlots(); // scope changed so force redraw +} + +void +AllPlotWindow::setShowSmO2(int value) +{ + showSmO2->setChecked(value); + + // compare mode selfcontained update + if (isCompare()) { + compareChanged(); + return; + } + + bool checked = (( value == Qt::Checked ) && showSmO2->isEnabled()) ? true : false; + + allPlot->setShowSmO2(checked); + foreach (AllPlot *plot, allPlots) + plot->setShowSmO2(checked); + + // and the series stacks too + forceSetupSeriesStackPlots(); // scope changed so force redraw +} + +void +AllPlotWindow::setShowtHb(int value) +{ + showtHb->setChecked(value); + + // compare mode selfcontained update + if (isCompare()) { + compareChanged(); + return; + } + + bool checked = (( value == Qt::Checked ) && showtHb->isEnabled()) ? true : false; + + allPlot->setShowtHb(checked); + foreach (AllPlot *plot, allPlots) + plot->setShowtHb(checked); + + // and the series stacks too + forceSetupSeriesStackPlots(); // scope changed so force redraw +} + void AllPlotWindow::setShowWind(int value) { diff --git a/src/AllPlotWindow.h b/src/AllPlotWindow.h index 8f9474743..f10f9b50e 100644 --- a/src/AllPlotWindow.h +++ b/src/AllPlotWindow.h @@ -83,6 +83,13 @@ class AllPlotWindow : public GcChartWindow Q_PROPERTY(int showPS READ isShowPS WRITE setShowPS USER true) Q_PROPERTY(int showTemp READ isShowTemp WRITE setShowTemp USER true) Q_PROPERTY(int showW READ isShowW WRITE setShowW USER true) + + Q_PROPERTY(int showRV READ isShowRV WRITE setShowRV USER true) + Q_PROPERTY(int showRCad READ isShowRCad WRITE setShowRCad USER true) + Q_PROPERTY(int showRGCT READ isShowRGCT WRITE setShowRGCT USER true) + Q_PROPERTY(int showSmO2 READ isShowSmO2 WRITE setShowSmO2 USER true) + Q_PROPERTY(int showtHb READ isShowtHb WRITE setShowtHb USER true) + Q_PROPERTY(int byDistance READ isByDistance WRITE setByDistance USER true) Q_PROPERTY(int smoothing READ smoothing WRITE setSmoothing USER true) Q_PROPERTY(int paintBrush READ isPaintBrush WRITE setPaintBrush USER true) @@ -131,6 +138,11 @@ class AllPlotWindow : public GcChartWindow int isShowBalance() const { return showBalance->checkState(); } int isShowTemp() const { return showTemp->checkState(); } int isShowW() const { return showW->checkState(); } + int isShowRV() const { return showRV->checkState(); } + int isShowRCad() const { return showRCad->checkState(); } + int isShowRGCT() const { return showRGCT->checkState(); } + int isShowSmO2() const { return showSmO2->checkState(); } + int isShowtHb() const { return showtHb->checkState(); } int isByDistance() const { return comboDistance->currentIndex(); } int isPaintBrush() const { return paintBrush->isChecked(); } int smoothing() const { return smoothSlider->value(); } @@ -174,6 +186,11 @@ class AllPlotWindow : public GcChartWindow void setShowBalance(int state); void setShowPS(int state); void setShowTE(int state); + void setShowRV(int state); + void setShowRCad(int state); + void setShowRGCT(int state); + void setShowSmO2(int state); + void setShowtHb(int state); void setShowW(int state); void setShowGrid(int state); void setPaintBrush(int state); @@ -281,6 +298,11 @@ class AllPlotWindow : public GcChartWindow QCheckBox *showTE; QCheckBox *showPS; QCheckBox *showW; + QCheckBox *showRV; + QCheckBox *showRGCT; + QCheckBox *showRCad; + QCheckBox *showSmO2; + QCheckBox *showtHb; QComboBox *comboDistance; QSlider *smoothSlider; QLineEdit *smoothLineEdit;