1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/****************************************************************************
*
* (c) 2017 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.
*
****************************************************************************/
#pragma once
/**
* @file AirspaceAdvisoryProvider.h
* Weather information provided by the Airspace Managemement
*/
#include "QmlObjectListModel.h"
#include "QGCGeoBoundingCube.h"
#include <QObject>
#include <QGeoCoordinate>
//-----------------------------------------------------------------------------
class AirspaceAdvisoryProvider : public QObject
{
Q_OBJECT
public:
enum AdvisoryColor {
Green,
Yellow,
Orange,
Red
};
Q_ENUM(AdvisoryColor)
AirspaceAdvisoryProvider (QObject *parent = nullptr);
virtual ~AirspaceAdvisoryProvider () {}
Q_PROPERTY(bool valid READ valid NOTIFY advisoryChanged)
Q_PROPERTY(AdvisoryColor airspaceColor READ airspaceColor NOTIFY advisoryChanged)
Q_PROPERTY(QmlObjectListModel* advisories READ advisories NOTIFY advisoryChanged)
virtual bool valid () = 0; ///< Current data is valid
virtual AdvisoryColor airspaceColor () = 0; ///< Aispace overall color
virtual QmlObjectListModel* advisories () = 0; ///< List of AirspaceAdvisory
/**
* Set region of interest that should be queried. When finished, the advisoryChanged() signal will be emmited.
* @param center Center coordinate for ROI
*/
virtual void setROI (const QGCGeoBoundingCube& roi) = 0;
signals:
void advisoryChanged ();
};
//-----------------------------------------------------------------------------
class AirspaceAdvisory : public QObject
{
Q_OBJECT
public:
enum AdvisoryType {
Invalid = 0,
Airport = 1 << 0,
Controlled_airspace = 1 << 1,
Special_use_airspace = 1 << 2,
Tfr = 1 << 3,
Wildfire = 1 << 4,
Park = 1 << 5,
Power_plant = 1 << 6,
Heliport = 1 << 7,
Prison = 1 << 8,
School = 1 << 9,
Hospital = 1 << 10,
Fire = 1 << 11,
Emergency = 1 << 12,
};
Q_ENUM(AdvisoryType)
AirspaceAdvisory (QObject* parent = NULL);
Q_PROPERTY(QString id READ id CONSTANT)
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(AdvisoryType type READ type CONSTANT)
Q_PROPERTY(QString typeStr READ typeStr CONSTANT)
Q_PROPERTY(QGeoCoordinate coordinates READ coordinates CONSTANT)
Q_PROPERTY(qreal radius READ radius CONSTANT)
Q_PROPERTY(AirspaceAdvisoryProvider::AdvisoryColor color READ color CONSTANT)
virtual QString id () = 0;
virtual QString name () = 0;
virtual AdvisoryType type () = 0;
virtual QString typeStr ();
virtual QGeoCoordinate coordinates () = 0;
virtual qreal radius () = 0;
virtual AirspaceAdvisoryProvider::AdvisoryColor color () = 0;
};