AirMapManager.h 1.99 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;
42

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

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

private:
55 56 57
    AirMapSharedState                               _shared;
    std::shared_ptr<airmap::qt::Logger>             _logger;
    std::shared_ptr<airmap::qt::DispatchingLogger>  _dispatchingLogger;
58 59
};

60