1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Properly parse TCX trackpoint extensions

This commit is contained in:
Martin Tůma 2020-09-14 16:33:44 +02:00
parent 03e7d092c4
commit 0e026d6a96
2 changed files with 14 additions and 1 deletions

View File

@ -66,13 +66,25 @@ void TCXParser::heartRateBpm(Trackpoint &trackpoint)
}
}
void TCXParser::extensions(Trackpoint &trackpoint)
void TCXParser::TPX(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("RunCadence"))
trackpoint.setCadence(number());
else if (_reader.name() == QLatin1String("Watts"))
trackpoint.setPower(number());
else if (_reader.name() == QLatin1String("Speed"))
trackpoint.setSpeed(number());
else
_reader.skipCurrentElement();
}
}
void TCXParser::extensions(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("TPX"))
TPX(trackpoint);
else
_reader.skipCurrentElement();
}

View File

@ -26,6 +26,7 @@ private:
void trackpointData(Trackpoint &trackpoint);
void waypointData(Waypoint &waypoint);
void extensions(Trackpoint &trackpoint);
void TPX(Trackpoint &trackpoint);
void heartRateBpm(Trackpoint &trackpoint);
Coordinates position();
qreal number();