Thermostat pour piloter jusqu'à 4 radiateurs avec fil pilote
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.0 KiB

  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. /*
  3. * Qt mutizone MQTT thermostat
  4. *
  5. * Copyright (C) 2019 Richard Genoud
  6. *
  7. */
  8. #ifndef MAINWINDOW_H
  9. #define MAINWINDOW_H
  10. #include <QMainWindow>
  11. #include <QPushButton>
  12. #include <QtWidgets>
  13. #include <QVector>
  14. #include "mqttclient.h"
  15. #include "zoneitem.h"
  16. #include "settings.h"
  17. enum power_states {
  18. OFF,
  19. ON,
  20. AUTO,
  21. MAX_POWER_STATES
  22. };
  23. class MainWindow : public QMainWindow
  24. {
  25. Q_OBJECT
  26. public:
  27. explicit MainWindow(QWidget *parent = NULL);
  28. ~MainWindow();
  29. private:
  30. MQTTClient *m_mqtt;
  31. QPushButton m_state_btn;
  32. QVector<ZoneItem *> m_zones;
  33. QTimer *m_timer;
  34. enum power_states m_pwr_state;
  35. void update_state_btn(enum power_states st);
  36. private slots:
  37. void temperature_slot(int idx, double val);
  38. void hygro_slot(int idx, double val);
  39. void availability_slot(int idx, bool ok);
  40. void change_state(void);
  41. void apply_order_to_heaters(void);
  42. signals:
  43. void setAllHeatersOn(bool on);
  44. };
  45. #endif // MAINWINDOW_H
  46. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */