Skip to content

Commit

Permalink
Avoid to mischaracterize OW swims as Pool swims
Browse files Browse the repository at this point in the history
When GPS data was available before the first distance tick,
includes test file contributed at the forum.
Fixes #4251
Also reverts the TCX part of 1f094f5 since it is incomplete,
and not such a good idea anyway.
  • Loading branch information
amtriathlon committed Jul 25, 2022
1 parent 5ef4146 commit 774704c
Show file tree
Hide file tree
Showing 2 changed files with 37,240 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/FileIO/TcxParser.cpp
Expand Up @@ -209,6 +209,7 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName)
// If sport was Other and we have distance but no GPS data
// we assume it is a pool swimming activity and first
// distance is pool length
if (swim == MayBeSwim && !badgps) swim = NotSwim; // not a pool swim if we have GPS data
if (swim == MayBeSwim && badgps && distance > 0) {
swim = Swim;
rideFile->setTag("Sport", "Swim");
Expand Down Expand Up @@ -373,8 +374,8 @@ TcxParser::endElement( const QString&, const QString&, const QString& qName)
if (swimXdata) swimXdata->datapoints.append(p);
lastLength = secs + round(lapSecs);
}
// expand even if Smart Recording is not enabled
if (swim == Swim && distance == 0) {
// expand only if Smart Recording is enabled
if (swim == Swim && distance == 0 && isGarminSmartRecording.toInt()) {
// fill in the pause, partially if too long
for(int i = 1; i <= round(lapSecs) && i <= 300*GarminHWM.toInt(); i++)
rideFile->appendPoint(secs + i,
Expand Down

0 comments on commit 774704c

Please sign in to comment.