From 191219bfa47114fb2d67350f02d4d4ef41b671fa Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sat, 22 Mar 2014 10:47:44 +0000 Subject: [PATCH] Anaerobic TISS Added Anaerobic TISS from Dr Skiba to complement the Aerobic TISS added recently. Added to; * Metrics * Ride Plot * PMC metrics --- src/AllPlot.cpp | 148 ++++++++++++++++++++++++++++++++++++------ src/AllPlot.h | 5 ++ src/AllPlotWindow.cpp | 31 +++++++++ src/AllPlotWindow.h | 4 ++ src/BikeScore.cpp | 47 ++++++++++++++ src/Colors.cpp | 2 + src/Colors.h | 4 +- src/DBAccess.cpp | 3 +- src/LTMPlot.cpp | 8 +++ src/LTMTool.cpp | 75 +++++++++++++++++++++ src/RideFile.cpp | 12 +++- src/RideFile.h | 12 ++-- 12 files changed, 322 insertions(+), 29 deletions(-) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 72b5c7c4a..26abc281b 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -280,6 +280,10 @@ AllPlotObject::AllPlotObject(AllPlot *plot) : plot(plot) wattsCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); wattsCurve->setYAxis(QwtAxisId(QwtAxis::yLeft, 0)); + antissCurve = new QwtPlotCurve(tr("anTISS")); + antissCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); + antissCurve->setYAxis(QwtAxisId(QwtAxis::yRight, 3)); + atissCurve = new QwtPlotCurve(tr("aTISS")); atissCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); atissCurve->setYAxis(QwtAxisId(QwtAxis::yRight, 3)); @@ -392,7 +396,7 @@ void AllPlotObject::setColor(QColor color) { QList worklist; - worklist << mCurve << wCurve << wattsCurve << atissCurve << npCurve << xpCurve << speedCurve << accelCurve + worklist << mCurve << wCurve << wattsCurve << atissCurve << antissCurve << npCurve << xpCurve << speedCurve << accelCurve << wattsDCurve << cadDCurve << nmDCurve << hrDCurve << apCurve << cadCurve << tempCurve << hrCurve << torqueCurve << balanceLCurve << balanceRCurve << altCurve; @@ -431,6 +435,7 @@ AllPlotObject::~AllPlotObject() wCurve->detach(); delete wCurve; wattsCurve->detach(); delete wattsCurve; atissCurve->detach(); delete atissCurve; + antissCurve->detach(); delete antissCurve; npCurve->detach(); delete npCurve; xpCurve->detach(); delete xpCurve; apCurve->detach(); delete apCurve; @@ -461,6 +466,7 @@ AllPlotObject::setVisible(bool show) wattsCurve->detach(); npCurve->detach(); atissCurve->detach(); + antissCurve->detach(); xpCurve->detach(); apCurve->detach(); hrCurve->detach(); @@ -498,6 +504,7 @@ AllPlotObject::setVisible(bool show) wattsCurve->attach(plot); npCurve->attach(plot); atissCurve->attach(plot); + antissCurve->attach(plot); xpCurve->attach(plot); apCurve->attach(plot); hrCurve->attach(plot); @@ -534,6 +541,7 @@ AllPlotObject::hideUnwanted() if (plot->showPowerState>1) wattsCurve->detach(); if (!plot->showNP) npCurve->detach(); if (!plot->showATISS) atissCurve->detach(); + if (!plot->showANTISS) antissCurve->detach(); if (!plot->showXP) xpCurve->detach(); if (!plot->showAP) apCurve->detach(); if (!plot->showW) wCurve->detach(); @@ -560,6 +568,7 @@ AllPlot::AllPlot(AllPlotWindow *parent, Context *context, RideFile::SeriesType s shade_zones(true), showPowerState(3), showATISS(false), + showANTISS(false), showNP(false), showXP(false), showAP(false), @@ -673,6 +682,7 @@ AllPlot::configChanged() if (appsettings->value(this, GC_ANTIALIAS, false).toBool() == true) { standard->wattsCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->atissCurve->setRenderHint(QwtPlotItem::RenderAntialiased); + standard->antissCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->npCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->xpCurve->setRenderHint(QwtPlotItem::RenderAntialiased); standard->apCurve->setRenderHint(QwtPlotItem::RenderAntialiased); @@ -704,7 +714,12 @@ AllPlot::configChanged() QPen npPen = QPen(GColor(CNPOWER)); npPen.setWidth(width); standard->npCurve->setPen(npPen); - standard->atissCurve->setPen(npPen); + QPen antissPen = QPen(GColor(CANTISS)); + antissPen.setWidth(width); + standard->antissCurve->setPen(antissPen); + QPen atissPen = QPen(GColor(CATISS)); + atissPen.setWidth(width); + standard->atissCurve->setPen(atissPen); QPen xpPen = QPen(GColor(CXPOWER)); xpPen.setWidth(width); standard->xpCurve->setPen(xpPen); @@ -786,10 +801,17 @@ AllPlot::configChanged() p.setAlpha(64); standard->wattsCurve->setBrush(QBrush(p)); + p = standard->atissCurve->pen().color(); + p.setAlpha(64); + standard->atissCurve->setBrush(QBrush(p)); + + p = standard->antissCurve->pen().color(); + p.setAlpha(64); + standard->antissCurve->setBrush(QBrush(p)); + p = standard->npCurve->pen().color(); p.setAlpha(64); standard->npCurve->setBrush(QBrush(p)); - standard->atissCurve->setBrush(QBrush(p)); p = standard->xpCurve->pen().color(); p.setAlpha(64); @@ -853,6 +875,7 @@ AllPlot::configChanged() } else { standard->wattsCurve->setBrush(Qt::NoBrush); standard->atissCurve->setBrush(Qt::NoBrush); + standard->antissCurve->setBrush(Qt::NoBrush); standard->npCurve->setBrush(Qt::NoBrush); standard->xpCurve->setBrush(Qt::NoBrush); standard->apCurve->setBrush(Qt::NoBrush); @@ -934,8 +957,8 @@ AllPlot::configChanged() sd->enableComponent(QwtScaleDraw::Backbone, false); sd->setTickLength(QwtScaleDiv::MajorTick, 3); setAxisScaleDraw(QwtAxisId(QwtAxis::yRight, 3), sd); - pal.setColor(QPalette::WindowText, GColor(CNPOWER)); - pal.setColor(QPalette::Text, GColor(CNPOWER)); + pal.setColor(QPalette::WindowText, GColor(CATISS)); + pal.setColor(QPalette::Text, GColor(CATISS)); axisWidget(QwtAxisId(QwtAxis::yRight, 3))->setPalette(pal); } @@ -952,9 +975,9 @@ AllPlot::setHighlightIntervals(bool state) } struct DataPoint { - double time, hr, watts, atiss, np, ap, xp, speed, cad, alt, temp, wind, torque, lrbalance, kphd, wattsd, cadd, nmd, hrd; - DataPoint(double t, double h, double w, double at, double n, double l, double x, double s, double c, double a, double te, double wi, double tq, double lrb, double kphd, double wattsd, double cadd, double nmd, double hrd) : - time(t), hr(h), watts(w), atiss(at), np(n), ap(l), xp(x), speed(s), cad(c), alt(a), temp(te), wind(wi), torque(tq), lrbalance(lrb), kphd(kphd), wattsd(wattsd), cadd(cadd), nmd(nmd), hrd(hrd) {} + double time, hr, watts, atiss, antiss, np, ap, xp, speed, cad, alt, temp, wind, torque, lrbalance, kphd, wattsd, cadd, nmd, hrd; + DataPoint(double t, double h, double w, double at, double an, double n, double l, double x, double s, double c, double a, double te, double wi, double tq, double lrb, double kphd, double wattsd, double cadd, double nmd, double hrd) : + time(t), hr(h), watts(w), atiss(at), antiss(an), np(n), ap(l), xp(x), speed(s), cad(c), alt(a), temp(te), wind(wi), torque(tq), lrbalance(lrb), kphd(kphd), wattsd(wattsd), cadd(cadd), nmd(nmd), hrd(hrd) {} }; bool AllPlot::shadeZones() const @@ -1018,8 +1041,9 @@ AllPlot::recalc(AllPlotObject *objects) objects->wCurve->setSamples(data,data); objects->mCurve->setSamples(data,data); - if (!objects->atissArray.empty()) - objects->atissCurve->setSamples(data, data); + if (!objects->atissArray.empty()) objects->atissCurve->setSamples(data, data); + if (!objects->antissArray.empty()) objects->antissCurve->setSamples(data, data); + if (!objects->npArray.empty()) objects->npCurve->setSamples(data, data); if (!objects->xpArray.empty()) @@ -1064,6 +1088,7 @@ AllPlot::recalc(AllPlotObject *objects) double totalWatts = 0.0; double totalNP = 0.0; double totalATISS = 0.0; + double totalANTISS = 0.0; double totalXP = 0.0; double totalAP = 0.0; double totalHr = 0.0; @@ -1086,6 +1111,7 @@ AllPlot::recalc(AllPlotObject *objects) objects->smoothWatts.resize(rideTimeSecs + 1); //(rideTimeSecs + 1); objects->smoothNP.resize(rideTimeSecs + 1); //(rideTimeSecs + 1); objects->smoothAT.resize(rideTimeSecs + 1); //(rideTimeSecs + 1); + objects->smoothANT.resize(rideTimeSecs + 1); //(rideTimeSecs + 1); objects->smoothXP.resize(rideTimeSecs + 1); //(rideTimeSecs + 1); objects->smoothAP.resize(rideTimeSecs + 1); //(rideTimeSecs + 1); objects->smoothHr.resize(rideTimeSecs + 1); @@ -1111,6 +1137,7 @@ AllPlot::recalc(AllPlotObject *objects) objects->smoothWatts[secs] = 0.0; objects->smoothNP[secs] = 0.0; objects->smoothAT[secs] = 0.0; + objects->smoothANT[secs] = 0.0; objects->smoothXP[secs] = 0.0; objects->smoothAP[secs] = 0.0; objects->smoothHr[secs] = 0.0; @@ -1139,6 +1166,7 @@ AllPlot::recalc(AllPlotObject *objects) (!objects->hrArray.empty() ? objects->hrArray[i] : 0), (!objects->wattsArray.empty() ? objects->wattsArray[i] : 0), (!objects->atissArray.empty() ? objects->atissArray[i] : 0), + (!objects->antissArray.empty() ? objects->antissArray[i] : 0), (!objects->npArray.empty() ? objects->npArray[i] : 0), (!objects->apArray.empty() ? objects->apArray[i] : 0), (!objects->xpArray.empty() ? objects->xpArray[i] : 0), @@ -1159,6 +1187,7 @@ AllPlot::recalc(AllPlotObject *objects) if (!objects->npArray.empty()) totalNP += objects->npArray[i]; if (!objects->atissArray.empty()) totalATISS += objects->atissArray[i]; + if (!objects->antissArray.empty()) totalANTISS += objects->antissArray[i]; if (!objects->xpArray.empty()) totalXP += objects->xpArray[i]; @@ -1204,6 +1233,7 @@ AllPlot::recalc(AllPlotObject *objects) totalWatts -= dp.watts; totalNP -= dp.np; totalATISS -= dp.atiss; + totalANTISS -= dp.antiss; totalAP -= dp.ap; totalXP -= dp.xp; totalHr -= dp.hr; @@ -1227,6 +1257,7 @@ AllPlot::recalc(AllPlotObject *objects) objects->smoothWatts[secs] = 0.0; objects->smoothNP[secs] = 0.0; objects->smoothAT[secs] = 0.0; + objects->smoothANT[secs] = 0.0; objects->smoothXP[secs] = 0.0; objects->smoothAP[secs] = 0.0; objects->smoothHr[secs] = 0.0; @@ -1249,6 +1280,7 @@ AllPlot::recalc(AllPlotObject *objects) objects->smoothWatts[secs] = totalWatts / list.size(); objects->smoothNP[secs] = totalNP / list.size(); objects->smoothAT[secs] = totalATISS / list.size(); + objects->smoothANT[secs] = totalANTISS / list.size(); objects->smoothXP[secs] = totalXP / list.size(); objects->smoothAP[secs] = totalAP / list.size(); objects->smoothHr[secs] = totalHr / list.size(); @@ -1288,6 +1320,7 @@ AllPlot::recalc(AllPlotObject *objects) objects->smoothWatts.resize(0); objects->smoothNP.resize(0); objects->smoothAT.resize(0); + objects->smoothANT.resize(0); objects->smoothXP.resize(0); objects->smoothAP.resize(0); objects->smoothHr.resize(0); @@ -1312,6 +1345,7 @@ AllPlot::recalc(AllPlotObject *objects) objects->smoothWatts.append(dp->watts); objects->smoothNP.append(dp->np); objects->smoothAT.append(dp->atiss); + objects->smoothANT.append(dp->antiss); objects->smoothXP.append(dp->xp); objects->smoothAP.append(dp->apower); objects->smoothHr.append(dp->hr); @@ -1367,6 +1401,10 @@ AllPlot::recalc(AllPlotObject *objects) objects->wattsCurve->setSamples(xaxis.data() + startingIndex, objects->smoothWatts.data() + startingIndex, totalPoints); } + if (!objects->antissArray.empty()) { + objects->antissCurve->setSamples(xaxis.data() + startingIndex, objects->smoothANT.data() + startingIndex, totalPoints); + } + if (!objects->atissArray.empty()) { objects->atissCurve->setSamples(xaxis.data() + startingIndex, objects->smoothAT.data() + startingIndex, totalPoints); } @@ -1536,7 +1574,7 @@ AllPlot::refreshReferenceLines() if (context->isCompareIntervals) return; // only on power based charts - if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && + if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && scope != RideFile::anTISS && scope != RideFile::NP && scope != RideFile::aPower && scope != RideFile::xPower) return; foreach(QwtPlotCurve *referenceLine, standard->referenceLines) { @@ -1561,7 +1599,7 @@ AllPlot::plotReferenceLine(const RideFilePoint *referencePoint) if (context->isCompareIntervals) return NULL; // only on power based charts - if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && + if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && scope != RideFile::anTISS && scope != RideFile::NP && scope != RideFile::aPower && scope != RideFile::xPower) return NULL; QwtPlotCurve *referenceLine = NULL; @@ -1620,10 +1658,11 @@ AllPlot::setYMax() { // set axis scales - if (showATISS && standard->atissCurve->isVisible() && rideItem && rideItem->ride()) { + if (((showATISS && standard->atissCurve->isVisible()) || (showANTISS && standard->antissCurve->isVisible())) + && rideItem && rideItem->ride()) { - setAxisTitle(QwtAxisId(QwtAxis::yRight, 3), tr("Aerobic TISS")); - setAxisScale(QwtAxisId(QwtAxis::yRight, 3),0,standard->atissCurve->maxYValue() * 1.05); + setAxisTitle(QwtAxisId(QwtAxis::yRight, 3), tr("TISS")); + setAxisScale(QwtAxisId(QwtAxis::yRight, 3),0, qMax(standard->atissCurve->maxYValue(), standard->atissCurve->maxYValue()) * 1.05); setAxisLabelAlignment(QwtAxisId(QwtAxis::yRight, 3),Qt::AlignVCenter); } @@ -1792,13 +1831,13 @@ AllPlot::setYMax() if (wantaxis) { - setAxisVisible(yLeft, standard->wattsCurve->isVisible() || standard->atissCurve->isVisible() || + setAxisVisible(yLeft, standard->wattsCurve->isVisible() || standard->atissCurve->isVisible() || standard->antissCurve->isVisible() || standard->npCurve->isVisible() || standard->xpCurve->isVisible() || standard->apCurve->isVisible()); setAxisVisible(QwtAxisId(QwtAxis::yLeft, 1), standard->hrCurve->isVisible() || standard->cadCurve->isVisible()); setAxisVisible(yRight, standard->speedCurve->isVisible()); setAxisVisible(QwtAxisId(QwtAxis::yRight, 1), standard->altCurve->isVisible()); setAxisVisible(QwtAxisId(QwtAxis::yRight, 2), standard->wCurve->isVisible()); - setAxisVisible(QwtAxisId(QwtAxis::yRight, 3), standard->atissCurve->isVisible()); + setAxisVisible(QwtAxisId(QwtAxis::yRight, 3), standard->atissCurve->isVisible() || standard->antissCurve->isVisible()); setAxisVisible(QwtAxisId(QwtAxis::yLeft, 2), false); setAxisVisible(xBottom, true); @@ -1864,6 +1903,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) double *smoothW = &plot->standard->smoothWatts[startidx]; double *smoothN = &plot->standard->smoothNP[startidx]; double *smoothAT = &plot->standard->smoothAT[startidx]; + double *smoothANT = &plot->standard->smoothANT[startidx]; double *smoothX = &plot->standard->smoothXP[startidx]; double *smoothL = &plot->standard->smoothAP[startidx]; double *smoothT = &plot->standard->smoothTime[startidx]; @@ -1929,6 +1969,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) standard->mCurve->detach(); standard->wattsCurve->detach(); standard->atissCurve->detach(); + standard->antissCurve->detach(); standard->npCurve->detach(); standard->xpCurve->detach(); standard->apCurve->detach(); @@ -1949,6 +1990,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) standard->wattsCurve->setVisible(rideItem->ride()->areDataPresent()->watts && showPowerState < 2); standard->atissCurve->setVisible(rideItem->ride()->areDataPresent()->watts && showATISS); + standard->antissCurve->setVisible(rideItem->ride()->areDataPresent()->watts && showANTISS); standard->npCurve->setVisible(rideItem->ride()->areDataPresent()->np && showNP); standard->xpCurve->setVisible(rideItem->ride()->areDataPresent()->xp && showXP); standard->apCurve->setVisible(rideItem->ride()->areDataPresent()->apower && showAP); @@ -1975,6 +2017,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) } standard->wattsCurve->setSamples(xaxis,smoothW,stopidx-startidx); standard->atissCurve->setSamples(xaxis,smoothAT,stopidx-startidx); + standard->antissCurve->setSamples(xaxis,smoothANT,stopidx-startidx); standard->npCurve->setSamples(xaxis,smoothN,stopidx-startidx); standard->xpCurve->setSamples(xaxis,smoothX,stopidx-startidx); standard->apCurve->setSamples(xaxis,smoothL,stopidx-startidx); @@ -2027,6 +2070,17 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) } standard->wattsCurve->setSymbol(sym); + sym = new QwtSymbol; + sym->setPen(QPen(GColor(CPLOTMARKER))); + if (stopidx-startidx < 150) { + sym->setStyle(QwtSymbol::Ellipse); + sym->setSize(3); + } else { + sym->setStyle(QwtSymbol::NoSymbol); + sym->setSize(0); + } + standard->antissCurve->setSymbol(sym); + sym = new QwtSymbol; sym->setPen(QPen(GColor(CPLOTMARKER))); if (stopidx-startidx < 150) { @@ -2230,6 +2284,9 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) if (!plot->standard->smoothWatts.empty()) { standard->wattsCurve->attach(this); } + if (!plot->standard->smoothANT.empty()) { + standard->antissCurve->attach(this); + } if (!plot->standard->smoothAT.empty()) { standard->atissCurve->attach(this); } @@ -2313,6 +2370,7 @@ AllPlot::setDataFromPlot(AllPlot *plot) standard->mCurve->detach(); standard->wattsCurve->detach(); standard->atissCurve->detach(); + standard->antissCurve->detach(); standard->npCurve->detach(); standard->xpCurve->detach(); standard->apCurve->detach(); @@ -2335,6 +2393,7 @@ AllPlot::setDataFromPlot(AllPlot *plot) standard->mCurve->setVisible(false); standard->wattsCurve->setVisible(false); standard->atissCurve->setVisible(false); + standard->antissCurve->setVisible(false); standard->npCurve->setVisible(false); standard->xpCurve->setVisible(false); standard->apCurve->setVisible(false); @@ -2479,6 +2538,14 @@ AllPlot::setDataFromPlot(AllPlot *plot) } break; + case RideFile::anTISS: + { + ourCurve = standard->antissCurve; + thereCurve = referencePlot->standard->antissCurve; + title = tr("Anaerobic TISS"); + } + break; + case RideFile::aTISS: { ourCurve = standard->atissCurve; @@ -2677,6 +2744,7 @@ AllPlot::setDataFromPlots(QList plots) standard->mCurve->detach(); standard->wattsCurve->detach(); standard->atissCurve->detach(); + standard->antissCurve->detach(); standard->npCurve->detach(); standard->xpCurve->detach(); standard->apCurve->detach(); @@ -2699,6 +2767,7 @@ AllPlot::setDataFromPlots(QList plots) standard->mCurve->setVisible(false); standard->wattsCurve->setVisible(false); standard->atissCurve->setVisible(false); + standard->antissCurve->setVisible(false); standard->npCurve->setVisible(false); standard->xpCurve->setVisible(false); standard->apCurve->setVisible(false); @@ -2882,6 +2951,15 @@ AllPlot::setDataFromPlots(QList plots) } break; + case RideFile::anTISS: + { + ourCurve = new QwtPlotCurve(tr("Anaerobic TISS")); + ourCurve->setPaintAttribute(QwtPlotCurve::FilterPoints, true); + thereCurve = referencePlot->standard->antissCurve; + title = tr("Anaerobic TISS"); + } + break; + case RideFile::aTISS: { ourCurve = new QwtPlotCurve(tr("Aerobic TISS")); @@ -3117,6 +3195,7 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->mCurve->detach(); standard->wattsCurve->detach(); standard->atissCurve->detach(); + standard->antissCurve->detach(); standard->npCurve->detach(); standard->xpCurve->detach(); standard->apCurve->detach(); @@ -3141,6 +3220,7 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->mCurve->setVisible(false); standard->wattsCurve->setVisible(false); standard->atissCurve->setVisible(false); + standard->antissCurve->setVisible(false); standard->npCurve->setVisible(false); standard->xpCurve->setVisible(false); standard->apCurve->setVisible(false); @@ -3175,6 +3255,12 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->wattsCurve->setVisible(true); } + if (!object->antissArray.empty()) { + standard->antissCurve->setSamples(xaxis.data(), object->smoothANT.data(), totalPoints); + standard->antissCurve->attach(this); + standard->antissCurve->setVisible(true); + } + if (!object->atissArray.empty()) { standard->atissCurve->setSamples(xaxis.data(), object->smoothAT.data(), totalPoints); standard->atissCurve->attach(this); @@ -3290,6 +3376,7 @@ AllPlot::setDataFromObject(AllPlotObject *object, AllPlot *reference) standard->wattsCurve->setVisible(referencePlot->showPowerState < 2); standard->npCurve->setVisible(referencePlot->showNP); standard->atissCurve->setVisible(referencePlot->showATISS); + standard->antissCurve->setVisible(referencePlot->showANTISS); standard->xpCurve->setVisible(referencePlot->showXP); standard->apCurve->setVisible(referencePlot->showAP); standard->hrCurve->setVisible(referencePlot->showHr); @@ -3359,6 +3446,7 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here) int npoints = ride->dataPoints().size(); here->wattsArray.resize(dataPresent->watts ? npoints : 0); here->atissArray.resize(dataPresent->watts ? npoints : 0); + here->antissArray.resize(dataPresent->watts ? npoints : 0); here->npArray.resize(dataPresent->np ? npoints : 0); here->xpArray.resize(dataPresent->xp ? npoints : 0); here->apArray.resize(dataPresent->apower ? npoints : 0); @@ -3383,6 +3471,7 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here) here->mCurve->detach(); here->wattsCurve->detach(); here->atissCurve->detach(); + here->antissCurve->detach(); here->npCurve->detach(); here->xpCurve->detach(); here->apCurve->detach(); @@ -3404,6 +3493,7 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here) if (!here->altArray.empty()) here->altCurve->attach(this); if (!here->wattsArray.empty()) here->wattsCurve->attach(this); if (!here->atissArray.empty()) here->atissCurve->attach(this); + if (!here->antissArray.empty()) here->antissCurve->attach(this); if (!here->npArray.empty()) here->npCurve->attach(this); if (!here->xpArray.empty()) here->xpCurve->attach(this); if (!here->apArray.empty()) here->apCurve->attach(this); @@ -3434,6 +3524,7 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here) here->mCurve->setVisible(dataPresent->watts && showPowerState < 2 && showW); here->wattsCurve->setVisible(dataPresent->watts && showPowerState < 2); here->atissCurve->setVisible(dataPresent->watts && showATISS); + here->antissCurve->setVisible(dataPresent->watts && showANTISS); here->npCurve->setVisible(dataPresent->np && showNP); here->xpCurve->setVisible(dataPresent->xp && showXP); here->apCurve->setVisible(dataPresent->apower && showAP); @@ -3473,6 +3564,7 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here) here->timeArray[arrayLength] = secs + msecs/1000; if (!here->wattsArray.empty()) here->wattsArray[arrayLength] = max(0, point->watts); if (!here->atissArray.empty()) here->atissArray[arrayLength] = max(0, point->atiss); + if (!here->antissArray.empty()) here->antissArray[arrayLength] = max(0, point->antiss); if (!here->npArray.empty()) here->npArray[arrayLength] = max(0, point->np); if (!here->xpArray.empty()) here->xpArray[arrayLength] = max(0, point->xp); if (!here->apArray.empty()) here->apArray[arrayLength] = max(0, point->apower); @@ -3531,6 +3623,7 @@ AllPlot::setDataFromRideFile(RideFile *ride, AllPlotObject *here) here->mCurve->detach(); here->wattsCurve->detach(); here->atissCurve->detach(); + here->antissCurve->detach(); here->npCurve->detach(); here->xpCurve->detach(); here->apCurve->detach(); @@ -3611,6 +3704,19 @@ AllPlot::setShowNP(bool show) replot(); } +void +AllPlot::setShowANTISS(bool show) +{ + showANTISS = show; + standard->antissCurve->setVisible(show); + setYMax(); + + // remember the curves and colors + isolation = false; + curveColors->saveState(); + replot(); +} + void AllPlot::setShowATISS(bool show) { @@ -3866,6 +3972,7 @@ AllPlot::setPaintBrush(int state) p.setAlpha(64); standard->npCurve->setBrush(QBrush(p)); standard->atissCurve->setBrush(QBrush(p)); + standard->antissCurve->setBrush(QBrush(p)); p = standard->xpCurve->pen().color(); p.setAlpha(64); @@ -3927,6 +4034,7 @@ AllPlot::setPaintBrush(int state) standard->wattsCurve->setBrush(Qt::NoBrush); standard->npCurve->setBrush(Qt::NoBrush); standard->atissCurve->setBrush(Qt::NoBrush); + standard->antissCurve->setBrush(Qt::NoBrush); standard->xpCurve->setBrush(Qt::NoBrush); standard->apCurve->setBrush(Qt::NoBrush); standard->hrCurve->setBrush(Qt::NoBrush); @@ -4328,8 +4436,8 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) // if power is going on we worry about reference lines // otherwise not so much .. - if ((showPowerState<2 && scope == RideFile::none) || scope == RideFile::watts || scope == RideFile::aTISS || - scope == RideFile::NP || scope == RideFile::aPower || scope == RideFile::xPower) { + if ((showPowerState<2 && scope == RideFile::none) || scope == RideFile::watts || scope == RideFile::aTISS || + scope == RideFile::anTISS || scope == RideFile::NP || scope == RideFile::aPower || scope == RideFile::xPower) { int axis = -1; if (obj == axisWidget(QwtPlot::yLeft)) @@ -4426,7 +4534,7 @@ AllPlot::plotTmpReference(int axis, int x, int y) if (context->isCompareIntervals) return; // only on power based charts - if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && + if (scope != RideFile::none && scope != RideFile::watts && scope != RideFile::aTISS && scope != RideFile::anTISS && scope != RideFile::NP && scope != RideFile::aPower && scope != RideFile::xPower) return; if (x>0) { diff --git a/src/AllPlot.h b/src/AllPlot.h index 956d9ab0a..654e137e3 100644 --- a/src/AllPlot.h +++ b/src/AllPlot.h @@ -297,6 +297,7 @@ class AllPlotObject : public QObject QwtPlotCurve *wattsCurve; QwtPlotCurve *atissCurve; + QwtPlotCurve *antissCurve; QwtPlotCurve *npCurve; QwtPlotCurve *xpCurve; QwtPlotCurve *apCurve; @@ -321,6 +322,7 @@ class AllPlotObject : public QObject QVector hrArray; QVector wattsArray; QVector atissArray; + QVector antissArray; QVector npArray; QVector xpArray; QVector apArray; @@ -342,6 +344,7 @@ class AllPlotObject : public QObject // smoothed data QVector smoothWatts; QVector smoothAT; + QVector smoothANT; QVector smoothNP; QVector smoothAP; QVector smoothXP; @@ -435,6 +438,7 @@ class AllPlot : public QwtPlot void setShowPower(int id); void setShowNP(bool show); void setShowATISS(bool show); + void setShowANTISS(bool show); void setShowXP(bool show); void setShowAP(bool show); void setShowHr(bool show); @@ -475,6 +479,7 @@ class AllPlot : public QwtPlot bool shade_zones; int showPowerState; bool showATISS; + bool showANTISS; bool showNP; bool showXP; bool showAP; diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index 260aac998..19901de2c 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -196,6 +196,10 @@ AllPlotWindow::AllPlotWindow(Context *context) : showTorque->setCheckState(Qt::Checked); cl2->addRow(new QLabel(""), showTorque); + showANTISS = new QCheckBox(tr("Anaerobic TISS"), this); + showANTISS->setCheckState(Qt::Unchecked); + cl2->addRow(new QLabel(""), showANTISS); + showATISS = new QCheckBox(tr("Aerobic TISS"), this); showATISS->setCheckState(Qt::Unchecked); cl2->addRow(new QLabel(""), showATISS); @@ -500,6 +504,7 @@ AllPlotWindow::AllPlotWindow(Context *context) : 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(showANTISS, SIGNAL(stateChanged(int)), this, SLOT(setShowANTISS(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))); @@ -744,6 +749,7 @@ AllPlotWindow::compareChanged() if (showWind->isChecked()) wanted << RideFile::headwind; if (showNP->isChecked()) wanted << RideFile::NP; if (showATISS->isChecked()) wanted << RideFile::aTISS; + if (showANTISS->isChecked()) wanted << RideFile::anTISS; if (showXP->isChecked()) wanted << RideFile::xPower; if (showAP->isChecked()) wanted << RideFile::aPower; if (showW->isChecked()) wanted << RideFile::wprime; @@ -1800,6 +1806,29 @@ AllPlotWindow::setShowNP(int value) forceSetupSeriesStackPlots(); // scope changed so force redraw } +void +AllPlotWindow::setShowANTISS(int value) +{ + showANTISS->setChecked(value); + + // compare mode selfcontained update + if (isCompare()) { + compareChanged(); + return; + } + + bool checked = ( ( value == Qt::Checked ) && showANTISS->isEnabled()) ? true : false; + + // recalc only does it if it needs to + if (value && current && current->ride()) current->ride()->recalculateDerivedSeries(); + + allPlot->setShowANTISS(checked); + foreach (AllPlot *plot, allPlots) + plot->setShowANTISS(checked); + // and the series stacks too + forceSetupSeriesStackPlots(); // scope changed so force redraw +} + void AllPlotWindow::setShowATISS(int value) { @@ -2518,6 +2547,7 @@ AllPlotWindow::setupSeriesStackPlots() 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 (showANTISS->isChecked() && rideItem->ride()->areDataPresent()->watts) serieslist << RideFile::anTISS; 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; @@ -2697,6 +2727,7 @@ AllPlotWindow::setupStackPlots() _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->setShowANTISS((showANTISS->isEnabled()) ? ( showANTISS->checkState() == Qt::Checked ) : false ); _allPlot->setShowGrid(showGrid->checkState() == Qt::Checked); _allPlot->setPaintBrush(paintBrush->checkState()); _allPlot->setSmoothing(smoothSlider->value()); diff --git a/src/AllPlotWindow.h b/src/AllPlotWindow.h index 55b786da9..43314e7d9 100644 --- a/src/AllPlotWindow.h +++ b/src/AllPlotWindow.h @@ -59,6 +59,7 @@ class AllPlotWindow : public GcChartWindow Q_PROPERTY(int showGrid READ isShowGrid WRITE setShowGrid USER true) Q_PROPERTY(int showFull READ isShowFull WRITE setShowFull USER true) Q_PROPERTY(int showATISS READ isShowATISS WRITE setShowATISS USER true) + Q_PROPERTY(int showANTISS READ isShowANTISS WRITE setShowANTISS USER true) Q_PROPERTY(int showNP READ isShowNP WRITE setShowNP USER true) Q_PROPERTY(int showXP READ isShowXP WRITE setShowXP USER true) Q_PROPERTY(int showAP READ isShowAP WRITE setShowAP USER true) @@ -101,6 +102,7 @@ class AllPlotWindow : public GcChartWindow int isShowGrid() const { return showGrid->checkState(); } int isShowFull() const { return showFull->checkState(); } int isShowATISS() const { return showATISS->checkState(); } + int isShowANTISS() const { return showANTISS->checkState(); } int isShowNP() const { return showNP->checkState(); } int isShowXP() const { return showXP->checkState(); } int isShowAP() const { return showAP->checkState(); } @@ -140,6 +142,7 @@ class AllPlotWindow : public GcChartWindow void setStackWidth(int x); void setShowNP(int state); void setShowATISS(int state); + void setShowANTISS(int state); void setShowXP(int state); void setShowAP(int state); void setShowSpeed(int state); @@ -238,6 +241,7 @@ class AllPlotWindow : public GcChartWindow QCheckBox *paintBrush; QCheckBox *showAlt; QCheckBox *showATISS; + QCheckBox *showANTISS; QCheckBox *showNP; QCheckBox *showXP; QCheckBox *showAP; diff --git a/src/BikeScore.cpp b/src/BikeScore.cpp index 9b30a0969..f1e25330c 100644 --- a/src/BikeScore.cpp +++ b/src/BikeScore.cpp @@ -269,6 +269,52 @@ class aTISS : public RideMetric { RideMetric *clone() const { return new aTISS(*this); } }; +class anTISS : public RideMetric { + Q_DECLARE_TR_FUNCTIONS(aTISS) + + public: + + anTISS() + { + setSymbol("antiss_score"); + setInternalName("Anaerobic TISS"); + } + void initialize() { + setName(tr("Anaerobic TISS")); + setMetricUnits(""); + setImperialUnits(""); + } + + void compute(const RideFile *r, const Zones *zones, int zoneRange, + const HrZones *, int, + const QHash &, + const Context *) { + + if (!zones || zoneRange < 0) + return; + + // anTISS - Aerobic Training Impact Scoring System + static const double a = 0.238923886004611f; + static const double b = -12.2066385296127f; + static const double c = -1.73549567522521f; + double anTISS = 0.0f; + + int cp = r->getTag("CP","0").toInt(); + if (!cp) cp = zones->getCP(zoneRange); + + if (cp && r->areDataPresent()->watts) { + foreach (RideFilePoint *p, r->dataPoints()) { + + // a * exp (b * exp (c * fraction of cp) ) + anTISS += r->recIntSecs() * (a * exp(b * exp(c * (double(p->watts) / double(cp))))); + } + } + setValue(anTISS); + } + + RideMetric *clone() const { return new anTISS(*this); } +}; + class BikeScore : public RideMetric { Q_DECLARE_TR_FUNCTIONS(BikeScore) double score; @@ -348,6 +394,7 @@ class ResponseIndex : public RideMetric { static bool addAllSix() { RideMetricFactory::instance().addMetric(aTISS()); + RideMetricFactory::instance().addMetric(anTISS()); RideMetricFactory::instance().addMetric(CriticalPower()); RideMetricFactory::instance().addMetric(XPower()); QVector deps; diff --git a/src/Colors.cpp b/src/Colors.cpp index 0c0ddde7e..721b0c5c4 100644 --- a/src/Colors.cpp +++ b/src/Colors.cpp @@ -117,6 +117,8 @@ void GCColor::setupColors() { tr("Right Balance"), "CBALANCERIGHT", QColor(128,0,50) }, { tr("W' Balance"), "CWBAL", Qt::red }, { tr("Ride CP Curve"), "CRIDECP", Qt::black }, + { tr("Aerobic TISS"), "CATISS", Qt::magenta }, + { tr("Anaerobic TISS"), "CANTISS", Qt::cyan }, { "", "", QColor(0,0,0) }, }; diff --git a/src/Colors.h b/src/Colors.h index ef73f1301..86f12cc93 100644 --- a/src/Colors.h +++ b/src/Colors.h @@ -101,7 +101,7 @@ class ColorEngine : public QObject #define GColor(x) GCColor::getColor(x) // Define how many cconfigurable metric colors are available -#define CNUMOFCFGCOLORS 77 +#define CNUMOFCFGCOLORS 79 #define CPLOTBACKGROUND 0 #define CRIDEPLOTBACKGROUND 1 @@ -180,5 +180,7 @@ class ColorEngine : public QObject #define CBALANCERIGHT 74 #define CWBAL 75 #define CRIDECP 76 +#define CATISS 77 +#define CANTISS 78 #endif diff --git a/src/DBAccess.cpp b/src/DBAccess.cpp index d82dd9c17..7bc9ed50e 100644 --- a/src/DBAccess.cpp +++ b/src/DBAccess.cpp @@ -85,8 +85,9 @@ // 64 17 Mar 2014 Mark Liversedge Added W' and CP work to PMC metrics // 65 17 Mar 2014 Mark Liversedge Added Aerobic TISS prototype // 66 18 Mar 2014 Mark Liversedge Updated aPower calculation +// 67 22 Mar 2014 Mark Liversedge Added Anaerobic TISS prototype -int DBSchemaVersion = 65; +int DBSchemaVersion = 67; DBAccess::DBAccess(Context* context) : context(context), db(NULL) { diff --git a/src/LTMPlot.cpp b/src/LTMPlot.cpp index 36d8aab5f..8cfc14bd7 100644 --- a/src/LTMPlot.cpp +++ b/src/LTMPlot.cpp @@ -2367,6 +2367,8 @@ LTMPlot::createPMCCurveData(Context *context, LTMSettings *settings, MetricDetai // create a custom set of summary metric data! if (metricDetail.symbol.startsWith("skiba")) { scoreType = "skiba_bike_score"; + } else if (metricDetail.symbol.startsWith("antiss")) { + scoreType = "antiss_score"; } else if (metricDetail.symbol.startsWith("atiss")) { scoreType = "atiss_score"; } else if (metricDetail.symbol.startsWith("coggan")) { @@ -2417,6 +2419,12 @@ LTMPlot::createPMCCurveData(Context *context, LTMSettings *settings, MetricDetai add.setForSymbol("skiba_sb", sc->getSBvalues()[i]); add.setForSymbol("skiba_sr", sc->getSRvalues()[i]); add.setForSymbol("skiba_lr", sc->getLRvalues()[i]); + } else if (scoreType == "antiss_score") { + add.setForSymbol("antiss_lts", sc->getLTSvalues()[i]); + add.setForSymbol("antiss_sts", sc->getSTSvalues()[i]); + add.setForSymbol("antiss_sb", sc->getSBvalues()[i]); + add.setForSymbol("antiss_sr", sc->getSRvalues()[i]); + add.setForSymbol("antiss_lr", sc->getLRvalues()[i]); } else if (scoreType == "atiss_score") { add.setForSymbol("atiss_lts", sc->getLTSvalues()[i]); add.setForSymbol("atiss_sts", sc->getSTSvalues()[i]); diff --git a/src/LTMTool.cpp b/src/LTMTool.cpp index 912ed49d9..a631ec568 100644 --- a/src/LTMTool.cpp +++ b/src/LTMTool.cpp @@ -371,6 +371,81 @@ LTMTool::LTMTool(Context *context, LTMSettings *settings) : QWidget(context->mai atissLTR.uunits = tr("Ramp"); metrics.append(atissLTR); + // SKIBA Anerobic TISS LTS + MetricDetail antissLTS; + antissLTS.type = METRIC_PM; + antissLTS.symbol = "antiss_lts"; + antissLTS.metric = NULL; // not a factory metric + antissLTS.penColor = QColor(Qt::blue); + antissLTS.curveStyle = QwtPlotCurve::Lines; + antissLTS.symbolStyle = QwtSymbol::NoSymbol; + antissLTS.smooth = false; + antissLTS.trend = false; + antissLTS.topN = 1; + antissLTS.uname = antissLTS.name = tr("Anaerobic TISS Long Term Stress"); + antissLTS.units = "Stress"; + antissLTS.uunits = tr("Stress"); + metrics.append(antissLTS); + + MetricDetail antissSTS; + antissSTS.type = METRIC_PM; + antissSTS.symbol = "antiss_sts"; + antissSTS.metric = NULL; // not a factory metric + antissSTS.penColor = QColor(Qt::magenta); + antissSTS.curveStyle = QwtPlotCurve::Lines; + antissSTS.symbolStyle = QwtSymbol::NoSymbol; + antissSTS.smooth = false; + antissSTS.trend = false; + antissSTS.topN = 1; + antissSTS.uname = antissSTS.name = tr("Anaerobic TISS Short Term Stress"); + antissSTS.units = "Stress"; + antissSTS.uunits = tr("Stress"); + metrics.append(antissSTS); + + MetricDetail antissSB; + antissSB.type = METRIC_PM; + antissSB.symbol = "antiss_sb"; + antissSB.metric = NULL; // not a factory metric + antissSB.penColor = QColor(Qt::yellow); + antissSB.curveStyle = QwtPlotCurve::Steps; + antissSB.symbolStyle = QwtSymbol::NoSymbol; + antissSB.smooth = false; + antissSB.trend = false; + antissSB.topN = 1; + antissSB.uname = antissSB.name = tr("Anaerobic TISS Stress Balance"); + antissSB.units = "Stress Balance"; + antissSB.uunits = tr("Stress Balance"); + metrics.append(antissSB); + + MetricDetail antissSTR; + antissSTR.type = METRIC_PM; + antissSTR.symbol = "antiss_sr"; + antissSTR.metric = NULL; // not a factory metric + antissSTR.penColor = QColor(Qt::darkGreen); + antissSTR.curveStyle = QwtPlotCurve::Steps; + antissSTR.symbolStyle = QwtSymbol::NoSymbol; + antissSTR.smooth = false; + antissSTR.trend = false; + antissSTR.topN = 1; + antissSTR.uname = antissSTR.name = tr("Anaerobic TISS STS Ramp"); + antissSTR.units = "Ramp"; + antissSTR.uunits = tr("Ramp"); + metrics.append(antissSTR); + + MetricDetail antissLTR; + antissLTR.type = METRIC_PM; + antissLTR.symbol = "antiss_lr"; + antissLTR.metric = NULL; // not a factory metric + antissLTR.penColor = QColor(Qt::darkBlue); + antissLTR.curveStyle = QwtPlotCurve::Steps; + antissLTR.symbolStyle = QwtSymbol::NoSymbol; + antissLTR.smooth = false; + antissLTR.trend = false; + antissLTR.topN = 1; + antissLTR.uname = antissLTR.name = tr("Anaerobic TISS LTS Ramp"); + antissLTR.units = "Ramp"; + antissLTR.uunits = tr("Ramp"); + metrics.append(antissLTR); // DANIELS LTS MetricDetail danielsLTS; danielsLTS.type = METRIC_PM; diff --git a/src/RideFile.cpp b/src/RideFile.cpp index eaefec8fe..891b79fac 100644 --- a/src/RideFile.cpp +++ b/src/RideFile.cpp @@ -668,6 +668,7 @@ RideFile::isDataPresent(SeriesType series) case watts : return dataPresent.watts; break; case aPower : return dataPresent.apower; break; case aTISS : return dataPresent.atiss; break; + case anTISS : return dataPresent.antiss; break; case alt : return dataPresent.alt; break; case lon : return dataPresent.lon; break; case lat : return dataPresent.lat; break; @@ -733,6 +734,7 @@ RideFilePoint::value(RideFile::SeriesType series) const case RideFile::xPower : return xp; break; case RideFile::aPower : return apower; break; case RideFile::aTISS : return atiss; break; + case RideFile::anTISS : return antiss; break; default: case RideFile::none : break; @@ -1041,9 +1043,15 @@ RideFile::recalculateDerivedSeries() static const double b = -7.5095428451195f; static const double c = -0.86118031563782f; static const double t = 2; + // anTISS + static const double an = 0.238923886004611f; + static const double bn = -12.2066385296127f; + static const double cn = -1.73549567522521f; + int CP = 0; int WPRIME = 0; double aTISS = 0.0f; + double anTISS = 0.0f; // set WPrime and CP if (context->athlete->zones()) { @@ -1188,12 +1196,14 @@ RideFile::recalculateDerivedSeries() APtotal += p->apower; APcount++; - // Aerobic TISS + // Anaerobic and Aerobic TISS if (CP && dataPresent.watts) { // a * exp (b * exp (c * fraction of cp) ) aTISS += recIntSecs_ * (a * exp(b * exp(c * (double(p->watts) / double(CP))))); + anTISS += recIntSecs_ * (an * exp(bn * exp(cn * (double(p->watts) / double(CP))))); p->atiss = aTISS; + p->antiss = anTISS; } // last point diff --git a/src/RideFile.h b/src/RideFile.h index 65ba45169..f2d06bc96 100644 --- a/src/RideFile.h +++ b/src/RideFile.h @@ -61,14 +61,14 @@ struct RideFileDataPresent bool secs, cad, hr, km, kph, nm, watts, alt, lon, lat, headwind, slope, temp, lrbalance, interval; // derived - bool np,xp,apower,wprime,atiss; + bool np,xp,apower,wprime,atiss,antiss; // whether non-zero data of each field is present RideFileDataPresent(): 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), interval(false), - np(false), xp(false), apower(false), wprime(false), atiss(false) {} + np(false), xp(false), apower(false), wprime(false), atiss(false), antiss(false) {} }; struct RideFileInterval @@ -116,7 +116,7 @@ class RideFile : public QObject // QObject to emit signals virtual ~RideFile(); // Working with DATASERIES - enum seriestype { secs=0, cad, cadd, hr, hrd, km, kph, kphd, nm, nmd, watts, wattsd, alt, lon, lat, headwind, slope, temp, interval, NP, xPower, vam, wattsKg, lrbalance, aPower, wprime, aTISS, none }; + enum seriestype { secs=0, cad, cadd, hr, hrd, km, kph, kphd, nm, nmd, watts, wattsd, alt, lon, lat, headwind, slope, temp, interval, NP, xPower, vam, wattsKg, lrbalance, aPower, wprime, aTISS, anTISS, none }; enum specialValues { noTemp = -255 }; typedef enum seriestype SeriesType; @@ -284,14 +284,14 @@ struct RideFilePoint // derived data (we calculate it) // xPower, normalised power, aPower - double xp, np, apower, atiss; + double xp, np, apower, atiss, antiss; // create blank point RideFilePoint() : secs(0.0), cad(0.0), hr(0.0), km(0.0), kph(0.0), nm(0.0), watts(0.0), alt(0.0), lon(0.0), lat(0.0), headwind(0.0), slope(0.0), temp(-255.0), lrbalance(0), hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0), interval(0), xp(0), np(0), - apower(0), atiss(0.0) {} + apower(0), atiss(0.0), antiss(0.0) {} // create point supplying all values RideFilePoint(double secs, double cad, double hr, double km, double kph, @@ -301,7 +301,7 @@ struct RideFilePoint secs(secs), cad(cad), hr(hr), km(km), kph(kph), nm(nm), watts(watts), alt(alt), lon(lon), lat(lat), headwind(headwind), slope(slope), temp(temp), lrbalance(lrbalance), hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0), interval(interval), - xp(0), np(0), apower(0), atiss(0.0) {} + xp(0), np(0), apower(0), atiss(0.0), antiss(0.0) {} // get the value via the series type rather than access direct to the values double value(RideFile::SeriesType series) const;