mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-17 16:20:48 +01:00
Remove the special timestamps check from the FIT parser
(Use the common logic in the Track class instead)
This commit is contained in:
parent
f85977d881
commit
731b309ac9
@ -51,13 +51,13 @@ class FITParser::CTX {
|
|||||||
public:
|
public:
|
||||||
CTX(QFile *file, QVector<Waypoint> &waypoints)
|
CTX(QFile *file, QVector<Waypoint> &waypoints)
|
||||||
: file(file), waypoints(waypoints), len(0), endian(0), timestamp(0),
|
: file(file), waypoints(waypoints), len(0), endian(0), timestamp(0),
|
||||||
lastWrite(0), ratio(NAN) {}
|
ratio(NAN) {}
|
||||||
|
|
||||||
QFile *file;
|
QFile *file;
|
||||||
QVector<Waypoint> &waypoints;
|
QVector<Waypoint> &waypoints;
|
||||||
quint32 len;
|
quint32 len;
|
||||||
quint8 endian;
|
quint8 endian;
|
||||||
quint32 timestamp, lastWrite;
|
quint32 timestamp;
|
||||||
MessageDefinition defs[16];
|
MessageDefinition defs[16];
|
||||||
qreal ratio;
|
qreal ratio;
|
||||||
Trackpoint trackpoint;
|
Trackpoint trackpoint;
|
||||||
@ -361,14 +361,12 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
|||||||
ctx.ratio = ((qreal)front / (qreal)rear);
|
ctx.ratio = ((qreal)front / (qreal)rear);
|
||||||
}
|
}
|
||||||
} else if (def->globalId == RECORD_MESSAGE) {
|
} else if (def->globalId == RECORD_MESSAGE) {
|
||||||
if (ctx.timestamp > ctx.lastWrite
|
if (ctx.trackpoint.coordinates().isValid()) {
|
||||||
&& ctx.trackpoint.coordinates().isValid()) {
|
|
||||||
ctx.trackpoint.setTimestamp(QDateTime::fromTime_t(ctx.timestamp
|
ctx.trackpoint.setTimestamp(QDateTime::fromTime_t(ctx.timestamp
|
||||||
+ 631065600));
|
+ 631065600));
|
||||||
ctx.trackpoint.setRatio(ctx.ratio);
|
ctx.trackpoint.setRatio(ctx.ratio);
|
||||||
ctx.segment.append(ctx.trackpoint);
|
ctx.segment.append(ctx.trackpoint);
|
||||||
ctx.trackpoint = Trackpoint();
|
ctx.trackpoint = Trackpoint();
|
||||||
ctx.lastWrite = ctx.timestamp;
|
|
||||||
}
|
}
|
||||||
} else if (def->globalId == COURSE_POINT)
|
} else if (def->globalId == COURSE_POINT)
|
||||||
if (waypoint.coordinates().isValid())
|
if (waypoint.coordinates().isValid())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user