28#include "traffic/TrafficDataSource_AbstractSocket.h"
31using namespace Qt::Literals::StringLiterals;
87 [[nodiscard]] QString
dataFormat()
const override {
return u
"APRS-IS"_s; }
93 [[nodiscard]] QString
host()
const
105 [[nodiscard]] QString
icon()
const override {
return u
"/icons/material/ic_wifi.svg"_s; }
116 return tr(
"Open Glider Network-Connection");
123 [[nodiscard]] quint16
port()
const
152 void sendPosition(
const QGeoCoordinate& coordinate,
double course,
double speed,
double altitude);
164 QTextStream m_textStream;
172 bool m_connectionDesired =
false;
174 QString m_lineBuffer;
175 Ogn::OgnMessage m_ognMessage;
187 QGeoCoordinate m_currentPosition;
188 bool m_usingGps =
true;
191 std::u16string m_ownAircraftName;
192 std::vector<std::string> m_ownTransponderCodes;
195 QGeoCoordinate m_lastFilterPosition;
196 qint64 m_lastFilterUpdateTime = 0;
197 static constexpr qint64 MIN_FILTER_UPDATE_INTERVAL_MS = 1000;
198 static constexpr double MIN_FILTER_UPDATE_DISTANCE_KM = 5.0;
201 void setFilter(
const QGeoCoordinate& coordinate);
204 void updateCurrentCoordinate();
207 void updateOwnshipFilterData();
210 void periodicUpdate();
213 void processOgnMessage(
const QString& data);
216 void sendKeepAlive();
219 void verifyConnection();
TrafficDataSource_AbstractSocket(bool isCanonical, QObject *parent)
Default constructor.
void connectToTrafficReceiver() override
Start attempt to connect to traffic receiver.
QString dataFormat() const override
Getter function for the property with the same name.
void sendPosition(const QGeoCoordinate &coordinate, double course, double speed, double altitude)
Send position report to APRS-IS server.
void disconnectFromTrafficReceiver() override
Disconnect from traffic receiver.
quint16 port() const
Getter function for the property with the same name.
quint16 port
TCP port of the OGN/APRS-IS server (e.g. 14580).
QString host
Hostname of the OGN/APRS-IS server (e.g. aprs.glidernet.org).
TrafficDataSource_Ogn(bool isCanonical, QString hostName, quint16 port, QObject *parent=nullptr)
Default constructor.
QString host() const
Getter function for the property with the same name.
QString icon() const override
Getter function for the property with the same name.
auto sourceName() const -> QString override
Getter function for the property with the same name.
Convenience class for distance computations.
static Q_INVOKABLE constexpr Units::Distance fromNM(double distanceInNM)
Constructs a distance.