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;
168 QString m_lineBuffer;
169 Ogn::OgnMessage m_ognMessage;
175 Traffic::AircraftType m_aircraftType = {Traffic::AircraftType::Aircraft};
181 QGeoCoordinate m_currentPosition;
182 bool m_usingGps =
true;
185 std::u16string m_ownAircraftName;
186 std::vector<std::string> m_ownTransponderCodes;
189 QGeoCoordinate m_lastFilterPosition;
190 qint64 m_lastFilterUpdateTime = 0;
191 static constexpr qint64 MIN_FILTER_UPDATE_INTERVAL_MS = 1000;
192 static constexpr double MIN_FILTER_UPDATE_DISTANCE_KM = 5.0;
195 void setFilter(
const QGeoCoordinate& coordinate);
198 void updateCurrentCoordinate();
201 void updateOwnshipFilterData();
204 void periodicUpdate();
207 void processOgnMessage(
const QString& data);
210 void sendKeepAlive();
213 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.
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.