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);
482 void deferredInitialization();
486 void foreFlightBroadcast();
489 void loadConnectionInfos();
492 void onCurrentSourceChanged();
504 void saveConnectionInfos();
515 QProperty<QString> m_statusString;
516 QString computeStatusString();
520 QNetworkDatagram foreFlightBroadcastDatagram {R
"({"App":"Enroute Flight Navigation","GDL90":{"port":4000}})", QHostAddress::Broadcast, 63093};
521 QUdpSocket foreFlightBroadcastSocket;
522 QTimer foreFlightBroadcastTimer;
525 QList<Traffic::TrafficFactor_WithPosition *> m_trafficObjects;
526 QPointer<Traffic::TrafficFactor_DistanceOnly> m_trafficObjectWithoutPosition;
529 QProperty<QList<QPointer<Traffic::TrafficDataSource_Abstract>>> m_dataSources;
531 QProperty<QPointer<Traffic::TrafficDataSource_Abstract>> m_currentSource;
532 QPropertyNotifier m_currentSourceNotifier;
533 QPointer<Traffic::TrafficDataSource_Abstract> computeCurrentSource();
535 QProperty<bool> m_currentSourceIsInternetService;
539 QTimer m_WarningTimer;
542 QList<Traffic::ConnectionInfo> computeConnectionInfos();
545 QString computeTrafficReceiverRuntimeError();
548 QString computeTrafficReceiverSelfTestError();
550 QProperty<Positioning::PositionInfo> m_positionInfo;
553 QProperty<Units::Distance> m_pressureAltitude;
557 QTimer reconnectionTimer;
560 bool computeReceivingHeartbeat();
563 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.
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.