23#include <QNetworkDatagram>
24#include <QStandardPaths>
27#include "GlobalObject.h"
28#include "traffic/ConnectionInfo.h"
29#include "traffic/TrafficDataSource_Abstract.h"
210 [[nodiscard]] QList<Traffic::TrafficDataSource_Abstract*>
dataSources()
const;
218 return m_positionInfo.value();
245 return m_receivingHeartbeat.value();
260 return m_statusString.value();
275 return m_trafficObjects;
284 return m_trafficObjectWithoutPosition;
293 return m_trafficReceiverRuntimeError.value();
302 return m_trafficReceiverSelfTestError.value();
366 ConnectionInfo::BaudRate baudRate,
367 ConnectionInfo::StopBits stopBits,
368 ConnectionInfo::FlowControl flowControl);
485 void deferredInitialization();
489 void foreFlightBroadcast();
492 void loadConnectionInfos();
495 void onCurrentSourceChanged();
507 void saveConnectionInfos();
518 QProperty<QString> m_statusString;
519 QString computeStatusString();
523 QNetworkDatagram foreFlightBroadcastDatagram {R
"({"App":"Enroute Flight Navigation","GDL90":{"port":4000}})", QHostAddress::Broadcast, 63093};
524 QUdpSocket foreFlightBroadcastSocket;
525 QTimer foreFlightBroadcastTimer;
528 QList<Traffic::TrafficFactor_WithPosition *> m_trafficObjects;
529 QPointer<Traffic::TrafficFactor_DistanceOnly> m_trafficObjectWithoutPosition;
532 QProperty<QList<QPointer<Traffic::TrafficDataSource_Abstract>>> m_dataSources;
534 QProperty<QPointer<Traffic::TrafficDataSource_Abstract>> m_currentSource;
535 QPropertyNotifier m_currentSourceNotifier;
536 QPointer<Traffic::TrafficDataSource_Abstract> computeCurrentSource();
538 QProperty<bool> m_currentSourceIsInternetService;
542 QTimer m_WarningTimer;
545 QList<Traffic::ConnectionInfo> computeConnectionInfos();
548 QString computeTrafficReceiverRuntimeError();
551 QString computeTrafficReceiverSelfTestError();
553 QProperty<Positioning::PositionInfo> m_positionInfo;
556 QProperty<Units::Distance> m_pressureAltitude;
560 QTimer reconnectionTimer;
563 bool computeReceivingHeartbeat();
566 QString stdFileName{QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + u
"/connectionInfos.data"_s};
static Q_INVOKABLE Traffic::TrafficDataProvider * trafficDataProvider()
Pointer to appplication-wide static TrafficDataProvider instance.
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.
QList< Traffic::ConnectionInfo > connectionInfos
Connection Infos.
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.
QBindable< bool > bindableCurrentSourceIsInternetService()
Getter method for property with the same name.
QList< Traffic::TrafficDataSource_Abstract * > dataSources
Traffic data sources.
Q_INVOKABLE QString addDataSource_TCP(const QString &host, quint16 port)
Add an additional data source.
Positioning::PositionInfo positionInfo
Position information.
Traffic::Warning warning
Current traffic warning.
QBindable< QString > bindableStatusString()
Getter method for property with the same name.
void connectionInfosChanged()
Notifier signal.
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.
Positioning::PositionInfo positionInfo() const
Getter method for property with the same name.
QBindable< Positioning::PositionInfo > bindablePositionInfo()
Getter method for property with the same name.
bool receivingHeartbeat
Heartbeat indicator.
QString statusString
Source status.
Units::Distance pressureAltitude
Pressure altitude.
QBindable< Units::Distance > bindablePressureAltitude()
Getter method for property with the same name.
void receivingHeartbeatChanged()
Notifier signal.
void connectToTrafficReceiver()
Start attempt to connect to traffic receiver.
void trafficReceiverRuntimeErrorChanged()
Notifier signal.
Q_INVOKABLE QString addDataSource_SerialPort(const QString &portNameOrDescription, ConnectionInfo::BaudRate baudRate, ConnectionInfo::StopBits stopBits, ConnectionInfo::FlowControl flowControl)
Add an additional data source.
void trafficReceiverSelfTestErrorChanged()
Notifier signal.
QString statusString() const
Getter method for property with the same name.
void dataSourcesChanged()
Notifier signal.
Q_INVOKABLE void removeDataSources()
Remove all non-canonical data sources.
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.
Q_INVOKABLE bool hasDataSource_SerialPort(const QString &portNameOrDescription)
Check if serial port connection already exists.
QBindable< bool > bindableReceivingHeartbeat()
Getter method for property with the same name.
bool currentSourceIsInternetService() const
Getter method for property with the same name.
QList< Traffic::TrafficFactor_WithPosition * > trafficObjects
Traffic objects whose position is known.
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.
QBindable< QList< Traffic::ConnectionInfo > > bindableConnectionInfos()
Getter method for property with the same name.
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.