23#include <QNetworkDatagram>
24#include <QStandardPaths>
27#include "GlobalObject.h"
28#include "traffic/ConnectionInfo.h"
29#include "traffic/TrafficDataSource_Abstract.h"
212 [[nodiscard]] QList<Traffic::TrafficDataSource_Abstract*>
dataSources()
const;
220 return m_positionInfo.value();
247 return m_receivingHeartbeat.value();
262 return m_statusString.value();
277 return m_trafficObjects;
286 return m_trafficObjectWithoutPosition;
295 return m_trafficReceiverRuntimeError.value();
304 return m_trafficReceiverSelfTestError.value();
368 ConnectionInfo::BaudRate baudRate,
369 ConnectionInfo::StopBits stopBits,
370 ConnectionInfo::FlowControl flowControl);
491 void deferredInitialization();
495 void foreFlightBroadcast();
498 void loadConnectionInfos();
501 void onCurrentSourceChanged();
513 void saveConnectionInfos();
526 QProperty<QString> m_statusString;
527 QString computeStatusString();
531 QNetworkDatagram foreFlightBroadcastDatagram = {R
"({"App":"Enroute Flight Navigation","GDL90":{"port":4000}})", QHostAddress::Broadcast, 63093};
532 QUdpSocket foreFlightBroadcastSocket;
533 QTimer foreFlightBroadcastTimer;
536 QList<Traffic::TrafficFactor_WithPosition *> m_trafficObjects;
537 QPointer<Traffic::TrafficFactor_DistanceOnly> m_trafficObjectWithoutPosition;
540 QProperty<QList<QPointer<Traffic::TrafficDataSource_Abstract>>> m_dataSources;
546 QList<Traffic::TrafficDataSource_Abstract*> computeDataSources();
548 QProperty<QPointer<Traffic::TrafficDataSource_Abstract>> m_currentSource;
549 QPropertyNotifier m_currentSourceNotifier;
550 QPointer<Traffic::TrafficDataSource_Abstract> computeCurrentSource();
552 QProperty<bool> m_currentSourceIsInternetService;
556 QTimer m_WarningTimer;
559 QList<Traffic::ConnectionInfo> computeConnectionInfos();
562 QString computeTrafficReceiverRuntimeError();
565 QString computeTrafficReceiverSelfTestError();
567 QProperty<Positioning::PositionInfo> m_positionInfo;
570 QProperty<Units::Distance> m_pressureAltitude;
574 QTimer reconnectionTimer;
577 bool computeReceivingHeartbeat();
580 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 whose distance is known, but not its bearing.
Traffic factor whose precise position is known.
Convenience class for distance computations.
Conversion between units used in aviation.
Plain-data record of a traffic factor whose position is not known.
Plain-data record of a traffic factor whose precise position is known.