AirMapManager.h 2 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 24
class QGCToolbox;
class AirspaceVehicleManager;
class AirspaceRulesetsProvider;
class AirspaceWeatherInfoProvider;
Gus Grubba's avatar
Gus Grubba committed
25
class AirspaceAdvisoryProvider;
26
class AirspaceRestrictionProvider;
Gus Grubba's avatar
Gus Grubba committed
27 28

Q_DECLARE_LOGGING_CATEGORY(AirMapManagerLog)
29

30
//-----------------------------------------------------------------------------
31
/**
32 33
 * @class AirMapManager
 * AirMap implementation of AirspaceManager
34
 */
35

36 37 38 39 40 41
class AirMapManager : public AirspaceManager
{
    Q_OBJECT
    
public:
    AirMapManager(QGCApplication* app, QGCToolbox* toolbox);
42
    virtual ~AirMapManager();
43

44
    void setToolbox (QGCToolbox* toolbox) override;
45

46 47 48
    AirspaceVehicleManager*         instantiateVehicle                      (const Vehicle& vehicle) override;
    AirspaceRulesetsProvider*       instantiateRulesetsProvider             () override;
    AirspaceWeatherInfoProvider*    instatiateAirspaceWeatherInfoProvider   () override;
Gus Grubba's avatar
Gus Grubba committed
49
    AirspaceAdvisoryProvider*       instatiateAirspaceAdvisoryProvider      () override;
50
    AirspaceRestrictionProvider*    instantiateAirspaceRestrictionProvider  () override;
51

52
    QString name            () const override { return "AirMap"; }
53

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

private:
59 60 61
    AirMapSharedState                               _shared;
    std::shared_ptr<airmap::qt::Logger>             _logger;
    std::shared_ptr<airmap::qt::DispatchingLogger>  _dispatchingLogger;
62 63
};

64