AirspaceWeatherInfoProvider.h 2.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/****************************************************************************
 *
 *   (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 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

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)
    Q_PROPERTY(quint32  windSpeed       READ windSpeed      NOTIFY weatherChanged)
    Q_PROPERTY(quint32  windGusting     READ windGusting    NOTIFY weatherChanged)
    Q_PROPERTY(qint32   temperature     READ temperature    NOTIFY weatherChanged)
    Q_PROPERTY(float    humidity        READ humidity       NOTIFY weatherChanged)
    Q_PROPERTY(quint32  visibility      READ visibility     NOTIFY weatherChanged)
    Q_PROPERTY(quint32  precipitation   READ precipitation  NOTIFY weatherChanged)

    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 [°].
    virtual quint32 windSpeed       ()  = 0;    ///< The speed in [°].
    virtual quint32 windGusting     ()  = 0;
    virtual qint32  temperature     ()  = 0;    ///< The temperature in [°C].
    virtual float   humidity        ()  = 0;
    virtual quint32 visibility      ()  = 0;    ///< Visibility in [m].
    virtual quint32 precipitation   ()  = 0;    ///< The probability of precipitation in [%].

    /**
     * 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) = 0;
55 56 57 58

signals:
    void weatherChanged  ();
};