QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NTRIPSourceTable.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QAbstractListModel>
4#include <QtCore/QList>
5#include <QtCore/QLoggingCategory>
6#include <QtCore/QString>
7#include <QtPositioning/QGeoCoordinate>
8
9Q_DECLARE_LOGGING_CATEGORY(NTRIPSourceTableLog)
10
11
14{
15 QString mountpoint;
16 QString identifier;
17 QString format;
19 int carrier = 0;
20 QString navSystem;
21 QString network;
22 QString country;
23 double latitude = 0.0;
24 double longitude = 0.0;
25 bool nmea = false;
26 bool solution = false;
27 QString generator;
28 QString compression;
30 bool fee = false;
31 int bitrate = 0;
32 double distanceKm = -1.0;
33
36 static bool fromSourceTableLine(const QString& line, NTRIPMountpoint& out);
37
40 void updateDistance(const QGeoCoordinate& from);
41};
42
46class NTRIPSourceTableModel : public QAbstractListModel
47{
48 Q_OBJECT
49 Q_PROPERTY(int count READ count NOTIFY countChanged)
50
51public:
73
74 explicit NTRIPSourceTableModel(QObject* parent = nullptr);
75
76 int count() const { return static_cast<int>(_mountpoints.size()); }
77
78 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
79 QVariant data(const QModelIndex& index, int role) const override;
80 QHash<int, QByteArray> roleNames() const override;
81
82 void parseSourceTable(const QString& raw);
83 void updateDistances(const QGeoCoordinate& from);
84 void sortByDistance();
85 void clear();
86
87signals:
89
90private:
91 QList<NTRIPMountpoint> _mountpoints;
92};
QHash< int, QByteArray > roleNames() const override
QVariant data(const QModelIndex &index, int role) const override
void updateDistances(const QGeoCoordinate &from)
void parseSourceTable(const QString &raw)
int rowCount(const QModelIndex &parent=QModelIndex()) const override