mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Treat TCX courses as tracks not as routes
This commit is contained in:
parent
09c097cc68
commit
974290ce8b
@ -65,20 +65,6 @@ void TCXParser::trackpointData(Trackpoint &trackpoint)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCXParser::routepointData(Waypoint &waypoint)
|
|
||||||
{
|
|
||||||
while (_reader.readNextStartElement()) {
|
|
||||||
if (_reader.name() == "Position")
|
|
||||||
waypoint.setCoordinates(position());
|
|
||||||
else if (_reader.name() == "AltitudeMeters")
|
|
||||||
waypoint.setElevation(number());
|
|
||||||
else if (_reader.name() == "Time")
|
|
||||||
waypoint.setTimestamp(time());
|
|
||||||
else
|
|
||||||
_reader.skipCurrentElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TCXParser::waypointData(Waypoint &waypoint)
|
void TCXParser::waypointData(Waypoint &waypoint)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
@ -108,17 +94,6 @@ void TCXParser::trackpoints(QVector<Trackpoint> &track)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCXParser::routepoints(QVector<Waypoint> &route)
|
|
||||||
{
|
|
||||||
while (_reader.readNextStartElement()) {
|
|
||||||
if (_reader.name() == "Trackpoint") {
|
|
||||||
route.append(Waypoint());
|
|
||||||
routepointData(route.back());
|
|
||||||
} else
|
|
||||||
_reader.skipCurrentElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TCXParser::lap()
|
void TCXParser::lap()
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
@ -134,8 +109,8 @@ void TCXParser::course()
|
|||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Track") {
|
if (_reader.name() == "Track") {
|
||||||
_routes.append(QVector<Waypoint>());
|
_tracks.append(QVector<Trackpoint>());
|
||||||
routepoints(_routes.back());
|
trackpoints(_tracks.back());
|
||||||
} else if (_reader.name() == "CoursePoint") {
|
} else if (_reader.name() == "CoursePoint") {
|
||||||
_waypoints.append(Waypoint());
|
_waypoints.append(Waypoint());
|
||||||
waypointData(_waypoints.back());
|
waypointData(_waypoints.back());
|
||||||
|
@ -26,9 +26,7 @@ private:
|
|||||||
void activity();
|
void activity();
|
||||||
void lap();
|
void lap();
|
||||||
void trackpoints(QVector<Trackpoint> &track);
|
void trackpoints(QVector<Trackpoint> &track);
|
||||||
void routepoints(QVector<Waypoint> &route);
|
|
||||||
void trackpointData(Trackpoint &trackpoint);
|
void trackpointData(Trackpoint &trackpoint);
|
||||||
void routepointData(Waypoint &waypoint);
|
|
||||||
void waypointData(Waypoint &waypoint);
|
void waypointData(Waypoint &waypoint);
|
||||||
Coordinates position();
|
Coordinates position();
|
||||||
qreal number();
|
qreal number();
|
||||||
|
Loading…
Reference in New Issue
Block a user