From b6f715bbde1f3919969956bfe7af8a3dcc8478fc Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 3 Jul 2015 14:57:09 +0100 Subject: [PATCH] Support Moxy Firmware v1.0 .. fit file manu:76 identified as Moxy .. support 7 field CSV, ignore session number NOTE: support for UTC dates is not present since we have no way of checking what TZ the ride was recorded in ! --- src/FitRideFile.cpp | 6 ++++++ src/MoxyDevice.cpp | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/FitRideFile.cpp b/src/FitRideFile.cpp index 1d5e65276..2756ebcec 100644 --- a/src/FitRideFile.cpp +++ b/src/FitRideFile.cpp @@ -298,9 +298,15 @@ struct FitFileReaderState // does not set product at this point rideFile->setDeviceType("Sigmasport ROX"); + } else if (manu == 76) { + + // Moxy + rideFile->setDeviceType("Moxy Monitor"); + } else if (manu == 260) { // Zwift! rideFile->setDeviceType("Zwift"); + } else { rideFile->setDeviceType(QString("Unknown FIT Device %1:%2").arg(manu).arg(prod)); diff --git a/src/MoxyDevice.cpp b/src/MoxyDevice.cpp index 1e5116892..81d18305d 100644 --- a/src/MoxyDevice.cpp +++ b/src/MoxyDevice.cpp @@ -46,7 +46,14 @@ static QDateTime dateTimeForRow(QString line) // first row has data and time ? QStringList tokens = line.split(","); - if (tokens.count() != 6) return QDateTime(); + if (tokens.count() != 6 && tokens.count() !=7) return QDateTime(); + + // is the date in UTC Format ? + // XXX we have no way of converting from UTC + // XXX at present since we don't know what TZ + // XXX the ride was recorded in ... + bool UTCdate = tokens.count() == 7; + Q_UNUSED(UTCdate); // parse date and time QStringList mmdd = tokens[0].split("-"); @@ -485,6 +492,7 @@ MoxyDevice::readUntilPrompt(CommPortPtr dev, char *buf, int len, QString &err) // we got our prompt if (*(buf+sofar-1) == '>') break; } + return sofar; }