23#include <QNetworkDatagram>
24#include <QStandardPaths>
27#include "GlobalObject.h"
28#include "positioning/PositionInfoSource_Abstract.h"
29#include "traffic/ConnectionInfo.h"
30#include "traffic/TrafficDataSource_Abstract.h"
174 [[nodiscard]] QList<Traffic::TrafficDataSource_Abstract*>
dataSources()
const;
194 return m_receivingHeartbeat.value();
203 return &m_receivingHeartbeat;
212 return m_trafficObjects;
221 return m_trafficObjectWithoutPosition;
230 return m_trafficReceiverRuntimeError;
239 return m_trafficReceiverSelfTestError;
396 void clearDataSources();
400 void deferredInitialization();
404 void foreFlightBroadcast();
407 void loadConnectionInfos();
410 void onCurrentSourceChanged();
422 void saveConnectionInfos();
432 QString computeStatusString();
436 QNetworkDatagram foreFlightBroadcastDatagram {R
"({"App":"Enroute Flight Navigation","GDL90":{"port":4000}})", QHostAddress::Broadcast, 63093};
437 QUdpSocket foreFlightBroadcastSocket;
438 QTimer foreFlightBroadcastTimer;
441 QList<Traffic::TrafficFactor_WithPosition *> m_trafficObjects;
442 QPointer<Traffic::TrafficFactor_DistanceOnly> m_trafficObjectWithoutPosition;
445 QProperty<QList<QPointer<Traffic::TrafficDataSource_Abstract>>> m_dataSources;
447 QProperty<QPointer<Traffic::TrafficDataSource_Abstract>> m_currentSource;
448 QPropertyNotifier m_currentSourceNotifier;
449 QPointer<Traffic::TrafficDataSource_Abstract> computeCurrentSource();
451 QProperty<bool> m_currentSourceIsInternetService;
455 QTimer m_WarningTimer;
458 QString computeTrafficReceiverRuntimeError();
461 QString computeTrafficReceiverSelfTestError();
463 QProperty<Units::Distance> m_pressureAltitude;
467 QTimer reconnectionTimer;
470 bool computeReceivingHeartbeat();
473 QString stdFileName{QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + u
"/connectionInfos.data"_s};
static Q_INVOKABLE Traffic::TrafficDataProvider * trafficDataProvider()
Pointer to appplication-wide static TrafficDataProvider instance.
Abstract base class for all classes that provide geographic position information.
Connection to a traffic data receiver.
QString trafficReceiverSelfTestError
String describing the traffic data receiver errors found in self-test.
QString trafficReceiverRuntimeError
String describing the current traffic data receiver errors.
bool currentSourceIsInternetService
Internet service flag.
void passwordStorageRequest(const QString &SSID, const QString &password)
Password storage request.
void passwordRequest(const QString &SSID)
Password request.
QString trafficReceiverSelfTestError() const
Getter function for the property with the same name.
Traffic::TrafficFactor_DistanceOnly * trafficObjectWithoutPosition() const
Getter method for property with the same name.
QList< Traffic::TrafficDataSource_Abstract * > dataSources
Traffic data sources.
QBindable< bool > bindableReceivingHeartbeat() const
Getter method for property with the same name.
Q_INVOKABLE QString addDataSource_TCP(const QString &host, quint16 port)
Add an additional data source.
Traffic::Warning warning
Current traffic warning.
QList< Traffic::TrafficDataSource_Abstract * > dataSources() const
Getter method for property with the same name.
Q_INVOKABLE QString addDataSource_UDP(quint16 port)
Add an additional data source.
QList< Traffic::TrafficFactor_WithPosition * > trafficObjects() const
Getter method for property with the same name.
QString trafficReceiverRuntimeError() const
Getter function for the property with the same name.
bool receivingHeartbeat() const
Getter method for property with the same name.
bool receivingHeartbeat
Heartbeat indicator.
Units::Distance pressureAltitude
Pressure altitude.
void receivingHeartbeatChanged()
Notifier signal.
void connectToTrafficReceiver()
Start attempt to connect to traffic receiver.
void trafficReceiverRuntimeErrorChanged()
Notifier signal.
Q_INVOKABLE QString addDataSource_SerialPort(const QString &portName)
Add an additional data source.
void trafficReceiverSelfTestErrorChanged()
Notifier signal.
void dataSourcesChanged()
Notifier signal.
void setPassword(const QString &SSID, const QString &password)
Send password to the traffic data sources.
Q_INVOKABLE void removeDataSource(Traffic::TrafficDataSource_Abstract *source)
Remove data sources.
void disconnectFromTrafficReceiver()
Disconnect from traffic receiver.
Traffic::Warning warning() const
Getter method for property with the same name.
void addDataSource(Traffic::TrafficDataSource_Abstract *source)
Add an additional data source.
Q_INVOKABLE QString addDataSource_OGN()
Add an additional data source.
TrafficDataProvider(QObject *parent=nullptr)
Default constructor.
QBindable< Units::Distance > bindablePressureAltitude() const
Getter method for property with the same name.
QList< Traffic::TrafficFactor_WithPosition * > trafficObjects
Traffic objects whose position is known.
QBindable< bool > bindableCurrentSourceIsInternetService() const
Getter method for property with the same name.
Units::Distance pressureAltitude() const
Getter method for property with the same name.
Traffic::TrafficFactor_DistanceOnly * trafficObjectWithoutPosition
Most relevant traffic object whose position is not known.
void warningChanged(const Traffic::Warning &)
Notifier signal.
Q_INVOKABLE QString addDataSource(const Traffic::ConnectionInfo &connectionInfo)
Add an additional data source.
Base class for all traffic receiver data sources.
Traffic factor where only distance is known.
Traffic factor whose precise position is known.
Convenience class for distance computations.
Conversion between units used in aviation.