Changeset View
Changeset View
Standalone View
Standalone View
kstars/indi/indiweather.h
Show All 31 Lines | 29 | public: | |||
---|---|---|---|---|---|
32 | typedef enum | 32 | typedef enum | ||
33 | { | 33 | { | ||
34 | WEATHER_IDLE, | 34 | WEATHER_IDLE, | ||
35 | WEATHER_OK, | 35 | WEATHER_OK, | ||
36 | WEATHER_WARNING, | 36 | WEATHER_WARNING, | ||
37 | WEATHER_ALERT, | 37 | WEATHER_ALERT, | ||
38 | } Status; | 38 | } Status; | ||
39 | 39 | | |||
40 | typedef struct { QString name; QString label; double value; } WeatherData; | ||||
41 | | ||||
40 | void registerProperty(INDI::Property *prop) override; | 42 | void registerProperty(INDI::Property *prop) override; | ||
41 | void processSwitch(ISwitchVectorProperty *svp) override; | 43 | void processSwitch(ISwitchVectorProperty *svp) override; | ||
42 | void processText(ITextVectorProperty *tvp) override; | 44 | void processText(ITextVectorProperty *tvp) override; | ||
43 | void processNumber(INumberVectorProperty *nvp) override; | 45 | void processNumber(INumberVectorProperty *nvp) override; | ||
44 | void processLight(ILightVectorProperty *lvp) override; | 46 | void processLight(ILightVectorProperty *lvp) override; | ||
45 | 47 | | |||
46 | DeviceFamily getType() override | 48 | DeviceFamily getType() override | ||
47 | { | 49 | { | ||
48 | return dType; | 50 | return dType; | ||
49 | } | 51 | } | ||
50 | 52 | | |||
51 | Status getWeatherStatus(); | 53 | Status getWeatherStatus(); | ||
52 | quint16 getUpdatePeriod(); | 54 | quint16 getUpdatePeriod(); | ||
53 | 55 | | |||
54 | signals: | 56 | signals: | ||
55 | void newStatus(Status status); | 57 | void newStatus(Status status); | ||
58 | void newWeatherData(std::vector<WeatherData>); | ||||
56 | void ready(); | 59 | void ready(); | ||
57 | 60 | | |||
58 | private: | 61 | private: | ||
59 | Status m_WeatherStatus { WEATHER_IDLE }; | 62 | Status m_WeatherStatus { WEATHER_IDLE }; | ||
60 | std::unique_ptr<QTimer> readyTimer; | 63 | std::unique_ptr<QTimer> readyTimer; | ||
61 | }; | 64 | }; | ||
62 | } | 65 | } | ||
63 | 66 | | |||
64 | #ifndef KSTARS_LITE | 67 | #ifndef KSTARS_LITE | ||
65 | Q_DECLARE_METATYPE(ISD::Weather::Status) | 68 | Q_DECLARE_METATYPE(ISD::Weather::Status) | ||
66 | QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Weather::Status &source); | 69 | QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Weather::Status &source); | ||
67 | const QDBusArgument &operator>>(const QDBusArgument &argument, ISD::Weather::Status &dest); | 70 | const QDBusArgument &operator>>(const QDBusArgument &argument, ISD::Weather::Status &dest); | ||
68 | #endif | 71 | #endif |