diff --git a/src/Charts/AllPlot.cpp b/src/Charts/AllPlot.cpp index 9b116e522..15a8e31bb 100644 --- a/src/Charts/AllPlot.cpp +++ b/src/Charts/AllPlot.cpp @@ -350,10 +350,6 @@ AllPlotObject::AllPlotObject(AllPlot *plot, QList user) : plot(plot) hrCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); hrCurve->setYAxis(QwtAxisId(QwtAxis::yLeft, 1)); - hrvCurve = new QwtPlotCurve(tr("R-R Rate")); - hrvCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); - hrvCurve->setYAxis(QwtAxisId(QwtAxis::yLeft, 1)); - tcoreCurve = new QwtPlotCurve(tr("Core Temp")); tcoreCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); tcoreCurve->setYAxis(QwtAxisId(QwtAxis::yLeft, 1)); @@ -586,7 +582,7 @@ AllPlotObject::setColor(QColor color) QList worklist; worklist << mCurve << wCurve << wattsCurve << atissCurve << antissCurve << npCurve << xpCurve << speedCurve << accelCurve << wattsDCurve << cadDCurve << nmDCurve << hrDCurve - << apCurve << cadCurve << tempCurve << hrCurve << hrvCurve <detach(); delete xpCurve; apCurve->detach(); delete apCurve; hrCurve->detach(); delete hrCurve; - hrvCurve->detach(); delete hrvCurve; tcoreCurve->detach(); delete tcoreCurve; speedCurve->detach(); delete speedCurve; accelCurve->detach(); delete accelCurve; @@ -710,7 +705,6 @@ AllPlotObject::setVisible(bool show) xpCurve->detach(); apCurve->detach(); hrCurve->detach(); - hrvCurve->detach(); tcoreCurve->detach(); speedCurve->detach(); accelCurve->detach(); @@ -773,7 +767,6 @@ AllPlotObject::setVisible(bool show) xpCurve->attach(plot); apCurve->attach(plot); hrCurve->attach(plot); - hrvCurve->attach(plot); tcoreCurve->attach(plot); speedCurve->attach(plot); accelCurve->attach(plot); @@ -832,7 +825,6 @@ AllPlotObject::hideUnwanted() if (!plot->showW) wCurve->detach(); if (!plot->showW) mCurve->detach(); if (!plot->showHr) hrCurve->detach(); - if (!plot->showHRV) hrvCurve->detach(); if (!plot->showTcore) tcoreCurve->detach(); if (!plot->showSpeed) speedCurve->detach(); if (!plot->showAccel) accelCurve->detach(); @@ -885,7 +877,6 @@ AllPlot::AllPlot(QWidget *parent, AllPlotWindow *window, Context *context, RideF showXP(false), showAP(false), showHr(true), - showHRV(true), showTcore(false), showSpeed(true), showAccel(false), @@ -1041,7 +1032,6 @@ AllPlot::configChanged(qint32 what) standard->wCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->mCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->hrCurve->setRenderHint(QwtPlotItem::RenderAntialiased); - standard->hrvCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->tcoreCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->speedCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->accelCurve->setRenderHint(QwtPlotItem::RenderAntialiased); @@ -1122,9 +1112,6 @@ AllPlot::configChanged(qint32 what) QPen hrPen = QPen(GColor(CHEARTRATE)); hrPen.setWidth(width); standard->hrCurve->setPen(hrPen); - //QPen hrvPen = QPen(GColor(CHEARTRATE)); - //hrvPen.setWidth(width); - standard->hrvCurve->setPen(hrPen); QPen tcorePen = QPen(GColor(CCORETEMP)); tcorePen.setWidth(width); standard->tcoreCurve->setPen(tcorePen); @@ -1307,10 +1294,6 @@ AllPlot::configChanged(qint32 what) p.setAlpha(64); standard->hrCurve->setBrush(QBrush(p)); - p = standard->hrvCurve->pen().color(); - p.setAlpha(64); - standard->hrvCurve->setBrush(QBrush(p)); - p = standard->accelCurve->pen().color(); p.setAlpha(64); standard->accelCurve->setBrush(QBrush(p)); @@ -1422,7 +1405,6 @@ AllPlot::configChanged(qint32 what) standard->apCurve->setBrush(Qt::NoBrush); standard->wCurve->setBrush(Qt::NoBrush); standard->hrCurve->setBrush(Qt::NoBrush); - standard->hrvCurve->setBrush(Qt::NoBrush); standard->tcoreCurve->setBrush(Qt::NoBrush); standard->speedCurve->setBrush(Qt::NoBrush); standard->accelCurve->setBrush(Qt::NoBrush); @@ -1542,10 +1524,6 @@ AllPlot::setLeftOnePalette() single = GColor(CHEARTRATE); } - if (standard->hrvCurve->isVisible()) { - single = GColor(CHEARTRATE); - } - if (standard->tcoreCurve->isVisible()) { single = GColor(CCORETEMP); } @@ -2331,59 +2309,6 @@ AllPlot::recalc(AllPlotObject *objects) int startingIndex = qMin(smooth, xaxis.count()); int totalPoints = xaxis.count() - startingIndex; - // Build vectors for HRV - if (rideItem->ride()->areDataPresent()->hrv) - { - double hrv; - double t_hrv = 0; - const QVector &rr = rideItem->ride()->hrvPoints(); - QVector drop; - if (applysmooth > 0){ - drop.resize(0); - for (int i=0; i 2000); - } - for (int i=0; irrmean || (rr[i]+200)smoothHrv.resize(0); - objects->smoothHrv_time.resize(0); - - for (int i=0; ismoothHrv_time.append(t_hrv/60.0); - objects->smoothHrv.append(hrv); - } - } - - objects->hrvCurve->setSamples(objects->smoothHrv_time.data(), - objects->smoothHrv.data(), - objects->smoothHrv.count()); - } - // set curves - we set the intervalHighlighter to whichver is available //W' curve set to whatever data we have @@ -2807,7 +2732,7 @@ AllPlot::setYMax() standard->apCurve->isVisible()); setAxisVisible(QwtAxisId(QwtAxis::yLeft, 1), standard->hrCurve->isVisible() || standard->tcoreCurve->isVisible() || - standard->cadCurve->isVisible() || standard->smo2Curve->isVisible() || standard->hrCurve->isVisible()); + standard->cadCurve->isVisible() || standard->smo2Curve->isVisible()); setAxisVisible(QwtAxisId(QwtAxis::yLeft, 2), false); setAxisVisible(QwtAxisId(QwtAxis::yLeft, 3), standard->balanceLCurve->isVisible() || standard->lteCurve->isVisible() || @@ -2884,7 +2809,7 @@ AllPlot::setYMax() } // QwtAxis::yLeft, 1 - if (standard->hrCurve->isVisible() ||standard->hrvCurve->isVisible() || standard->tcoreCurve->isVisible() || + if (standard->hrCurve->isVisible() || standard->tcoreCurve->isVisible() || standard->cadCurve->isVisible() || standard->smo2Curve->isVisible() || (!context->athlete->useMetricUnits && standard->tempCurve->isVisible())) { @@ -2892,10 +2817,6 @@ AllPlot::setYMax() double ymax = 0; QStringList labels; - if (standard->hrvCurve->isVisible()) { - labels << tr("RR"); - ymax = standard->hrvCurve->maxYValue(); - } if (standard->hrCurve->isVisible()) { labels << tr("BPM"); if (referencePlot == NULL) @@ -3305,7 +3226,6 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) standard->xpCurve->detach(); standard->apCurve->detach(); standard->hrCurve->detach(); - standard->hrvCurve->detach(); standard->tcoreCurve->detach(); standard->speedCurve->detach(); standard->accelCurve->detach(); @@ -3351,7 +3271,6 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) standard->wCurve->setVisible(rideItem->ride()->areDataPresent()->watts && showW); standard->mCurve->setVisible(rideItem->ride()->areDataPresent()->watts && showW); standard->hrCurve->setVisible(rideItem->ride()->areDataPresent()->hr && showHr); - standard->hrvCurve->setVisible(rideItem->ride()->areDataPresent()->hrv && showHRV); standard->tcoreCurve->setVisible(rideItem->ride()->areDataPresent()->hr && showTcore); standard->speedCurve->setVisible(rideItem->ride()->areDataPresent()->kph && showSpeed); standard->accelCurve->setVisible(rideItem->ride()->areDataPresent()->kph && showAccel); @@ -3388,9 +3307,6 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) } int points = stopidx - startidx + 1; // e.g. 10 to 12 is 3 points 10,11,12, so not 12-10 ! for(int k=0; kU.count(); k++) standard->U[k].curve->setSamples(xaxis,smoothU[k], points); - standard->hrvCurve->setSamples(plot->standard->smoothHrv_time.data(), - plot->standard->smoothHrv.data(), - plot->standard->smoothHrv.count()); standard->wattsCurve->setSamples(xaxis,smoothW,points); standard->atissCurve->setSamples(xaxis,smoothAT,points); standard->antissCurve->setSamples(xaxis,smoothANT,points); @@ -3675,7 +3591,6 @@ AllPlot::setDataFromPlot(AllPlot *plot) standard->xpCurve->detach(); standard->apCurve->detach(); standard->hrCurve->detach(); - standard->hrvCurve->detach(); standard->tcoreCurve->detach(); standard->speedCurve->detach(); standard->accelCurve->detach(); @@ -3721,7 +3636,6 @@ AllPlot::setDataFromPlot(AllPlot *plot) standard->xpCurve->setVisible(false); standard->apCurve->setVisible(false); standard->hrCurve->setVisible(false); - standard->hrvCurve->setVisible(false); standard->tcoreCurve->setVisible(false); standard->speedCurve->setVisible(false); standard->accelCurve->setVisible(false); @@ -3782,14 +3696,6 @@ AllPlot::setDataFromPlot(AllPlot *plot) } break; - case RideFile::hrv: - { - ourCurve = standard->hrvCurve; - thereCurve = referencePlot->standard->hrvCurve; - title = tr("R-R"); - } - break; - case RideFile::kphd: { ourCurve = standard->accelCurve; @@ -4276,7 +4182,7 @@ AllPlot::setDataFromPlot(AllPlot *plot) sd->setSpacing(0); if (scope == RideFile::wprime) sd->setFactor(0.001f); // Kj - if (scope == RideFile::thb || scope == RideFile::smo2 || scope == RideFile::hrv + if (scope == RideFile::thb || scope == RideFile::smo2 || scope == RideFile::o2hb || scope == RideFile::hhb) // Hb sd->setDecimals(2); if (scope == RideFile::tcore) sd->setDecimals(1); @@ -4354,7 +4260,6 @@ AllPlot::setDataFromPlots(QList plots) standard->xpCurve->detach(); standard->apCurve->detach(); standard->hrCurve->detach(); - standard->hrvCurve->detach(); standard->tcoreCurve->detach(); standard->speedCurve->detach(); standard->accelCurve->detach(); @@ -4400,7 +4305,6 @@ AllPlot::setDataFromPlots(QList plots) standard->xpCurve->setVisible(false); standard->apCurve->setVisible(false); standard->hrCurve->setVisible(false); - standard->hrvCurve->setVisible(false); standard->tcoreCurve->setVisible(false); standard->speedCurve->setVisible(false); standard->accelCurve->setVisible(false); @@ -4485,15 +4389,6 @@ AllPlot::setDataFromPlots(QList plots) } break; - case RideFile::hrv: - { - ourCurve = new QwtPlotCurve(tr("R-R")); - ourCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); - thereCurve = referencePlot->standard->hrvCurve; - title = tr("R-R"); - } - break; - case RideFile::kphd: { ourCurve = new QwtPlotCurve(tr("Acceleration")); @@ -5090,7 +4985,6 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->xpCurve->detach(); standard->apCurve->detach(); standard->hrCurve->detach(); - standard->hrvCurve->detach(); standard->tcoreCurve->detach(); standard->speedCurve->detach(); standard->accelCurve->detach(); @@ -5132,7 +5026,6 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->xpCurve->setVisible(false); standard->apCurve->setVisible(false); standard->hrCurve->setVisible(false); - standard->hrvCurve->setVisible(false); standard->tcoreCurve->setVisible(false); standard->speedCurve->setVisible(false); standard->accelCurve->setVisible(false); @@ -5434,7 +5327,6 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->xpCurve->setVisible(referencePlot->showXP); standard->apCurve->setVisible(referencePlot->showAP); standard->hrCurve->setVisible(referencePlot->showHr); - standard->hrvCurve->setVisible(referencePlot->showHRV); standard->tcoreCurve->setVisible(referencePlot->showTcore); standard->speedCurve->setVisible(referencePlot->showSpeed); standard->accelCurve->setVisible(referencePlot->showAccel); @@ -5587,7 +5479,6 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here, QListxpCurve->detach(); here->apCurve->detach(); here->hrCurve->detach(); - here->hrvCurve->detach(); here->tcoreCurve->detach(); here->speedCurve->detach(); here->accelCurve->detach(); @@ -5639,8 +5530,6 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here, QListmCurve->attach(this); } if (!here->hrArray.empty()) here->hrCurve->attach(this); - //here->hrvArray.resize(dataPresent->hrv ? ride->hrvPoints().size() : 0); - if (dataPresent->hrv) here->hrvCurve->attach(this); if (!here->tcoreArray.empty()) here->tcoreCurve->attach(this); if (!here->speedArray.empty()) here->speedCurve->attach(this); @@ -5697,7 +5586,6 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here, QListxpCurve->setVisible(dataPresent->xp && showXP); here->apCurve->setVisible(dataPresent->apower && showAP); here->hrCurve->setVisible(dataPresent->hr && showHr); - here->hrvCurve->setVisible(dataPresent->hrv && showHRV); here->tcoreCurve->setVisible(dataPresent->hr && showTcore); here->speedCurve->setVisible(dataPresent->kph && showSpeed); here->cadCurve->setVisible(dataPresent->cad && showCad); @@ -5848,7 +5736,6 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here, QListxpCurve->detach(); here->apCurve->detach(); here->hrCurve->detach(); - here->hrvCurve->detach(); here->tcoreCurve->detach(); here->speedCurve->detach(); here->accelCurve->detach(); @@ -5921,7 +5808,6 @@ AllPlot::setShow(RideFile::SeriesType type, bool state) setShowCadD(false); setShowTorqueD(false); setShowHrD(false); - setShowHRV(false); setShowPower(0); setShowAltSlope(0); setShowSlope(false); @@ -5966,9 +5852,6 @@ AllPlot::setShow(RideFile::SeriesType type, bool state) case RideFile::hr: setShowHr(state); break; - case RideFile::hrv: - setShowHRV(state); - break; case RideFile::km: break; case RideFile::kph: @@ -6309,19 +6192,6 @@ AllPlot::setShowHr(bool show) replot(); } -void -AllPlot::setShowHRV(bool show) -{ - showHRV = show; - standard->hrvCurve->setVisible(show); - setYMax(); - - // remember the curves and colors - isolation = false; - curveColors->saveState(); - replot(); -} - void AllPlot::setShowSpeed(bool show) { @@ -6685,10 +6555,6 @@ AllPlot::setPaintBrush(int state) p.setAlpha(64); standard->hrCurve->setBrush(QBrush(p)); - p = standard->hrvCurve->pen().color(); - p.setAlpha(64); - standard->hrvCurve->setBrush(QBrush(p)); - p = standard->accelCurve->pen().color(); p.setAlpha(64); standard->accelCurve->setBrush(QBrush(p)); @@ -6793,7 +6659,6 @@ AllPlot::setPaintBrush(int state) standard->xpCurve->setBrush(Qt::NoBrush); standard->apCurve->setBrush(Qt::NoBrush); standard->hrCurve->setBrush(Qt::NoBrush); - standard->hrvCurve->setBrush(Qt::NoBrush); standard->tcoreCurve->setBrush(Qt::NoBrush); standard->speedCurve->setBrush(Qt::NoBrush); standard->accelCurve->setBrush(Qt::NoBrush); @@ -7043,21 +6908,14 @@ AllPlot::pointHover(QwtPlotCurve *curve, int index) paceStr = tr("\n%1 %2").arg(context->athlete->useMetricUnits ? kphToPace(yvalue, metricPace, true) : mphToPace(yvalue, metricPace, true)).arg(paceunit); } + bool isHB= curve->title().text().contains("Hb"); + // need to scale for W' bal if (curve->title().text().contains("W'")) yvalue /= 1000.0f; // output the tooltip - int precision; - if (curve->title().text().contains("Hb")){ - precision = 2; - } else { - if (curve->title().text().contains("R-R")){ - precision = 3;} - else - {precision = 1;} - } QString text = QString("%1 %2%5\n%3 %4") - .arg(yvalue, 0, 'f', precision) + .arg(yvalue, 0, 'f', isHB ? 2 : 1) .arg(this->axisTitle(curve->yAxis()).text()) .arg(xstring) .arg(this->axisTitle(curve->xAxis()).text()) diff --git a/src/Charts/AllPlot.h b/src/Charts/AllPlot.h index b7fa203e8..c9ffa4170 100644 --- a/src/Charts/AllPlot.h +++ b/src/Charts/AllPlot.h @@ -48,9 +48,6 @@ #include "UserData.h" #include "RideFile.h" -#define MAX(a, b) (((a)>(b))?(a):(b)) -#define MIN(a, b) (((a)<(b))?(a):(b)) - class QwtPlotCurve; class QwtPlotGappedCurve; class QwtPlotIntervalCurve; @@ -406,7 +403,6 @@ class AllPlotObject : public QObject QwtPlotCurve *xpCurve; QwtPlotCurve *apCurve; QwtPlotCurve *hrCurve; - QwtPlotCurve *hrvCurve; QwtPlotCurve *tcoreCurve; QwtPlotCurve *speedCurve; QwtPlotCurve *accelCurve; @@ -444,7 +440,6 @@ class AllPlotObject : public QObject QVector wprimeDist; QVector hrArray; - QVector hrvArray; QVector tcoreArray; QVector wattsArray; QVector atissArray; @@ -506,8 +501,6 @@ class AllPlotObject : public QObject QVector smoothAP; QVector smoothXP; QVector smoothHr; - QVector smoothHrv; - QVector smoothHrv_time; QVector smoothTcore; QVector smoothSpeed; QVector smoothAccel; @@ -633,7 +626,6 @@ class AllPlot : public QwtPlot void setShowXP(bool show); void setShowAP(bool show); void setShowHr(bool show); - void setShowHRV(bool show); void setShowTcore(bool show); void setShowSpeed(bool show); void setShowCad(bool show); @@ -695,7 +687,6 @@ class AllPlot : public QwtPlot bool showXP; bool showAP; bool showHr; - bool showHRV; bool showTcore; bool showSpeed; bool showAccel; diff --git a/src/Charts/AllPlotWindow.cpp b/src/Charts/AllPlotWindow.cpp index 665c08ab5..bf0d62e6c 100644 --- a/src/Charts/AllPlotWindow.cpp +++ b/src/Charts/AllPlotWindow.cpp @@ -314,7 +314,6 @@ AllPlotWindow::AllPlotWindow(Context *context) : // running ! seriesRight->addRow(new QLabel(""), new QLabel("")); - seriesRight->addRow(new QLabel(""), new QLabel("")); showRV = new QCheckBox(tr("Vertical Oscillation"), this); showRV->setCheckState(Qt::Checked); @@ -351,10 +350,6 @@ AllPlotWindow::AllPlotWindow(Context *context) : showHr->setCheckState(Qt::Checked); seriesLeft->addRow(new QLabel(tr("Data series")), showHr); - showHRV= new QCheckBox(tr("R-R Rate"), this); - showHRV->setCheckState(Qt::Unchecked); - seriesLeft->addRow(new QLabel(), showHRV); - showTcore = new QCheckBox(tr("Core Temperature"), this); showTcore->setCheckState(Qt::Unchecked); // don't show unless user insists seriesLeft->addRow(new QLabel(tr("")), showTcore); @@ -757,7 +752,6 @@ AllPlotWindow::AllPlotWindow(Context *context) : 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(showHRV, SIGNAL(stateChanged(int)), this, SLOT(setShowHRV(int))); connect(showTcore, SIGNAL(stateChanged(int)), this, SLOT(setShowTcore(int))); connect(showPowerD, SIGNAL(stateChanged(int)), this, SLOT(setShowPowerD(int))); connect(showCadD, SIGNAL(stateChanged(int)), this, SLOT(setShowCadD(int))); @@ -1414,7 +1408,6 @@ AllPlotWindow::compareChanged() if (showW->isChecked()) { s.one = RideFile::wprime; s.two = RideFile::none; wanted << s;}; if (showPowerD->isChecked()) { s.one = RideFile::wattsd; s.two = RideFile::none; wanted << s;}; if (showHr->isChecked()) { s.one = RideFile::hr; s.two = RideFile::none; wanted << s;}; - if (showHRV->isChecked()) { s.one = RideFile::hrv; s.two = RideFile::none; wanted << s;}; if (showTcore->isChecked()) { s.one = RideFile::tcore; s.two = RideFile::none; wanted << s;}; if (showHrD->isChecked()) { s.one = RideFile::hrd; s.two = RideFile::none; wanted << s;}; if (showSpeed->isChecked()) { s.one = RideFile::kph; s.two = RideFile::none; wanted << s;}; @@ -2074,7 +2067,6 @@ AllPlotWindow::setAllPlotWidgets(RideItem *ride) showCad->setEnabled(dataPresent->cad); showTorque->setEnabled(dataPresent->nm); showHr->setEnabled(dataPresent->hr); - showHRV->setEnabled(dataPresent->hrv); showTcore->setEnabled(dataPresent->hr); showSpeed->setEnabled(dataPresent->kph); showAccel->setEnabled(dataPresent->kph); @@ -2092,7 +2084,6 @@ AllPlotWindow::setAllPlotWidgets(RideItem *ride) showHrD->setEnabled(false); showPower->setEnabled(false); showHr->setEnabled(false); - showHRV->setEnabled(false); showTcore->setEnabled(false); showSpeed->setEnabled(false); showCad->setEnabled(false); @@ -2542,27 +2533,6 @@ AllPlotWindow::setShowTcore(int value) forceSetupSeriesStackPlots(); // scope changed so force redraw } -void -AllPlotWindow::setShowHRV(int value) -{ - showHRV->setChecked(value); - - // compare mode selfcontained update - if (isCompare()) { - compareChanged(); - return; - } - - bool checked = ( ( value == Qt::Checked ) && showHRV->isEnabled()) ? true : false; - - allPlot->setShowHRV(checked); - foreach (AllPlot *plot, allPlots) - plot->setShowHRV(checked); - // and the series stacks too - forceSetupSeriesStackPlots(); // scope changed so force redraw -} - - void AllPlotWindow::setShowNP(int value) { @@ -3654,7 +3624,6 @@ AllPlotWindow::setupSeriesStackPlots() if (showW->isChecked() && rideItem->ride()->areDataPresent()->watts) { s.one = RideFile::wprime; s.two = RideFile::none; serieslist << s; } if (showPowerD->isChecked() && rideItem->ride()->areDataPresent()->watts) { s.one = RideFile::wattsd;s.two = RideFile::none; serieslist << s; } if (showHr->isChecked() && rideItem->ride()->areDataPresent()->hr) { s.one = RideFile::hr; s.two = RideFile::none; serieslist << s; } - if (showHRV->isChecked() && rideItem->ride()->areDataPresent()->hrv) { s.one = RideFile::hrv; s.two = RideFile::none; serieslist << s; } if (showTcore->isChecked() && rideItem->ride()->areDataPresent()->hr) { s.one = RideFile::tcore; s.two = RideFile::none; serieslist << s; } if (showHrD->isChecked() && rideItem->ride()->areDataPresent()->hr) { s.one = RideFile::hrd; s.two = RideFile::none; serieslist << s; } if (showSmO2->isChecked() && rideItem->ride()->areDataPresent()->smo2) { s.one = RideFile::smo2; s.two = RideFile::none; serieslist << s; } @@ -3866,7 +3835,6 @@ AllPlotWindow::setupStackPlots() _allPlot->setShadeZones(showPower->currentIndex() == 0); _allPlot->setShowPower(showPower->currentIndex()); _allPlot->setShowHr( (showHr->isEnabled()) ? ( showHr->checkState() == Qt::Checked ) : false ); - _allPlot->setShowHRV( (showHRV->isEnabled()) ? ( showHRV->checkState() == Qt::Checked ) : false ); _allPlot->setShowTcore( (showTcore->isEnabled()) ? ( showTcore->checkState() == Qt::Checked ) : false ); _allPlot->setShowSpeed((showSpeed->isEnabled()) ? ( showSpeed->checkState() == Qt::Checked ) : false ); _allPlot->setShowAccel((showAccel->isEnabled()) ? ( showAccel->checkState() == Qt::Checked ) : false ); diff --git a/src/Charts/AllPlotWindow.h b/src/Charts/AllPlotWindow.h index 20b432ca7..3aad92242 100644 --- a/src/Charts/AllPlotWindow.h +++ b/src/Charts/AllPlotWindow.h @@ -78,7 +78,6 @@ class AllPlotWindow : public GcChartWindow Q_PROPERTY(int showSlope READ isShowSlope WRITE setShowSlope USER true) Q_PROPERTY(int showAltSlope READ isShowAltSlope WRITE setShowAltSlope USER true) Q_PROPERTY(int showHr READ isShowHr WRITE setShowHr USER true) - Q_PROPERTY(int showHRV READ isShowHRV WRITE setShowHRV USER true) Q_PROPERTY(int showTcore READ isShowTcore WRITE setShowTcore USER true) Q_PROPERTY(int showCadD READ isShowCadD WRITE setShowCadD USER true) Q_PROPERTY(int showTorqueD READ isShowTorqueD WRITE setShowTorqueD USER true) @@ -146,7 +145,6 @@ class AllPlotWindow : public GcChartWindow int isShowCad() const { return showCad->checkState(); } int isShowTorque() const { return showTorque->checkState(); } int isShowHr() const { return showHr->checkState(); } - int isShowHRV() const { return showHRV->checkState(); } int isShowTcore() const { return showTcore->checkState(); } int isShowPowerD() const { return showPowerD->checkState(); } int isShowCadD() const { return showCadD->checkState(); } @@ -206,7 +204,6 @@ class AllPlotWindow : public GcChartWindow void setShowCad(int state); void setShowTorque(int state); void setShowHr(int state); - void setShowHRV(int state); void setShowTcore(int state); void setShowPowerD(int state); void setShowCadD(int state); @@ -339,7 +336,6 @@ class AllPlotWindow : public GcChartWindow QCheckBox *showCad; QCheckBox *showTorque; QCheckBox *showHr; - QCheckBox *showHRV; QCheckBox *showTcore; QCheckBox *showPowerD; QCheckBox *showCadD; diff --git a/src/FileIO/FitRideFile.cpp b/src/FileIO/FitRideFile.cpp index 0ecb34c11..525a7c928 100644 --- a/src/FileIO/FitRideFile.cpp +++ b/src/FileIO/FitRideFile.cpp @@ -42,7 +42,6 @@ #define LAP_TYPE 19 #define RECORD_TYPE 20 -#define HRV_TYPE 78 #define SEGMENT_TYPE 142 static int fitFileReaderRegistered = @@ -1032,25 +1031,6 @@ struct FitFileReaderState last_event_type = event_type; } - void decodeHRV(const FitDefinition &def, - const std::vector& values) { - int rrvalue; - int i=0; - foreach(const FitField &field, def.fields) { - FitValue value = values[i++]; - if ( value.type == ListValue && field.num == 0){ - for (int j=0; jappendHRV(rrvalue); - } - } - } - } - void decodeLap(const FitDefinition &def, int time_offset, const std::vector& values) { time_t time = 0; @@ -2553,9 +2533,7 @@ struct FitFileReaderState case 53: /* speed zone */ case 55: /* monitoring */ case 72: /* training file (undocumented) : new since garmin 800 */ - case HRV_TYPE: - decodeHRV(def, values); - break;/* hrv */ + case 78: /* hrv */ case 79: /* HR zone (undocumented) ; see details below: */ /* #253: timestamp / #1: default Min HR / #2: default Max HR / #5: user Min HR / #6: user Max HR */ case 103: /* monitoring info */ diff --git a/src/FileIO/JsonRideFile.l b/src/FileIO/JsonRideFile.l index a8fa6020b..f57f8bdb1 100644 --- a/src/FileIO/JsonRideFile.l +++ b/src/FileIO/JsonRideFile.l @@ -124,8 +124,6 @@ void JsonRideFilefree (void * ptr , yyscan_t /*scanner*/) \"REFERENCES\" return REFERENCES; \"SAMPLES\" return SAMPLES; \"SECS\" return SECS; -\"HRV\" return HRV; -\"MSECS\" return MSECS; \"KM\" return KM; \"WATTS\" return WATTS; \"NM\" return NM; diff --git a/src/FileIO/JsonRideFile.y b/src/FileIO/JsonRideFile.y index 429f04b32..2ce1821e5 100644 --- a/src/FileIO/JsonRideFile.y +++ b/src/FileIO/JsonRideFile.y @@ -58,7 +58,6 @@ struct JsonContext { double JsonNumber; QStringList JsonRideFileerrors; QMap JsonOverrides; - int JsonHRV; XDataSeries xdataseries; XDataPoint xdatapoint; @@ -119,7 +118,6 @@ static QString protect(const QString string) %token REFERENCES %token XDATA %token SAMPLES SECS KM WATTS NM CAD KPH HR ALTITUDE LAT LON HEADWIND SLOPE TEMP -%token HRV MSECS %token LRBALANCE LTE RTE LPS RPS THB SMO2 RVERT RCAD RCON %token LPCO RPCO LPPB RPPB LPPE RPPE LPPPB RPPPB LPPPE RPPPE @@ -152,7 +150,6 @@ rideelement: starttime | references | samples | xdata - | hrv_samples ; /* @@ -361,16 +358,7 @@ series: SECS ':' number { jc->JsonPoint.secs = jc->JsonNumber; } | string ':' string ; -hrv_samples: HRV ':' '[' hrv_sample_list ']' ; -hrv_sample_list: hrv_sample | hrv_sample_list ',' hrv_sample ; -hrv_sample: '{' hrv_series_list '}' { jc->JsonRide->appendHRV(jc->JsonHRV); - } -hrv_series_list: hrv_series | hrv_series_list ',' hrv_series ; -hrv_series: MSECS ':' number { jc->JsonHRV = jc->JsonNumber; } - | string ':' number { } - | string ':' string - ; /* * Primitives */ @@ -762,24 +750,6 @@ JsonFileReader::toByteArray(Context *, const RideFile *ride, bool withAlt, bool out += "\n\t\t]"; } - // - // HRV heart rate variability - // - if (ride->HRV_.count()) { - - out += ",\n\t\t\"HRV\":[\n"; - bool first = true; - foreach (int hrv, ride->HRV_) { - if (first) first=false; - else out += ",\n"; - out += "\t\t\t{ "; - // always store time - out += "\"MSECS\":" + QString("%1").arg(hrv); - // sample points in here! - out += " }"; - } - out += "\n\t\t]"; - } // end of ride and document out += "\n\t}\n}\n"; diff --git a/src/FileIO/RideFile.cpp b/src/FileIO/RideFile.cpp index f1da0441f..b228d6a47 100644 --- a/src/FileIO/RideFile.cpp +++ b/src/FileIO/RideFile.cpp @@ -274,7 +274,6 @@ RideFile::seriesName(SeriesType series, bool compat) case RideFile::rcontact: return QString("gct"); case RideFile::gear: return QString("gearratio"); case RideFile::index: return QString("index"); - case RideFile::hrv: return QString("R_R"); default: return QString("unknown"); } } else { @@ -331,7 +330,6 @@ RideFile::seriesName(SeriesType series, bool compat) case RideFile::gear: return QString(tr("Gear Ratio")); case RideFile::wbal: return QString(tr("W' Consumed")); case RideFile::index: return QString(tr("Sample Index")); - case RideFile::hrv: return QString(tr("R-R")); default: return QString(tr("Unknown")); } } @@ -391,7 +389,6 @@ RideFile::colorFor(SeriesType series) case RideFile::vam: case RideFile::lon: case RideFile::lat: - case RideFile::hrv: return GColor(CHEARTRATE); default: return GColor(CPLOTMARKER); } } @@ -452,7 +449,6 @@ RideFile::unitName(SeriesType series, Context *context) case RideFile::rvert: return QString(tr("cm")); case RideFile::rcontact: return QString(tr("ms")); case RideFile::gear: return QString(tr("ratio")); - case RideFile::hrv: return QString(tr("seconds")); default: return QString(tr("Unknown")); } } @@ -776,19 +772,7 @@ RideFile *RideFileFactory::openRideFile(Context *context, QFile &file, i->stop -= timeOffset; } - // Update presens, min, max and avg of HRV - result->dataPresent.hrv = !result->HRV_.empty(); - if (result->dataPresent.hrv) - { - result->minHrv = 10000; - result->maxHrv = 0; - foreach(int rr, result->HRV_) { - if (rrminHrv) result->minHrv=rr; - if (rr>result->maxHrv) result->maxHrv=rr; - } - } - - // calculate derived data series -- after data fixers applied above + // calculate derived data series -- after data fixers applied above if (context) result->recalculateDerivedSeries(); // what data is present - after processor in case 'derived' or adjusted @@ -1384,11 +1368,6 @@ void RideFile::appendOrUpdatePoint(double secs, double cad, double hr, double km updateAvg(point); } -void RideFile::appendHRV(int value) -{ - HRV_.append(value); -} - void RideFile::appendPoint(const RideFilePoint &point) { appendPoint(point.secs,point.cad,point.hr,point.km,point.kph, @@ -1529,7 +1508,6 @@ RideFile::setDataPresent(SeriesType series, bool value) case wprime : dataPresent.wprime = value; break; case tcore : dataPresent.tcore = value; break; case wbal : break; // not present - case hrv : dataPresent.hrv = value; break; default: case none : break; } @@ -1586,7 +1564,6 @@ RideFile::isDataPresent(SeriesType series) case gear : return dataPresent.gear; break; case interval : return dataPresent.interval; break; case tcore : return dataPresent.tcore; break; - case hrv : return dataPresent.hrv; break; default: case none : return false; break; } @@ -1633,7 +1610,6 @@ RideFile::setPointValue(int index, SeriesType series, double value) case rcontact : dataPoints_[index]->rcontact = value; break; case interval : dataPoints_[index]->interval = value; break; case tcore : dataPoints_[index]->tcore = value; break; - case hrv : HRV_[index] = value; break; default: case none : break; } @@ -1759,9 +1735,6 @@ RideFilePoint::setValue(RideFile::SeriesType series, double value) double RideFile::getPointValue(int index, SeriesType series) const { - if (series==RideFile::hrv) - return HRV_[index]; - else return dataPoints_[index]->value(series); } @@ -1850,7 +1823,6 @@ RideFile::decimalsFor(SeriesType series) case wprime : return 0; break; case wbal : return 0; break; case tcore : return 2; break; - case hrv : return 0; break; default: case none : break; } @@ -3099,7 +3071,6 @@ static struct { { "RIGHTPPPB", RideFile::rpppb }, { "LEFTPPPE", RideFile::lpppe }, { "RIGHTPPPE", RideFile::rpppe }, - { "HRV", RideFile::hrv }, { "", RideFile::none }, }; diff --git a/src/FileIO/RideFile.h b/src/FileIO/RideFile.h index 468b094ee..bb85a01fd 100644 --- a/src/FileIO/RideFile.h +++ b/src/FileIO/RideFile.h @@ -63,7 +63,7 @@ extern const QChar deltaChar; struct RideFileDataPresent { // basic (te = torqueeffectiveness, ps = pedal smoothness) - bool secs, cad, hr, hrv, km, kph, nm, watts, alt, lon, lat, headwind, slope, temp; + bool secs, cad, hr, km, kph, nm, watts, alt, lon, lat, headwind, slope, temp; bool lrbalance, lte, rte, lps, rps, lpco, rpco, lppb, rppb, lppe, rppe, lpppb, rpppb, lpppe, rpppe; bool smo2, thb, interval; @@ -75,7 +75,7 @@ struct RideFileDataPresent // whether non-zero data of each field is present RideFileDataPresent(): - secs(false), cad(false), hr(false), hrv(false), km(false), + secs(false), cad(false), hr(false), km(false), kph(false), nm(false), watts(false), alt(false), lon(false), lat(false), headwind(false), slope(false), temp(false), lrbalance(false), lte(false), rte(false), lps(false), rps(false), @@ -206,7 +206,7 @@ class RideFile : public QObject // QObject to emit signals aPower, wprime, aTISS, anTISS, smo2, thb, rvert, rcad, rcontact, gear, o2hb, hhb, lpco, rpco, lppb, rppb, lppe, rppe, lpppb, rpppb, lpppe, rpppe, - wbal, tcore, clength, aPowerKg, index, hrv, + wbal, tcore, clength, aPowerKg, index, none }; // none must ALWAYS be last typedef enum seriestype SeriesType; @@ -275,10 +275,8 @@ class RideFile : public QObject // QObject to emit signals void updatePoint(RideFilePoint *point, const RideFilePoint *oldPoint); - void appendHRV(int); - const QVector &dataPoints() const { return dataPoints_; } - const QVector &hrvPoints() const {return HRV_;} + // recalculate all the derived data series // might want to move to a factory for these // at some point, but for now hard coded @@ -428,10 +426,6 @@ class RideFile : public QObject // QObject to emit signals double weight_; // cached to save calls to getWeight(); double totalCount, totalTemp; - // Heart rate variability does not match length of RideFilePoint - QVector HRV_; - int minHrv, maxHrv; - QVariant getPointFromValue(double value, SeriesType series) const; void updateMin(RideFilePoint* point); void updateMax(RideFilePoint* point);