Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed fixes #86

Merged
merged 2 commits into from
May 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/polar/v2/trainingsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1819,13 +1819,13 @@ QStringList TrainingSession::toHRM(const bool rrDataOnly) const
? map.value(RRSAMPLES).toMap().value(QLatin1String("value")).toList()
: flattenHrvSamplesForHrm(samples);

const bool haveAltitude = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("speed"))));
const bool haveAltitude = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("altitude"))));
const bool haveCadence = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("cadence"))));
const bool havePowerLeft = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("left-pedal-power"))));
const bool havePowerRight = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("right-pedal-power"))));
const bool havePower = (havePowerLeft || havePowerRight);
const bool havePowerBalance = havePower;
const bool haveSpeed = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("altitude"))));
const bool haveSpeed = ((!rrDataOnly) && (haveAnySamples(samples, QLatin1String("speed"))));

QString hrmData;
QTextStream stream(&hrmData);
Expand Down Expand Up @@ -2532,7 +2532,7 @@ QDomDocument TrainingSession::toTCX(const QString &buildTime) const
trackPoint.appendChild(doc.createElement(QLatin1String("Extensions")))
.appendChild(tpx);

if ((index < cadence.length()) && (cadence.at(index).toInt() >= 0) &&
if ((index < speed.length()) && (speed.at(index).toInt() >= 0) &&
(!sensorOffline(samples.value(QLatin1String("speed-offline")).toList(), index))) {
tpx.appendChild(doc.createElement(QLatin1String("Speed")))
.appendChild(doc.createTextNode(QString::fromLatin1("%1")
Expand Down