mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Fixed broken parsing of TCX files with heart rate data
This commit is contained in:
parent
89947851fd
commit
b457fc430c
@ -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")
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user