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

Added support for TCX multi-sport activities

This commit is contained in:
Martin Tůma 2017-10-14 22:57:03 +02:00
parent b54aeff369
commit e76439bb6e
2 changed files with 26 additions and 1 deletions

View File

@ -183,7 +183,7 @@ void TCXParser::courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
} }
} }
void TCXParser::activities(QList<TrackData> &tracks) void TCXParser::sport(QList<TrackData> &tracks)
{ {
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {
if (_reader.name() == "Activity") { if (_reader.name() == "Activity") {
@ -194,6 +194,29 @@ void TCXParser::activities(QList<TrackData> &tracks)
} }
} }
void TCXParser::multiSportSession(QList<TrackData> &tracks)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "FirstSport" || _reader.name() == "NextSport")
sport(tracks);
else
_reader.skipCurrentElement();
}
}
void TCXParser::activities(QList<TrackData> &tracks)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Activity") {
tracks.append(TrackData());
activity(tracks.back());
} else if (_reader.name() == "MultiSportSession")
multiSportSession(tracks);
else
_reader.skipCurrentElement();
}
}
void TCXParser::tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints) void TCXParser::tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{ {
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {

View File

@ -19,6 +19,8 @@ private:
void tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints); void tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints); void courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
void activities(QList<TrackData> &tracks); void activities(QList<TrackData> &tracks);
void multiSportSession(QList<TrackData> &tracks);
void sport(QList<TrackData> &tracks);
void course(QList<Waypoint> &waypoints, TrackData &track); void course(QList<Waypoint> &waypoints, TrackData &track);
void activity(TrackData &track); void activity(TrackData &track);
void lap(TrackData &track); void lap(TrackData &track);