1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00
GPXSee/src/data/smlparser.h

41 lines
952 B
C
Raw Normal View History

#ifndef SMLPARSER_H
#define SMLPARSER_H
#include <QXmlStreamReader>
2020-01-15 21:56:04 +01:00
#include <QMap>
#include <QDebug>
#include "parser.h"
class SMLParser : public Parser
{
public:
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Area> &polygons, QVector<Waypoint> &waypoints);
QString errorString() const {return _reader.errorString();}
int errorLine() const {return _reader.lineNumber();}
private:
2020-01-15 21:56:04 +01:00
struct Sensors
{
Sensors()
: cadence(NAN), temperature(NAN), hr(NAN), power(NAN), speed(NAN) {}
qreal cadence, temperature, hr, power, speed;
};
2023-12-26 20:05:38 +01:00
typedef QMap<QDateTime, Sensors> SensorsMap;
void sml(QList<TrackData> &tracks);
void deviceLog(TrackData &track);
void samples(SegmentData &segment);
2023-12-26 20:05:38 +01:00
void sample(SegmentData &segment, SensorsMap &map);
2020-01-15 21:56:04 +01:00
#ifndef QT_NO_DEBUG
friend QDebug operator<<(QDebug dbg, const Sensors &sensors);
#endif // QT_NO_DEBUG
QXmlStreamReader _reader;
};
#endif // SMLPARSER_H