From f4d902dcbb491a82e8315c4dd61b59488cef7ddc Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 25 Sep 2014 14:31:06 +0100 Subject: [PATCH] Add Garmin Running Dynamics Data .. read from FIT/TCX .. write to JSON .. view in Editor NOTE: They are not on any of the charts yet. --- src/Bin2RideFile.cpp | 2 +- src/BinRideFile.cpp | 2 +- src/ComparePane.cpp | 2 +- src/Computrainer3dpFile.cpp | 2 ++ src/CriticalPowerWindow.cpp | 3 ++- src/CsvRideFile.cpp | 4 +-- src/FitRideFile.cpp | 39 +++++++++++++++++++++++++---- src/FitlogParser.cpp | 4 ++- src/FitlogRideFile.cpp | 4 ++- src/FixGaps.cpp | 8 ++++++ src/GcRideFile.cpp | 2 +- src/GpxParser.cpp | 5 ++-- src/IntervalSummaryWindow.cpp | 6 +++-- src/JsonRideFile.l | 3 +++ src/JsonRideFile.y | 10 +++++++- src/ManualRideFile.cpp | 4 ++- src/PolarRideFile.cpp | 2 +- src/PwxRideFile.cpp | 1 + src/QuarqParser.cpp | 5 ++-- src/RawRideFile.cpp | 5 +++- src/RideEditor.cpp | 6 +++++ src/RideFile.cpp | 47 +++++++++++++++++++++++++++++++++-- src/RideFile.h | 24 ++++++++++++++---- src/RideFileTableModel.cpp | 12 +++++++++ src/RideSummaryWindow.cpp | 3 ++- src/SlfParser.cpp | 2 +- src/SplitActivityWizard.cpp | 1 + src/SrdRideFile.cpp | 2 +- src/SrmRideFile.cpp | 2 +- src/SyncRideFile.cpp | 2 +- src/TacxCafRideFile.cpp | 4 +-- src/TcxParser.cpp | 16 ++++++++++-- src/TcxParser.h | 1 + src/TxtRideFile.cpp | 4 +-- src/WkoRideFile.cpp | 1 + 35 files changed, 198 insertions(+), 42 deletions(-) diff --git a/src/Bin2RideFile.cpp b/src/Bin2RideFile.cpp index b03397073..3572d6fb2 100644 --- a/src/Bin2RideFile.cpp +++ b/src/Bin2RideFile.cpp @@ -232,7 +232,7 @@ struct Bin2FileReaderState lng = lng/10000000.0; // 0.0 values at end are for garmin vector torque efficiency/pedal smoothness which are not available - rideFile->appendPoint(*secs, cad, hr, km, kph, nm, watts, alt, lng, lat, 0.0, 0, temp, lrbal, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + rideFile->appendPoint(*secs, cad, hr, km, kph, nm, watts, alt, lng, lat, 0.0, 0, temp, lrbal, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); (*secs)++; } diff --git a/src/BinRideFile.cpp b/src/BinRideFile.cpp index da0908d6d..f8290d47a 100644 --- a/src/BinRideFile.cpp +++ b/src/BinRideFile.cpp @@ -487,7 +487,7 @@ struct BinFileReaderState int lat = 0; // the 0.0 values are L and R torque efficiency and pedal smoothness which are not available in this format - rideFile->appendPoint(secs, cad, hr, km, kph, nm, watts, alt, lng, lat, headwind, grade, temperature, lrbalance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + rideFile->appendPoint(secs, cad, hr, km, kph, nm, watts, alt, lng, lat, headwind, grade, temperature, lrbalance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); } void decodeSparseData(const BinDefinition &def, const std::vector values) { diff --git a/src/ComparePane.cpp b/src/ComparePane.cpp index fa81943d0..d6d2c238a 100644 --- a/src/ComparePane.cpp +++ b/src/ComparePane.cpp @@ -723,7 +723,7 @@ ComparePane::dropEvent(QDropEvent *event) add.data->appendPoint(p->secs - offset, p->cad, p->hr, p->km - offsetKM, p->kph, p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, - p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, 0); + p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, p->rvert, p->rcad, p->rcontact, 0); // get derived data calculated RideFilePoint *l = add.data->dataPoints().last(); diff --git a/src/Computrainer3dpFile.cpp b/src/Computrainer3dpFile.cpp index 6a06d687d..c53db8380 100644 --- a/src/Computrainer3dpFile.cpp +++ b/src/Computrainer3dpFile.cpp @@ -240,6 +240,7 @@ RideFile *Computrainer3dpFileReader::openRideFile(QFile & file, altitude, 0, 0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, // pedal torque eff / pedal smoothness 0.0, 0.0, + 0.0, 0.0, 0.0, // running dynamics 0); } // while loop since an interval in the .3dp file might @@ -294,6 +295,7 @@ RideFile *Computrainer3dpFileReader::openRideFile(QFile & file, 0.0, 0.0, 0.0, 0.0, 0.0, // pedal torque effectiveness / pedal smoothness 0.0, 0.0, // smO2 / tHb + 0.0, 0.0, 0.0, // running dynamics 0); // reset averaging sums diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index 45e51f91c..9879c0d18 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -981,7 +981,8 @@ CriticalPowerWindow::showIntervalCurve(IntervalItem *current, int index) if ((p->secs+f.recIntSecs()) >= current->start && p->secs <= (current->stop+f.recIntSecs())) { f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, - p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, 0); + p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, + p->rvert, p->rcad, p->rcontact, 0); } } // for xpower and acceleration et al diff --git a/src/CsvRideFile.cpp b/src/CsvRideFile.cpp index 69423317b..609f54352 100644 --- a/src/CsvRideFile.cpp +++ b/src/CsvRideFile.cpp @@ -396,13 +396,13 @@ RideFile *CsvFileReader::openRideFile(QFile &file, QStringList &errors, QListappendPoint(seconds, cad, hr, km, kph, nm, watts, alt, lon, lat, 0.0, 0.0, temp, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, interval); + 0.0, 0.0, 0.0, 0.0, 0.0, interval); else rideFile->appendPoint(minutes * 60.0, cad, hr, km, kph, nm, watts, alt, lon, lat, headwind, slope, temp, 0.0, 0.0, 0.0, 0.0, 0.0, - smo2, thb, interval); + smo2, thb, 0.0, 0.0, 0.0, interval); } ++lineno; } diff --git a/src/FitRideFile.cpp b/src/FitRideFile.cpp index 0f6544d1a..8b03744cc 100644 --- a/src/FitRideFile.cpp +++ b/src/FitRideFile.cpp @@ -261,7 +261,7 @@ struct FitFileReaderState if( value == NA_VALUE ) continue; - printf("decodeSession field %d: %d bytes, num %d, type %d\n", i, field.size, field.num, field.type ); + //printf("decodeSession field %d: %d bytes, num %d, type %d\n", i, field.size, field.num, field.type ); } } @@ -273,7 +273,7 @@ struct FitFileReaderState if( value == NA_VALUE ) continue; - printf("decodeDeviceInfo field %d: %d bytes, num %d, type %d\n", i, field.size, field.num, field.type ); + //printf("decodeDeviceInfo field %d: %d bytes, num %d, type %d\n", i, field.size, field.num, field.type ); } } @@ -389,7 +389,9 @@ struct FitFileReaderState double alt = 0, cad = 0, km = 0, hr = 0, lat = 0, lng = 0, badgps = 0, lrbalance = 0; double kph = 0, temperature = RideFile::NoTemp, watts = 0, slope = 0; double leftTorqueEff = 0, rightTorqueEff = 0, leftPedalSmooth = 0, rightPedalSmooth = 0; + double rvert = 0, rcad = 0, rcontact = 0; double smO2 = 0, tHb = 0; + bool run=false; fit_value_t lati = NA_VALUE, lngi = NA_VALUE; int i = 0; @@ -420,8 +422,12 @@ struct FitFileReaderState hr = value; break; case 4: // CADENCE - cad = value; + if (run) + rcad = value; + else + cad = value; break; + case 5: // DISTANCE km = value / 100000.0; break; @@ -450,6 +456,19 @@ struct FitFileReaderState break; case 31: // GPS Accuracy break; + + case 39: // VERTICAL OSCILLATION + rvert = value / 100.0f; + break; + + case 40: // IS RUNNING ACTIVITY? + run = true; + break; + + case 41: // GROUND CONTACT TIME + rcontact = value / 10.0f; + break; + case 43: // LEFT_TORQUE_EFFECTIVENESS leftTorqueEff = value / 2.0; //qDebug() << "LEFT_TORQUE_EFFECTIVENESS" << leftTorqueEff; @@ -470,7 +489,11 @@ struct FitFileReaderState //qDebug() << "COMBINED_PEDAL_SMOOTHNES" << value; break; - default: unknown_record_fields.insert(field.num); + case 53: // RUNNING CADENCE FRACTIONAL VALUE + break; + + default: + unknown_record_fields.insert(field.num); } } if (time == last_time) @@ -543,6 +566,9 @@ struct FitFileReaderState double deltaRightPS = rightPedalSmooth - prevPoint->rps; double deltaSmO2 = smO2 - prevPoint->smo2; double deltaTHb = tHb - prevPoint->thb; + double deltarvert = rvert - prevPoint->rvert; + double deltarcad = rcad - prevPoint->rcad; + double deltarcontact = rcontact - prevPoint->rcontact; // only smooth for less than 30 minutes // we don't want to crash / stall on bad @@ -572,6 +598,9 @@ struct FitFileReaderState prevPoint->rps + (deltaRightPS * weight), prevPoint->smo2 + (deltaSmO2 * weight), prevPoint->thb + (deltaTHb * weight), + prevPoint->rvert + (deltarvert * weight), + prevPoint->rcad + (deltarcad * weight), + prevPoint->rcontact + (deltarcontact * weight), interval); } prevPoint = rideFile->dataPoints().back(); @@ -581,7 +610,7 @@ struct FitFileReaderState if (km < 0.00001f) km = last_distance; rideFile->appendPoint(secs, cad, hr, km, kph, nm, watts, alt, lng, lat, headwind, slope, temperature, lrbalance, leftTorqueEff, rightTorqueEff, leftPedalSmooth, rightPedalSmooth, - smO2, tHb, interval); + smO2, tHb, rvert, rcad, rcontact, interval); last_time = time; last_distance = km; } diff --git a/src/FitlogParser.cpp b/src/FitlogParser.cpp index 04d04848d..175d7a274 100644 --- a/src/FitlogParser.cpp +++ b/src/FitlogParser.cpp @@ -100,7 +100,9 @@ FitlogParser::startElement( const QString&, const QString&, // now add rideFile->appendPoint(point.secs,point.cad,point.hr,point.km,point.kph,point.nm, point.watts,point.alt,point.lon,point.lat, point.headwind, - 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, point.interval); + 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0,// running dynamics + point.interval); } return true; } diff --git a/src/FitlogRideFile.cpp b/src/FitlogRideFile.cpp index cb8db71ac..bfbcf6505 100644 --- a/src/FitlogRideFile.cpp +++ b/src/FitlogRideFile.cpp @@ -150,7 +150,9 @@ FitlogFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &f break; f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, - 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); + 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, // running dynamics + 0); } if (f.dataPoints().size() == 0) { // Interval empty, do not compute any metrics diff --git a/src/FixGaps.cpp b/src/FixGaps.cpp index 872a7648c..907eaa9d1 100644 --- a/src/FixGaps.cpp +++ b/src/FixGaps.cpp @@ -196,6 +196,9 @@ FixGaps::postProcess(RideFile *ride, DataProcessorConfig *config=0) double rpsdelta = (point->rps - last->rps) / (double) count; double smo2delta = (point->smo2 - last->smo2) / (double) count; double thbdelta = (point->thb - last->thb) / (double) count; + double rcontactdelta = (point->rcontact - last->rcontact) / (double) count; + double rcaddelta = (point->rcad - last->rcad) / (double) count; + double rvertdelta = (point->rvert - last->rvert) / (double) count; // add the points for(int i=0; irps + ((i+1)*rpsdelta), last->smo2 + ((i+1)*smo2delta), last->thb + ((i+1)*thbdelta), + last->rvert + ((i+1)*rvertdelta), + last->rcad + ((i+1)*rcaddelta), + last->rcontact + ((i+1)*rcontactdelta), last->interval); + ride->command->insertPoint(position++, add); } @@ -250,6 +257,7 @@ FixGaps::postProcess(RideFile *ride, DataProcessorConfig *config=0) 0, 0.0, 0.0, 0.0, 0.0, //pedal torque / smoothness 0.0, 0.0, // smO2 / thb + 0.0, 0.0, 0.0, // running dynamics last->interval); ride->command->insertPoint(position++, add); } diff --git a/src/GcRideFile.cpp b/src/GcRideFile.cpp index a1fa01e7f..42fd0b01b 100644 --- a/src/GcRideFile.cpp +++ b/src/GcRideFile.cpp @@ -147,7 +147,7 @@ GcFileReader::openRideFile(QFile &file, QStringList &errors, QList*) lat = sample.attribute("lat", "0.0").toDouble(); while ((interval < intervalStops.size()) && (secs >= intervalStops[interval])) ++interval; - rideFile->appendPoint(secs, cad, hr, km, kph, nm, watts, alt, lon, lat, headwind, 0.0, RideFile::NoTemp, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + rideFile->appendPoint(secs, cad, hr, km, kph, nm, watts, alt, lon, lat, headwind, 0.0, RideFile::NoTemp, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); if (!recIntSet) { rideFile->setRecIntSecs(sample.attribute("len").toDouble()); recIntSet = true; diff --git a/src/GpxParser.cpp b/src/GpxParser.cpp index 99e512fcf..9830132cf 100644 --- a/src/GpxParser.cpp +++ b/src/GpxParser.cpp @@ -199,7 +199,7 @@ bool if(rideFile->dataPoints().empty()) { // first point rideFile->appendPoint(secs, cad, hr, distance, speed, 0, watts, alt, lon, lat, 0, 0.0, temp, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); } else { // assumption that the change in ride is linear... :) @@ -219,7 +219,7 @@ bool // no smart recording, or delta exceeds HW treshold, or no time elements; just insert the data rideFile->appendPoint(secs, cad, hr, distance, speed, 0,watts, alt, lon, lat, 0, 0.0, temp, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); } else { @@ -248,6 +248,7 @@ bool 0, 0.0, 0.0, 0.0, 0.0, // pedal torque/smoothness 0.0, 0.0, // SmO2 / tHb + 0.0, 0.0, 0.0, // running dynamics 0); } prevPoint = rideFile->dataPoints().back(); diff --git a/src/IntervalSummaryWindow.cpp b/src/IntervalSummaryWindow.cpp index 4c0206768..39ddfa01d 100644 --- a/src/IntervalSummaryWindow.cpp +++ b/src/IntervalSummaryWindow.cpp @@ -122,7 +122,8 @@ void IntervalSummaryWindow::calcInterval(IntervalItem* interval, QString& html) const RideFilePoint *p = ride->dataPoints()[i]; f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, p->slope, p->temp, p->lrbalance, - p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, 0); + p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, + p->rvert, p->rcad, p->rcontact, 0); // derived data RideFilePoint *l = f.dataPoints().last(); @@ -194,7 +195,8 @@ void IntervalSummaryWindow::calcInterval(RideFileInterval interval, QString& htm const RideFilePoint *p = ride->dataPoints()[i]; f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, p->slope, p->temp, p->lrbalance, - p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, 0); + p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, + p->rvert, p->rcad, p->rcontact, 0); // derived data RideFilePoint *l = f.dataPoints().last(); diff --git a/src/JsonRideFile.l b/src/JsonRideFile.l index c37bbab98..0a373737f 100644 --- a/src/JsonRideFile.l +++ b/src/JsonRideFile.l @@ -75,6 +75,9 @@ \"RPS\" return RPS; \"SMO2\" return SMO2; \"THB\" return THB; +\"RCON\" return RCON; +\"RVERT\" return RVERT; +\"RCAD\" return RCAD; [-+]?[0-9]+ return JS_INTEGER; [-+]?[0-9]+e-[0-9]+ return JS_FLOAT; [-+]?[0-9]+\.[-+e0-9]* return JS_FLOAT; diff --git a/src/JsonRideFile.y b/src/JsonRideFile.y index 42cda45dd..db7577708 100644 --- a/src/JsonRideFile.y +++ b/src/JsonRideFile.y @@ -112,7 +112,8 @@ static QString unprotect(const char * string) %token TAGS INTERVALS NAME START STOP %token CALIBRATIONS VALUE %token REFERENCES -%token SAMPLES SECS KM WATTS NM CAD KPH HR ALTITUDE LAT LON HEADWIND SLOPE TEMP LRBALANCE LTE RTE LPS RPS THB SMO2 +%token SAMPLES SECS KM WATTS NM CAD KPH HR ALTITUDE LAT LON HEADWIND SLOPE TEMP +%token LRBALANCE LTE RTE LPS RPS THB SMO2 RVERT RCAD RCON %start document %% @@ -240,6 +241,7 @@ sample: '{' series_list '}' { JsonRide->appendPoint(JsonPoint.secs, JsonPoint.lte, JsonPoint.rte, JsonPoint.lps, JsonPoint.rps, JsonPoint.smo2, JsonPoint.thb, + JsonPoint.rvert, JsonPoint.rcad, JsonPoint.rcontact, JsonPoint.interval); JsonPoint = RideFilePoint(); } @@ -265,6 +267,9 @@ series: SECS ':' number { JsonPoint.secs = JsonNumber; } | RPS ':' number { JsonPoint.rps = JsonNumber; } | SMO2 ':' number { JsonPoint.smo2 = JsonNumber; } | THB ':' number { JsonPoint.thb = JsonNumber; } + | RVERT ':' number { JsonPoint.rvert = JsonNumber; } + | RCAD ':' number { JsonPoint.rcad = JsonNumber; } + | RCON ':' number { JsonPoint.rcontact = JsonNumber; } ; /* @@ -531,6 +536,9 @@ JsonFileReader::writeRideFile(Context *, const RideFile *ride, QFile &file) cons if (ride->areDataPresent()->rps) out << ", \"RPS\":" << QString("%1").arg(p->rps); if (ride->areDataPresent()->smo2) out << ", \"SMO2\":" << QString("%1").arg(p->smo2); if (ride->areDataPresent()->thb) out << ", \"THB\":" << QString("%1").arg(p->thb); + if (ride->areDataPresent()->rcad) out << ", \"RCAD\":" << QString("%1").arg(p->rcad); + if (ride->areDataPresent()->rvert) out << ", \"RVERT\":" << QString("%1").arg(p->rvert); + if (ride->areDataPresent()->rcontact) out << ", \"RCON\":" << QString("%1").arg(p->rcontact); // sample points in here! out << " }"; diff --git a/src/ManualRideFile.cpp b/src/ManualRideFile.cpp index 65a00f464..4cc08c69d 100644 --- a/src/ManualRideFile.cpp +++ b/src/ManualRideFile.cpp @@ -126,7 +126,9 @@ RideFile *ManualFileReader::openRideFile(QFile &file, QStringList &errors, QList kph, nm, watts, alt, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, // running dynamics + interval); QMap bsm; bsm.insert("value", QString("%1").arg(bs)); rideFile->metricOverrides.insert("skiba_bike_score", bsm); diff --git a/src/PolarRideFile.cpp b/src/PolarRideFile.cpp index 15adf3ff7..96f078dec 100644 --- a/src/PolarRideFile.cpp +++ b/src/PolarRideFile.cpp @@ -262,7 +262,7 @@ this differently alt *= METERS_PER_FOOT; } - rideFile->appendPoint(seconds, cad, hr, km, kph, nm, watts, alt, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, lrbalance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + rideFile->appendPoint(seconds, cad, hr, km, kph, nm, watts, alt, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, lrbalance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); //fprintf(stderr, " %f, %f, %f, %f, %f, %f, %f, %d\n", seconds, cad, hr, km, kph, nm, watts, alt, interval); } diff --git a/src/PwxRideFile.cpp b/src/PwxRideFile.cpp index dbf6ec3fd..561d6cdb6 100644 --- a/src/PwxRideFile.cpp +++ b/src/PwxRideFile.cpp @@ -249,6 +249,7 @@ PwxFileReader::PwxFromDomDoc(QDomDocument doc, QStringList &errors) const add.nm, add.watts, add.alt, add.lon, add.lat, add.headwind, add.slope, add.temp, add.lrbalance, add.lte, add.rte, add.lps, add.rps, add.smo2, add.thb, + add.rvert, add.rcad, add.rcontact, add.interval); diff --git a/src/QuarqParser.cpp b/src/QuarqParser.cpp index 4b2ec0ae8..379368148 100644 --- a/src/QuarqParser.cpp +++ b/src/QuarqParser.cpp @@ -51,7 +51,7 @@ QuarqParser::incrementTime( const double new_time ) while (time_diff > seconds_from_start) { rideFile->appendPoint(seconds_from_start, cad, hr, km, - kph, nm, watts, 0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); + kph, nm, watts, 0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); seconds_from_start += SAMPLE_INTERVAL; } @@ -113,7 +113,8 @@ QuarqParser::endElement( const QString&, const QString&, const QString& qName) // flush one last data point if (qName == "Qollector") { rideFile->appendPoint(seconds_from_start, cad, hr, km, - kph, nm, watts, 0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0, 0); + kph, nm, watts, 0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0); } return true; diff --git a/src/RawRideFile.cpp b/src/RawRideFile.cpp index 2c720d038..d89dded46 100644 --- a/src/RawRideFile.cpp +++ b/src/RawRideFile.cpp @@ -71,7 +71,9 @@ time_cb(struct tm *, time_t since_epoch, void *context) state->rideFile->appendPoint(secs, 0.0, 0.0, state->last_miles * KM_PER_MILE, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0,state->last_interval); + RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0, // running dynamic + state->last_interval); state->last_secs = secs; } @@ -88,6 +90,7 @@ data_cb(double secs, double nm, double mph, double watts, double miles, double a mph * KM_PER_MILE, nm, watts, alt, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0, // pedal smooth/te 0.0,0.0, + 0.0,0.0,0.0, interval); state->last_secs = secs; state->last_miles = miles; diff --git a/src/RideEditor.cpp b/src/RideEditor.cpp index 27e8e48d3..2672d8e12 100644 --- a/src/RideEditor.cpp +++ b/src/RideEditor.cpp @@ -227,6 +227,9 @@ RideEditor::whatColumns() << tr("Right PS") << tr("SmO2") << tr("tHb") + << tr("Vertical Oscillation") + << tr("Run Cadence") + << tr("GCT") << tr("Interval"); return what; @@ -820,6 +823,9 @@ RideEditor::insColumn(QString name) if (name == tr("Right PS")) series = RideFile::rps; if (name == tr("SmO2")) series = RideFile::smO2; if (name == tr("tHb")) series = RideFile::tHb; + if (name == tr("Vertical Oscillation")) series = RideFile::rvert; + if (name == tr("Run Cadence")) series = RideFile::rcad; + if (name == tr("GCT")) series = RideFile::rcontact; model->insertColumn(series); } diff --git a/src/RideFile.cpp b/src/RideFile.cpp index ec718c213..be003394a 100644 --- a/src/RideFile.cpp +++ b/src/RideFile.cpp @@ -145,6 +145,9 @@ RideFile::seriesName(SeriesType series) case RideFile::wprime: return QString(tr("W' balance")); case RideFile::smO2: return QString(tr("SmO2")); case RideFile::tHb: return QString(tr("THb")); + case RideFile::rvert: return QString(tr("Vertical Oscillation")); + case RideFile::rcad: return QString(tr("Run Cadence")); + case RideFile::rcontact: return QString(tr("GCT")); default: return QString(tr("Unknown")); } } @@ -154,6 +157,7 @@ RideFile::colorFor(SeriesType series) { switch (series) { case RideFile::cad: return GColor(CCADENCE); + case RideFile::rcad: return GColor(CCADENCE); case RideFile::cadd: return GColor(CCADENCE); case RideFile::hr: return GColor(CHEARTRATE); case RideFile::hrd: return GColor(CHEARTRATE); @@ -187,6 +191,8 @@ RideFile::colorFor(SeriesType series) case RideFile::lon: case RideFile::lat: case RideFile::slope: + case RideFile::rvert: + case RideFile::rcontact: default: return GColor(CPLOTMARKER); } } @@ -231,6 +237,9 @@ RideFile::unitName(SeriesType series, Context *context) case RideFile::wprime: return QString(useMetricUnits ? tr("joules") : tr("joules")); case RideFile::smO2: return QString(tr("%")); case RideFile::tHb: return QString(tr("g/dL")); + case RideFile::rcad: return QString(tr("spm")); + case RideFile::rvert: return QString(tr("cm")); + case RideFile::rcontact: return QString(tr("ms")); default: return QString(tr("Unknown")); } } @@ -679,6 +688,7 @@ void RideFile::appendPoint(double secs, double cad, double hr, double km, double slope, double temp, double lrbalance, double lte, double rte, double lps, double rps, double smo2, double thb, + double rvert, double rcad, double rcontact, int interval) { // negative values are not good, make them zero @@ -697,6 +707,9 @@ void RideFile::appendPoint(double secs, double cad, double hr, double km, if (!isfinite(rte) || rte<0) rte=0; if (!isfinite(smo2) || smo2<0) smo2=0; if (!isfinite(thb) || thb<0) thb=0; + if (!isfinite(rvert) || rvert<0) rvert=0; + if (!isfinite(rcad) || rcad<0) rcad=0; + if (!isfinite(rcontact) || rcontact<0) rcontact=0; // truncate alt out of bounds -- ? should do for all, but uncomfortable about // setting an absolute max. At least We know the highest @@ -706,6 +719,7 @@ void RideFile::appendPoint(double secs, double cad, double hr, double km, RideFilePoint* point = new RideFilePoint(secs, cad, hr, km, kph, nm, watts, alt, lon, lat, headwind, slope, temp, lrbalance, lte, rte, lps, rps, smo2, thb, + rvert, rcad, rcontact, interval); dataPoints_.append(point); @@ -729,6 +743,9 @@ void RideFile::appendPoint(double secs, double cad, double hr, double km, dataPresent.rps |= (rps != 0); dataPresent.smo2 |= (smo2 != 0); dataPresent.thb |= (thb != 0); + dataPresent.rvert |= (rvert != 0); + dataPresent.rcad |= (rcad != 0); + dataPresent.rcontact |= (rcontact != 0); dataPresent.interval |= (interval != 0); updateMin(point); @@ -743,6 +760,7 @@ void RideFile::appendPoint(const RideFilePoint &point) point.headwind, point.slope, point.temp, point.lrbalance, point.lte, point.rte, point.lps, point.rps, point.smo2, point.thb, + point.rvert, point.rcad, point.rcontact, point.interval)); } @@ -770,6 +788,9 @@ RideFile::setDataPresent(SeriesType series, bool value) case rps : dataPresent.rps = value; break; case smO2 : dataPresent.smo2 = value; break; case tHb : dataPresent.thb = value; break; + case rcad : dataPresent.rcad = value; break; + case rvert : dataPresent.rvert = value; break; + case rcontact : dataPresent.rcontact = value; break; case interval : dataPresent.interval = value; break; case wprime : dataPresent.wprime = value; break; default: @@ -804,6 +825,9 @@ RideFile::isDataPresent(SeriesType series) case rte : return dataPresent.rte; break; case smO2 : return dataPresent.smo2; break; case tHb : return dataPresent.thb; break; + case rvert : return dataPresent.rvert; break; + case rcad : return dataPresent.rcad; break; + case rcontact : return dataPresent.rcontact; break; case interval : return dataPresent.interval; break; default: case none : return false; break; @@ -834,6 +858,9 @@ RideFile::setPointValue(int index, SeriesType series, double value) case rps : dataPoints_[index]->rps = value; break; case smO2 : dataPoints_[index]->smo2 = value; break; case tHb : dataPoints_[index]->thb = value; break; + case rcad : dataPoints_[index]->rcad = value; break; + case rvert : dataPoints_[index]->rvert = value; break; + case rcontact : dataPoints_[index]->rcontact = value; break; case interval : dataPoints_[index]->interval = value; break; default: case none : break; @@ -869,6 +896,9 @@ RideFilePoint::value(RideFile::SeriesType series) const case RideFile::rps : return rps; break; case RideFile::tHb : return thb; break; case RideFile::smO2 : return smo2; break; + case RideFile::rcad : return rcad; break; + case RideFile::rvert : return rvert; break; + case RideFile::rcontact : return rcontact; break; case RideFile::interval : return interval; break; case RideFile::NP : return np; break; case RideFile::xPower : return xp; break; @@ -954,6 +984,9 @@ RideFile::decimalsFor(SeriesType series) case rte : return 0; break; case smO2 : return 0; break; case tHb : return 2; break; + case rcad : return 0; break; + case rvert : return 1; break; + case rcontact : return 1; break; case wprime : return 0; break; default: case none : break; @@ -993,6 +1026,9 @@ RideFile::maximumFor(SeriesType series) case lrbalance : return 100; break; case smO2 : return 100; break; case tHb : return 20; break; + case rcad : return 500; break; + case rvert : return 50; break; + case rcontact : return 1000; break; case wprime : return 99999; break; default : case none : break; @@ -1032,6 +1068,9 @@ RideFile::minimumFor(SeriesType series) case lrbalance : return 0; break; case smO2 : return 0; break; case tHb : return 0; break; + case rcad : return 0; break; + case rvert : return 0; break; + case rcontact : return 0; break; case wprime : return 0; break; default : case none : break; @@ -1130,8 +1169,12 @@ RideFile::getWeight() void RideFile::appendReference(const RideFilePoint &point) { - referencePoints_.append(new RideFilePoint(point.secs,point.cad,point.hr,point.km,point.kph,point.nm,point.watts,point.alt,point.lon,point.lat, - point.headwind, point.slope, point.temp, point.lrbalance, point.lte, point.rte, point.lps, point.rps, point.smo2, point.thb, point.interval)); + referencePoints_.append(new RideFilePoint(point.secs,point.cad,point.hr,point.km,point.kph,point.nm, + point.watts,point.alt,point.lon,point.lat, + point.headwind, point.slope, point.temp, point.lrbalance, + point.lte, point.rte, point.lps, point.rps, point.smo2, point.thb, + point.rvert, point.rcad, point.rcontact, + point.interval)); } void RideFile::removeReference(int index) diff --git a/src/RideFile.h b/src/RideFile.h index 97129f5db..f2b97b557 100644 --- a/src/RideFile.h +++ b/src/RideFile.h @@ -64,13 +64,17 @@ struct RideFileDataPresent // derived bool np,xp,apower,wprime,atiss,antiss; + // running + bool rvert, rcad, rcontact; + // 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), lte(false), rte(false), lps(false), rps(false), smo2(false), thb(false), interval(false), - np(false), xp(false), apower(false), wprime(false), atiss(false), antiss(false) {} + np(false), xp(false), apower(false), wprime(false), atiss(false), antiss(false), + rvert(false), rcad(false), rcontact(false) {} }; @@ -123,7 +127,8 @@ class RideFile : public QObject // QObject to emit signals 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, lte, rte, lps, rps, - aPower, wprime, aTISS, anTISS, smO2, tHb, none }; + aPower, wprime, aTISS, anTISS, smO2, tHb, + rvert, rcad, rcontact, none }; enum specialValues { NoTemp = -255 }; @@ -151,6 +156,7 @@ class RideFile : public QObject // QObject to emit signals double temperature, double lrbalance, double lte, double rte, double lps, double rps, double smo2, double thb, + double rvert, double rcad, double rcontact, int interval); void appendPoint(const RideFilePoint &); @@ -294,6 +300,10 @@ struct RideFilePoint double lrbalance, lte, rte, lps, rps; double smo2, thb; double hrd, cadd, kphd, nmd, wattsd; // acceleration in watts/s km/s + + // running data + double rvert, rcad, rcontact; + int interval; // derived data (we calculate it) @@ -307,21 +317,25 @@ struct RideFilePoint lps(0.0), rps(0.0), smo2(0.0), thb(0.0), hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0), + rvert(0.0), rcad(0.0), rcontact(0.0), interval(0), xp(0), np(0), - apower(0), atiss(0.0), antiss(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, double nm, double watts, double alt, double lon, double lat, double headwind, double slope, double temp, double lrbalance, double lte, double rte, double lps, double rps, - double smo2, double thb, int interval) : + double smo2, double thb, + double rvert, double rcad, double rcontact, + int interval) : 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), lte(lte), rte(rte), lps(lps), rps(rps), smo2(smo2), thb(thb), - hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0), interval(interval), + hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0), + rvert(rvert), rcad(rcad), rcontact(rcontact), interval(interval), 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 diff --git a/src/RideFileTableModel.cpp b/src/RideFileTableModel.cpp index 043021405..0a92ec3ad 100644 --- a/src/RideFileTableModel.cpp +++ b/src/RideFileTableModel.cpp @@ -149,6 +149,18 @@ RideFileTableModel::setHeadings(RideFile::SeriesType series) headings_ << tr("tHb"); headingsType << RideFile::tHb; } + if (series == RideFile::rcad || ride->areDataPresent()->rcad) { + headings_ << tr("Run Cadence"); + headingsType << RideFile::rcad; + } + if (series == RideFile::rvert || ride->areDataPresent()->rvert) { + headings_ << tr("Vertical Oscillation"); + headingsType << RideFile::rvert; + } + if (series == RideFile::rcontact || ride->areDataPresent()->rcontact) { + headings_ << tr("GCT"); + headingsType << RideFile::rcontact; + } if (series == RideFile::interval || ride->areDataPresent()->interval) { headings_ << tr("Interval"); headingsType << RideFile::interval; diff --git a/src/RideSummaryWindow.cpp b/src/RideSummaryWindow.cpp index 57b745d63..862a51fc1 100644 --- a/src/RideSummaryWindow.cpp +++ b/src/RideSummaryWindow.cpp @@ -830,7 +830,8 @@ RideSummaryWindow::htmlSummary() break; f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, - p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, 0); + p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, + p->smo2, p->thb, p->rvert, p->rcad, p->rcontact, 0); // derived data RideFilePoint *l = f.dataPoints().last(); diff --git a/src/SlfParser.cpp b/src/SlfParser.cpp index 4861f09bd..96e83a4af 100644 --- a/src/SlfParser.cpp +++ b/src/SlfParser.cpp @@ -149,7 +149,7 @@ SlfParser::endElement( const QString&, const QString&, const QString& qName) distance *= KM_PER_MILE; alt *= FEET_PER_METER; } - rideFile->appendPoint(secs, cadence, hr, distance, speed, torque, power, alt, lon, lat, headwind, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, lap); + rideFile->appendPoint(secs, cadence, hr, distance, speed, torque, power, alt, lon, lat, headwind, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, lap); secs += samplingRate; } } diff --git a/src/SplitActivityWizard.cpp b/src/SplitActivityWizard.cpp index fa56e5bda..6829591dc 100644 --- a/src/SplitActivityWizard.cpp +++ b/src/SplitActivityWizard.cpp @@ -778,6 +778,7 @@ SplitConfirm::createRideFile(long start, long stop) p->nm, p->watts, p->alt, p->lon, p->lat, p->headwind, p->slope, p->temp, p->lrbalance, p->lte, p->rte, p->lps, p->rps, p->smo2, p->thb, + p->rvert, p->rcad, p->rcontact, p->interval); } diff --git a/src/SrdRideFile.cpp b/src/SrdRideFile.cpp index f4f539590..23bf83b22 100644 --- a/src/SrdRideFile.cpp +++ b/src/SrdRideFile.cpp @@ -92,7 +92,7 @@ RideFile *SrdFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL km = w->dist_data[i]; // add to ride - result->appendPoint(time, cad, hr, km, kph, nm, watts, alt, lon, lat, wind, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); + result->appendPoint(time, cad, hr, km, kph, nm, watts, alt, lon, lat, wind, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); // keep a track of time time += w->recording_interval; diff --git a/src/SrmRideFile.cpp b/src/SrmRideFile.cpp index 160e39fb2..9c6988a04 100644 --- a/src/SrmRideFile.cpp +++ b/src/SrmRideFile.cpp @@ -315,7 +315,7 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL double nm = watts / 2.0 / PI / cad * 60.0; result->appendPoint(secs, cad, hr, km, kph, nm, watts, alt, 0.0, 0.0, 0.0, 0.0, temp, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); ++blkidx; if ((blkidx == blockhdrs[blknum].chunkcnt) && (blknum + 1 < blockcnt)) { diff --git a/src/SyncRideFile.cpp b/src/SyncRideFile.cpp index af47d6cfb..f5eef27d0 100644 --- a/src/SyncRideFile.cpp +++ b/src/SyncRideFile.cpp @@ -132,7 +132,7 @@ struct SyncFileReaderState km += intSecs * kph / 3600.0; rideFile->setRecIntSecs(intSecs); rideFile->appendPoint(*secs, cad, hr, km, kph, nm, watts, alt, lng, lat, headwind, grade, temp, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, interval); *secs = *secs + intSecs; diff --git a/src/TacxCafRideFile.cpp b/src/TacxCafRideFile.cpp index ecbfc7541..b3d41f7d1 100644 --- a/src/TacxCafRideFile.cpp +++ b/src/TacxCafRideFile.cpp @@ -185,7 +185,7 @@ struct RideFilePoint readSinglePoint(const QByteArray& record, const double& tim double speed = (relativeDistance - lastDistance) / recordingIntervalInSeconds; - struct RideFilePoint point(timeInSeconds, cadence, heartRate, relativeDistance / 1000.0, speed * 3.6, 0.0, power, 0.0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); + struct RideFilePoint point(timeInSeconds, cadence, heartRate, relativeDistance / 1000.0, speed * 3.6, 0.0, power, 0.0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0); return point; } @@ -209,7 +209,7 @@ bool readRideData(RideFile *rideFile, const QByteArray& block, const int nrOfRec nextDataPoint.watts, nextDataPoint.alt, nextDataPoint.lon, nextDataPoint.lat, nextDataPoint.headwind, 0.0, RideFile::NoTemp, 0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,nextDataPoint.interval); + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,nextDataPoint.interval); } return true; } diff --git a/src/TcxParser.cpp b/src/TcxParser.cpp index 79d64caa3..6eadd9057 100644 --- a/src/TcxParser.cpp +++ b/src/TcxParser.cpp @@ -75,6 +75,7 @@ TcxParser::startElement( const QString&, const QString&, const QString& qName, c power = 0.0; cadence = 0.0; + rcad = 0.0; speed = 0.0; headwind = 0.0; torque = 0; @@ -103,6 +104,7 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName) else if (qName == "Speed" || qName == "ns3:Speed") { speed = buffer.toDouble() * 3.6; } else if (qName == "Value") { hr = buffer.toDouble(); } else if (qName == "Cadence") { cadence = buffer.toDouble(); } + else if (qName == "RunCadence") { rcad = buffer.toDouble(); } else if (qName == "AltitudeMeters") { // on Suunto TCX files there are lots of 0 values between valid ones, skip these if (buffer.toDouble() != 0) { @@ -161,7 +163,9 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName) // first point rideFile->appendPoint(secs, cadence, hr, distance, speed, torque, power, alt, lon, lat, headwind, 0.0, RideFile::NoTemp, 0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,lap); + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,rcad,0.0, // no running dynamics in the schema ? + lap); } else { @@ -177,6 +181,7 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName) double deltaAlt = alt - prevPoint->alt; double deltaLon = lon - prevPoint->lon; double deltaLat = lat - prevPoint->lat; + double deltarcad = rcad - prevPoint->rcad; if (prevPoint->lat == 0 && prevPoint->lon == 0) badgps = true; // Smart Recording High Water Mark. @@ -185,7 +190,11 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName) // no smart recording, or delta exceeds HW treshold, just insert the data rideFile->appendPoint(secs, cadence, hr, distance, speed, torque, power, alt, lon, lat, headwind, 0.0, RideFile::NoTemp, 0.0, - 0.0,0.0,0.0,0.0,0.0,0.0,lap); + 0.0,0.0,0.0,0.0,0.0,0.0, + 0.0, // vertical oscillation + rcad, // run cadence + 0.0, // gct + lap); } else { @@ -216,6 +225,9 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName) 0.0, 0.0,0.0,0.0,0.0, 0.0,0.0, + 0.0, // vertical oscillation + prevPoint->rcad + (deltarcad * weight),// run cadence + 0.0, // gct lap); } prevPoint = rideFile->dataPoints().back(); diff --git a/src/TcxParser.h b/src/TcxParser.h index 30cc382d9..dd0121680 100644 --- a/src/TcxParser.h +++ b/src/TcxParser.h @@ -59,6 +59,7 @@ private: int lap; double power; double cadence; + double rcad; double hr; double speed; double torque; diff --git a/src/TxtRideFile.cpp b/src/TxtRideFile.cpp index ac26a3428..716af7ea6 100644 --- a/src/TxtRideFile.cpp +++ b/src/TxtRideFile.cpp @@ -204,7 +204,7 @@ RideFile *TxtFileReader::openRideFile(QFile &file, QStringList &errors, QListappendPoint(secs, cad, hr, km, kph, 0.0, watts, 0.0, 0.0, 0.0, headwind, 0.0, RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0, 0); + rideFile->appendPoint(secs, cad, hr, km, kph, 0.0, watts, 0.0, 0.0, 0.0, headwind, 0.0, RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0); } } @@ -386,7 +386,7 @@ RideFile *TxtFileReader::openRideFile(QFile &file, QStringList &errors, QList= 0) torq = tokens.at(torqIndex).toDouble(); if (wattsIndex >= 0) watts = tokens.at(wattsIndex).toDouble(); - rideFile->appendPoint(secs, rpm, bpm, km, kph, torq, watts, 0.0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0, 0); + rideFile->appendPoint(secs, rpm, bpm, km, kph, torq, watts, 0.0, 0.0, 0.0, 0.0, 0.0, RideFile::NoTemp, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0); } } diff --git a/src/WkoRideFile.cpp b/src/WkoRideFile.cpp index 18098c9fd..b79180cba 100644 --- a/src/WkoRideFile.cpp +++ b/src/WkoRideFile.cpp @@ -490,6 +490,7 @@ WkoParser::parseRawData(WKO_UCHAR *fb) kph, nm, watts, alt, lon, lat, wind, slope, temp, 0.0, 0.0,0.0,0.0,0.0, // vector pedal torque eff and smoothness not supported in WKO (?) 0.0,0.0, + 0.0,0.0,0.0, // running dynamics 0); }