1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Added support for Garmin "TrackPointExtension" extension (heart rate)

This commit is contained in:
Martin Tůma 2016-03-21 23:13:46 +01:00
parent 93670d3026
commit a0b64b4227
2 changed files with 13 additions and 0 deletions

View File

@ -39,12 +39,24 @@ void Parser::handleWayPointAttributes(const QXmlStreamAttributes &attr)
attr.value("lat").toLatin1().toDouble())); attr.value("lat").toLatin1().toDouble()));
} }
void Parser::tpExtension()
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "hr")
handleExtensionData(_reader.name(), _reader.readElementText());
else
_reader.skipCurrentElement();
}
}
void Parser::extensions() void Parser::extensions()
{ {
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {
if (_reader.name() == "speed" || _reader.name() == "hr" if (_reader.name() == "speed" || _reader.name() == "hr"
|| _reader.name() == "heartrate") || _reader.name() == "heartrate")
handleExtensionData(_reader.name(), _reader.readElementText()); handleExtensionData(_reader.name(), _reader.readElementText());
else if (_reader.name() == "TrackPointExtension")
tpExtension();
else else
_reader.skipCurrentElement(); _reader.skipCurrentElement();
} }

View File

@ -22,6 +22,7 @@ private:
void gpx(); void gpx();
void track(); void track();
void trackPoints(); void trackPoints();
void tpExtension();
void extensions(); void extensions();
void trackPointData(); void trackPointData();
void wayPointData(); void wayPointData();