AirMapManager.h 2.27 KB
Newer Older
1 2
/****************************************************************************
 *
3
 *   (c) 2017 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10
#pragma once
11

Gus Grubba's avatar
Gus Grubba committed
12
#include "AirMapSharedState.h"
Gus Grubba's avatar
Gus Grubba committed
13
#include "AirspaceManager.h"
14 15
#include "QGCLoggingCategory.h"

16 17
#include <airmap/qt/logger.h>
#include <airmap/qt/types.h>
18

Gus Grubba's avatar
Gus Grubba committed
19
#include <memory>
20

Gus Grubba's avatar
Gus Grubba committed
21 22 23
class QGCToolbox;

Q_DECLARE_LOGGING_CATEGORY(AirMapManagerLog)
24

25
//-----------------------------------------------------------------------------
26
/**
27 28
 * @class AirMapManager
 * AirMap implementation of AirspaceManager
29
 */
30

31 32 33 34 35
class AirMapManager : public AirspaceManager
{
    Q_OBJECT
public:
    AirMapManager(QGCApplication* app, QGCToolbox* toolbox);
36
    virtual ~AirMapManager();
37

38
    void setToolbox (QGCToolbox* toolbox) override;
39

40
    QString                         providerName                            () const override { return QString("AirMap"); }
41
    AirspaceVehicleManager*         instantiateVehicle                      (const Vehicle& vehicle) override;
Gus Grubba's avatar
Gus Grubba committed
42 43
    bool                            connected                               () const override;
    QString                         connectStatus                           () const override { return _connectStatus; }
44

45 46 47 48 49
protected:
    AirspaceRulesetsProvider*       _instantiateRulesetsProvider            () override;
    AirspaceWeatherInfoProvider*    _instatiateAirspaceWeatherInfoProvider  () override;
    AirspaceAdvisoryProvider*       _instatiateAirspaceAdvisoryProvider     () override;
    AirspaceRestrictionProvider*    _instantiateAirspaceRestrictionProvider () override;
Gus Grubba's avatar
Gus Grubba committed
50
    AirspaceFlightPlanProvider*     _instantiateAirspaceFlightPlanProvider  () override;
51

52
private slots:
53 54
    void _error             (const QString& what, const QString& airmapdMessage, const QString& airmapdDetails);
    void _settingsChanged   ();
55 56

private:
Gus Grubba's avatar
Gus Grubba committed
57
    QString                                         _connectStatus;
58 59 60
    AirMapSharedState                               _shared;
    std::shared_ptr<airmap::qt::Logger>             _logger;
    std::shared_ptr<airmap::qt::DispatchingLogger>  _dispatchingLogger;
61 62
};

63