Kstars

indiweather.h
1 /*
2  SPDX-FileCopyrightText: 2015 Jasem Mutlaq <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <memory>
10 #include <QTimer>
11 
12 #include "indiconcretedevice.h"
13 
14 namespace ISD
15 {
16 /**
17  * @class Weather
18  * Focuser class handles control of INDI Weather devices. It reports overall state and the value of each parameter
19  *
20  * @author Jasem Mutlaq
21  */
22 class Weather : public ConcreteDevice
23 {
24  Q_OBJECT
25 
26  public:
27  explicit Weather(GenericDevice *parent);
28 
29  typedef enum
30  {
31  WEATHER_IDLE,
32  WEATHER_OK,
33  WEATHER_WARNING,
34  WEATHER_ALERT,
35  } Status;
36 
37  typedef struct
38  {
39  QString name;
40  QString label;
41  double value;
42  } WeatherData;
43 
44  void processNumber(INumberVectorProperty *nvp) override;
45  void processLight(ILightVectorProperty *lvp) override;
46 
47  Status getWeatherStatus();
48  quint16 getUpdatePeriod();
49  bool refresh();
50 
51  signals:
52  void newStatus(Status status);
53  void newWeatherData(const std::vector<WeatherData> &data);
54 
55  private:
56  Status m_WeatherStatus { WEATHER_IDLE };
57  std::vector<WeatherData> m_WeatherData;
58 };
59 }
60 
61 #ifndef KSTARS_LITE
62 Q_DECLARE_METATYPE(ISD::Weather::Status)
63 QDBusArgument &operator<<(QDBusArgument &argument, const ISD::Weather::Status &source);
64 const QDBusArgument &operator>>(const QDBusArgument &argument, ISD::Weather::Status &dest);
65 #endif
Q_OBJECTQ_OBJECT
The ConcreteDevice class.
QDebug operator<<(QDebug d, const QCPVector2D &vec)
Definition: qcustomplot.h:450
QDataStream & operator>>(QDataStream &in, KDateTime &dateTime)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:01:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.