Commit ad4d7957 authored by Gus Grubba's avatar Gus Grubba

Done with build errors

parent 421df93a
......@@ -11,6 +11,15 @@
#include "AirMapManager.h"
#include "MissionItem.h"
#include "QGCMAVLink.h"
#include "airmap/pilots.h"
#include "airmap/flights.h"
#include "airmap/date_time.h"
#include "airmap/flight_plans.h"
#include "airmap/geometry.h"
using namespace airmap;
AirMapFlightManager::AirMapFlightManager(AirMapSharedState& shared)
: _shared(shared)
......
......@@ -10,10 +10,15 @@
#pragma once
#include "LifetimeChecker.h"
#include "AirMapSharedState.h"
#include "AirspaceAuthorization.h"
#include <QObject>
#include <QTimer>
#include <QList>
#include <QGeoCoordinate>
class MissionItem;
//-----------------------------------------------------------------------------
/// class to upload a flight
......
......@@ -12,9 +12,9 @@
#include "AirMapRestrictionManager.h"
#include "AirMapRulesetsManager.h"
#include "AirMapSettings.h"
#include "AirMapSharedState.h"
#include "AirMapTelemetry.h"
#include "AirMapTrafficMonitor.h"
#include "AirMapVehicleManager.h"
#include "QmlObjectListModel.h"
#include "JsonHelper.h"
......@@ -24,13 +24,6 @@
#include "QGCApplication.h"
#include <airmap/authenticator.h>
#include <airmap/airspaces.h>
#include <airmap/evaluation.h>
#include <airmap/flight_plans.h>
#include <airmap/flights.h>
#include <airmap/pilots.h>
#include <airmap/telemetry.h>
#include <airmap/rulesets.h>
using namespace airmap;
......
......@@ -9,8 +9,8 @@
#pragma once
#include "AirMapSharedState.h"
#include "AirspaceManager.h"
#include "QGCLoggingCategory.h"
#include <airmap/qt/logger.h>
......@@ -19,7 +19,6 @@
#include <memory>
class QGCToolbox;
class AirMapSharedState;
class AirspaceVehicleManager;
class AirspaceRestrictionProvider;
class AirspaceRulesetsProvider;
......
......@@ -8,8 +8,12 @@
****************************************************************************/
#include "AirMapRestrictionManager.h"
#include "AirMapSharedState.h"
#include "AirMapManager.h"
#include "AirspaceRestriction.h"
#include "airmap/airspaces.h"
using namespace airmap;
AirMapRestrictionManager::AirMapRestrictionManager(AirMapSharedState& shared)
: _shared(shared)
......@@ -100,4 +104,3 @@ AirMapRestrictionManager::_addPolygonToList(const airmap::Geometry::Polygon& pol
qCDebug(AirMapManagerLog) << "Polygon with holes. Size: "<<polygon.inner_rings.size();
}
}
......@@ -11,11 +11,12 @@
#include "LifetimeChecker.h"
#include "AirspaceRestrictionProvider.h"
#include "AirMapSharedState.h"
#include <QList>
#include <QGeoCoordinate>
class AirMapSharedState;
#include "airmap/geometry.h"
/**
* @file AirMapRestrictionManager.h
......
......@@ -8,9 +8,12 @@
****************************************************************************/
#include "AirMapRulesetsManager.h"
#include "AirMapSharedState.h"
#include "AirMapManager.h"
#include "airmap/rulesets.h"
using namespace airmap;
//-----------------------------------------------------------------------------
AirMapRulesetsManager::AirMapRulesetsManager(AirMapSharedState& shared)
: _shared(shared)
......
......@@ -11,11 +11,10 @@
#include "LifetimeChecker.h"
#include "AirspaceRulesetsProvider.h"
#include "AirMapSharedState.h"
#include <QGeoCoordinate>
class AirMapSharedState;
/**
* @file AirMapRulesetsManager.h
* Class to download rulesets from AirMap
......
......@@ -10,6 +10,10 @@
#include "AirMapSharedState.h"
#include "AirMapManager.h"
#include "airmap/authenticator.h"
using namespace airmap;
void
AirMapSharedState::setSettings(const Settings& settings)
{
......
......@@ -10,6 +10,8 @@
#pragma once
#include <QObject>
#include <QQueue>
#include <airmap/qt/client.h>
/**
......
......@@ -8,11 +8,15 @@
****************************************************************************/
#include "AirMapTelemetry.h"
#include "AirMapSharedState.h"
#include "AirMapManager.h"
#include "QGCMAVLink.h"
#include "airmap/telemetry.h"
#include "airmap/flights.h"
using namespace airmap;
AirMapTelemetry::AirMapTelemetry(AirMapSharedState& shared)
: _shared(shared)
{
......
......@@ -10,10 +10,11 @@
#pragma once
#include "LifetimeChecker.h"
#include "AirMapSharedState.h"
#include <QObject>
#include <QGCMAVLink.h>
class AirMapSharedState;
#include <QObject>
/// class to send telemetry data to AirMap
class AirMapTelemetry : public QObject, public LifetimeChecker
......
......@@ -10,6 +10,8 @@
#include "AirMapTrafficMonitor.h"
#include "AirMapManager.h"
using namespace airmap;
AirMapTrafficMonitor::~AirMapTrafficMonitor()
{
stop();
......
......@@ -10,6 +10,7 @@
#pragma once
#include "LifetimeChecker.h"
#include "AirMapSharedState.h"
#include <QObject>
#include <QGeoCoordinate>
......@@ -18,8 +19,6 @@
#include <memory>
class AirMapSharedState;
/**
* @class AirMapTrafficMonitor
*
......
......@@ -8,10 +8,6 @@
****************************************************************************/
#include "AirMapVehicleManager.h"
#include "AirMapSharedState.h"
#include "AirMapFlightManager.h"
#include "AirMapTelemetry.h"
#include "AirMapTrafficMonitor.h"
#include "AirMapManager.h"
#include "Vehicle.h"
......
......@@ -11,16 +11,15 @@
#include "AirspaceManager.h"
#include "AirspaceVehicleManager.h"
#include "AirMapSharedState.h"
#include "AirMapFlightManager.h"
#include "AirMapTelemetry.h"
#include "AirMapTrafficMonitor.h"
#include "QGCToolbox.h"
/// AirMap per vehicle management class.
class AirMapSharedState;
class AirMapFlightManager;
class AirMapTelemetry;
class AirMapTrafficMonitor;
class AirMapVehicleManager : public AirspaceVehicleManager
{
Q_OBJECT
......
......@@ -8,14 +8,15 @@
****************************************************************************/
#include "AirMapWeatherInformation.h"
#include "AirMapSharedState.h"
#include "AirMapManager.h"
#define WEATHER_UPDATE_DISTANCE 50000 //-- 50km threshold for weather updates
#define WEATHER_UPDATE_TIME 30 * 60 * 60 * 1000 //-- 30 minutes threshold for weather updates
using namespace airmap;
AirMapWeatherInformation::AirMapWeatherInformation(AirMapSharedState& shared, QObject *parent)
: QObject(parent)
: AirspaceWeatherInfoProvider(parent)
, _valid(false)
, _windHeading(0)
, _windSpeed(0)
......@@ -24,11 +25,12 @@ AirMapWeatherInformation::AirMapWeatherInformation(AirMapSharedState& shared, QO
, _humidity(0.0f)
, _visibility(0)
, _precipitation(0)
, _shared(shared)
{
}
void
AirMapWeatherInformation::setROI(QGeoCoordinate center)
AirMapWeatherInformation::setROI(const QGeoCoordinate& center)
{
//-- If first time or we've moved more than WEATHER_UPDATE_DISTANCE, ask for weather updates.
if(!_lastRoiCenter.isValid() || _lastRoiCenter.distanceTo(center) > WEATHER_UPDATE_DISTANCE) {
......@@ -60,7 +62,6 @@ AirMapWeatherInformation::_requestWeatherUpdate(const QGeoCoordinate& coordinate
_shared.client()->status().get_status_by_point(params, [this, coordinate](const Status::GetStatus::Result& result) {
if (result) {
const Status::Weather& weather = result.value().weather;
AirMapWeatherInformation weatherUpdateInfo;
_valid = true;
_condition = QString::fromStdString(weather.condition);
_icon = QStringLiteral("qrc:/airmapweather/") + QString::fromStdString(weather.icon) + QStringLiteral(".svg");
......
......@@ -12,6 +12,7 @@
#include "LifetimeChecker.h"
#include "AirspaceWeatherInfoProvider.h"
#include "AirMapSharedState.h"
#include <QGeoCoordinate>
#include <QTime>
......@@ -40,21 +41,25 @@ public:
void setROI (const QGeoCoordinate& center) override;
signals:
void error (const QString& what, const QString& airmapdMessage, const QString& airmapdDetails);
private:
void _requestWeatherUpdate (const QGeoCoordinate& coordinate);
private:
bool _valid;
QString _condition;
QString _icon;
quint32 _windHeading;
quint32 _windSpeed;
quint32 _windGusting;
qint32 _temperature;
float _humidity;
quint32 _visibility;
quint32 _precipitation;
bool _valid;
QString _condition;
QString _icon;
quint32 _windHeading;
quint32 _windSpeed;
quint32 _windGusting;
qint32 _temperature;
float _humidity;
quint32 _visibility;
quint32 _precipitation;
//-- Don't check the weather every time the user moves the map
QGeoCoordinate _lastRoiCenter;
QTime _weatherTime;
AirMapSharedState& _shared;
QGeoCoordinate _lastRoiCenter;
QTime _weatherTime;
};
......@@ -10,6 +10,7 @@
#pragma once
#include <QObject>
#include <QGeoCoordinate>
class AirspaceManager;
class QmlObjectListModel;
......@@ -29,10 +30,10 @@ public:
Q_INVOKABLE void setROI (QGeoCoordinate center, double radius);
QmlObjectListModel* polygons () { return _manager->polygonRestrictions(); }
QmlObjectListModel* circles () { return _manager->circularRestrictions(); }
QString providerName() { return _manager->name(); }
AirspaceWeatherInfoProvider* weatherInfo () { return _manager->weatherInfo(); }
QmlObjectListModel* polygons ();
QmlObjectListModel* circles ();
QString providerName();
AirspaceWeatherInfoProvider* weatherInfo ();
private:
AirspaceManager* _manager;
......
......@@ -10,12 +10,14 @@
#include "AirspaceManager.h"
#include "AirspaceWeatherInfoProvider.h"
#include "AirspaceRestriction.h"
#include "AirspaceRestrictionProvider.h"
#include "AirspaceRulesetsProvider.h"
#include "AirspaceVehicleManager.h"
#include "AirspaceController.h"
#include "Vehicle.h"
#include "QGCApplication.h"
#include "QmlObjectListModel.h"
QGC_LOGGING_CATEGORY(AirspaceManagementLog, "AirspaceManagementLog")
......
......@@ -25,6 +25,7 @@
#include "QGCToolbox.h"
#include "QGCLoggingCategory.h"
#include "QmlObjectListModel.h"
#include <QGeoCoordinate>
#include <QObject>
......@@ -34,10 +35,10 @@
class Vehicle;
class QGCApplication;
class QmlObjectListModel;
class AirspaceWeatherInfoProvider;
class AirspaceRestrictionProvider;
class AirspaceRulesetsProvider;
class AirspaceVehicleManager;
Q_DECLARE_LOGGING_CATEGORY(AirspaceManagementLog)
......@@ -55,7 +56,7 @@ public:
/**
* Factory method to create an AirspaceVehicleManager object
*/
virtual AirspaceVehicleManager* instantiateVehicle (const Vehicle& vehicle) = 0;
virtual AirspaceVehicleManager* instantiateVehicle (const Vehicle& vehicle) = 0;
/**
* Factory method to create an AirspaceRestrictionProvider object
......
......@@ -16,6 +16,7 @@
#include <QObject>
#include <QList>
#include <QGeoCoordinate>
class AirspacePolygonRestriction;
class AirspaceCircularRestriction;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment