/**************************************************************************** * * (c) 2017 QGROUNDCONTROL PROJECT * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. * ****************************************************************************/ #pragma once #include /** * @class AirMapTrafficMonitor * */ class AirMapTrafficMonitor : public QObject, public LifetimeChecker { Q_OBJECT public: AirMapTrafficMonitor(AirMapSharedState& shared) : _shared(shared) { } virtual ~AirMapTrafficMonitor(); void startConnection(const QString& flightID); void stop(); signals: void error(const QString& what, const QString& airmapdMessage, const QString& airmapdDetails); void trafficUpdate(QString traffic_id, QString vehicle_id, QGeoCoordinate location, float heading); private: void _update(airmap::Traffic::Update::Type type, const std::vector& update); private: QString _flightID; AirMapSharedState& _shared; std::shared_ptr _monitor; std::shared_ptr _subscriber; };