From d758fceb3232fc57d466380907da50f55eed0426 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Mon, 4 Aug 2014 18:32:07 +1000 Subject: [PATCH] Use split-time in HRM [IntTimes] section (#20) This is an example where the HRM2 v1.4 documentation is ambiguous. However, AR67 (from the Polar forums) tells me that these are meant to be "split times", which appears to mean that they time-stamp the point at which the lap was "taken". The protobuf laps data includes a "split-time" field that appears to match with what AR67 reports, so let's go with that for now :) See http://forum.polar.fi/showthread.php?p=85839#post85839 for details. --- src/polar/v2/trainingsession.cpp | 2 +- test/polar/v2/testdata/training-sessions-19401412.hrm | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/polar/v2/trainingsession.cpp b/src/polar/v2/trainingsession.cpp index 41c0ddb2..f3705fc7 100644 --- a/src/polar/v2/trainingsession.cpp +++ b/src/polar/v2/trainingsession.cpp @@ -1245,7 +1245,7 @@ QStringList TrainingSession::toHRM() const QVariantMap stats = firstMap(lap.toMap().value(QLatin1String("stats"))); const QVariantMap hrStats = firstMap(stats.value(QLatin1String("heartrate"))); // Row 1 - stream << getDurationString(firstMap(header.value(QLatin1String("duration")))); + stream << getDurationString(firstMap(header.value(QLatin1String("split-time")))); stream << '\t' << first(hrStats.value(QLatin1String("average"))).toUInt(); stream << '\t' << first(hrStats.value(QLatin1String("minimum"))).toUInt(); stream << '\t' << first(hrStats.value(QLatin1String("average"))).toUInt(); diff --git a/test/polar/v2/testdata/training-sessions-19401412.hrm b/test/polar/v2/testdata/training-sessions-19401412.hrm index cf9089a1..5f262256 100644 --- a/test/polar/v2/testdata/training-sessions-19401412.hrm +++ b/test/polar/v2/testdata/training-sessions-19401412.hrm @@ -43,22 +43,22 @@ Exported by test 1.2.3.4 0 0 0 28 29 0 2942 0 0 0 0 0 0 0 0 0 0 -00:24:52.250 165 143 165 178 +00:54:56.125 165 143 165 178 0 0 0 0 0 0 0 0 0 25 20 0 2034 0 0 0 0 0 0 0 0 0 0 -00:03:47.500 144 135 144 151 +00:58:43.625 144 135 144 151 0 0 0 0 0 0 0 0 0 0 5 0 530 0 0 0 0 0 0 0 0 0 0 -00:26:01.625 172 150 172 181 +01:24:45.250 172 150 172 181 0 0 0 0 0 0 0 0 0 24 26 0 2595 0 0 0 0 0 0 0 0 0 0 -00:02:33.500 158 150 158 169 +01:27:18.750 158 150 158 169 0 0 0 0 0 0 0 0 0 0 4 0 384 0 0 0 0