AirspaceWeatherInfoProvider.h 2.58 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#pragma once

/**
 * @file AirspaceWeatherInfoProvider.h
 * Weather information provided by the Airspace Managemement
 */

17
#include "QGCGeoBoundingCube.h"
18
#include <QObject>
19
#include <QGeoCoordinate>
20 21 22 23 24 25 26 27 28 29 30 31

class AirspaceWeatherInfoProvider : public QObject
{
    Q_OBJECT
public:
    AirspaceWeatherInfoProvider(QObject *parent = nullptr);
    virtual ~AirspaceWeatherInfoProvider() {}

    Q_PROPERTY(bool     valid           READ valid          NOTIFY weatherChanged)
    Q_PROPERTY(QString  condition       READ condition      NOTIFY weatherChanged)
    Q_PROPERTY(QString  icon            READ icon           NOTIFY weatherChanged)
    Q_PROPERTY(quint32  windHeading     READ windHeading    NOTIFY weatherChanged)
32
    Q_PROPERTY(float    windSpeed       READ windSpeed      NOTIFY weatherChanged)
33
    Q_PROPERTY(quint32  windGusting     READ windGusting    NOTIFY weatherChanged)
34
    Q_PROPERTY(float    temperature     READ temperature    NOTIFY weatherChanged)
35
    Q_PROPERTY(float    humidity        READ humidity       NOTIFY weatherChanged)
36 37
    Q_PROPERTY(float    visibility      READ visibility     NOTIFY weatherChanged)
    Q_PROPERTY(float    precipitation   READ precipitation  NOTIFY weatherChanged)
38 39 40 41 42

    virtual bool    valid           ()  = 0;    ///< Current weather data is valid
    virtual QString condition       ()  = 0;    ///< The overall weather condition.
    virtual QString icon            ()  = 0;    ///< 2:1 Aspect ratio icon url ready to be used by an Image QML Item
    virtual quint32 windHeading     ()  = 0;    ///< The heading in [°].
43
    virtual float   windSpeed       ()  = 0;    ///< The speed in [°].
44
    virtual quint32 windGusting     ()  = 0;
45
    virtual float   temperature     ()  = 0;    ///< The temperature in [°C].
46
    virtual float   humidity        ()  = 0;
47 48
    virtual float   visibility      ()  = 0;    ///< Visibility in [m].
    virtual float   precipitation   ()  = 0;    ///< The probability of precipitation in [%].
49 50 51 52 53

    /**
     * Set region of interest that should be queried. When finished, the weatherChanged() signal will be emmited.
     * @param center Center coordinate for ROI
     */
54
    virtual void setROI (const QGCGeoBoundingCube& roi, bool reset = false) = 0;
55 56 57 58

signals:
    void weatherChanged  ();
};