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

10
#include "AirspaceController.h"
Gus Grubba's avatar
Gus Grubba committed
11 12
#include "AirspaceManager.h"
#include "AirspaceWeatherInfoProvider.h"
Gus Grubba's avatar
Gus Grubba committed
13
#include "AirspaceAdvisoryProvider.h"
Gus Grubba's avatar
Gus Grubba committed
14

15 16
#include "QGCApplication.h"
#include "QGCQGeoCoordinate.h"
Gus Grubba's avatar
Gus Grubba committed
17
#include "QmlObjectListModel.h"
18

19
AirspaceController::AirspaceController(QObject* parent)
20
    : QObject(parent)
21
    , _manager(qgcApp()->toolbox()->airspaceManager())
Gus Grubba's avatar
Gus Grubba committed
22 23 24
{
}

Gus Grubba's avatar
Gus Grubba committed
25 26
void
AirspaceController::setROI(QGeoCoordinate center, double radius)
27
{
Gus Grubba's avatar
Gus Grubba committed
28 29
    _manager->setROI(center, radius);
}
Gus Grubba's avatar
Gus Grubba committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

QmlObjectListModel*
AirspaceController::polygons()
{
    return _manager->polygonRestrictions();
}

QmlObjectListModel*
AirspaceController::circles()
{
    return _manager->circularRestrictions();
}

QString
AirspaceController::providerName()
{
    return _manager->name();
}

AirspaceWeatherInfoProvider*
AirspaceController::weatherInfo()
{
    return _manager->weatherInfo();
}
Gus Grubba's avatar
Gus Grubba committed
54 55 56 57 58 59 60 61

AirspaceAdvisoryProvider*
AirspaceController::advisories()
{
    return _manager->advisories();
}

AirspaceRulesetsProvider*
62
AirspaceController::rulesets()
Gus Grubba's avatar
Gus Grubba committed
63
{
64
    return _manager->rulesets();
Gus Grubba's avatar
Gus Grubba committed
65
}