AirspaceController.cc 1.04 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.
 *
 ****************************************************************************/

Gus Grubba's avatar
Gus Grubba committed
10
#include "AirMapManager.h"
11 12
#include "AirspaceController.h"
#include "AirspaceManagement.h"
13 14 15
#include "QGCApplication.h"
#include "QGCQGeoCoordinate.h"

Gus Grubba's avatar
Gus Grubba committed
16 17 18
#define WEATHER_UPDATE_DISTANCE 50000                   //-- 50km threshold for weather updates
#define WEATHER_UPDATE_TIME     30 * 60 * 60 * 1000     //-- 30 minutes threshold for weather updates

19
AirspaceController::AirspaceController(QObject* parent)
20
    : QObject(parent)
21
    , _manager(qgcApp()->toolbox()->airspaceManager())
Gus Grubba's avatar
Gus Grubba committed
22 23 24 25 26
{
    connect(_manager, &AirspaceManager::weatherUpdate, this, &AirspaceController::_weatherUpdate);
}

void AirspaceController::setROI(QGeoCoordinate center, double radius)
27
{
Gus Grubba's avatar
Gus Grubba committed
28 29
    _manager->setROI(center, radius);
}