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"
180 return m_receivingHeartbeat.value();
189 return &m_receivingHeartbeat;
198 return m_trafficObjects;
207 return m_trafficObjectWithoutPosition;
216 return m_trafficReceiverRuntimeError;
225 return m_trafficReceiverSelfTestError;
374 void clearDataSources();
378 void deferredInitialization()
const;
382 void foreFlightBroadcast();
385 void loadConnectionInfos();
388 void onSourceHeartbeatChanged();
397 void onTrafficReceiverSelfTestError();
400 void onTrafficReceiverRuntimeError();
406 void saveConnectionInfos();
416 QString computeStatusString();
420 QNetworkDatagram foreFlightBroadcastDatagram {R
"({"App":"Enroute Flight Navigation","GDL90":{"port":4000}})", QHostAddress::Broadcast, 63093};
421 QUdpSocket foreFlightBroadcastSocket;
422 QTimer foreFlightBroadcastTimer;
425 QList<Traffic::TrafficFactor_WithPosition *> m_trafficObjects;
426 QPointer<Traffic::TrafficFactor_DistanceOnly> m_trafficObjectWithoutPosition;
429 QProperty<QList<QPointer<Traffic::TrafficDataSource_Abstract>>> m_dataSources;
430 QProperty<QPointer<Traffic::TrafficDataSource_Abstract>> m_currentSource;
434 QTimer m_WarningTimer;
435 QString m_trafficReceiverRuntimeError;
436 QString m_trafficReceiverSelfTestError;
438 QProperty<Units::Distance> m_pressureAltitude;
442 QTimer reconnectionTimer;
447 QString stdFileName{QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) +
"/connectionInfos.data"};
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.
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.
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.
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.
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.