1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Fixed broken parsing of TCX files with heart rate data

This commit is contained in:
Martin Tůma 2017-09-14 20:18:34 +02:00
parent 89947851fd
commit b457fc430c
2 changed files with 12 additions and 1 deletions

View File

@ -56,6 +56,16 @@ Coordinates TCXParser::position()
return pos;
}
void TCXParser::heartRateBpm(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Value")
trackpoint.setHeartRate(number());
else
_reader.skipCurrentElement();
}
}
void TCXParser::extensions(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
@ -78,7 +88,7 @@ void TCXParser::trackpointData(Trackpoint &trackpoint)
else if (_reader.name() == "Time")
trackpoint.setTimestamp(time());
else if (_reader.name() == "HeartRateBpm")
trackpoint.setHeartRate(number());
heartRateBpm(trackpoint);
else if (_reader.name() == "Cadence")
trackpoint.setCadence(number());
else if (_reader.name() == "Extensions")

View File

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