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.

63 lines
1.3 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 <QStackedWidget>
  11. #include <QMainWindow>
  12. #include <QPushButton>
  13. #include <QtWidgets>
  14. #include <QVector>
  15. #include "mqttclient.h"
  16. #include "zoneitem.h"
  17. #include "boost_dlg.h"
  18. #include "menu_dlg.h"
  19. #include "settings.h"
  20. class MainWindow : public QMainWindow
  21. {
  22. Q_OBJECT
  23. public:
  24. explicit MainWindow(QWidget *parent = NULL);
  25. ~MainWindow();
  26. private:
  27. MQTTClient *m_mqtt;
  28. QPushButton m_state_btn;
  29. QVector<ZoneItem *> m_zones;
  30. QTimer *m_timer;
  31. BoostDlg *m_boost;
  32. MenuDlg *m_menu;
  33. QStackedWidget m_central_widget;
  34. void update_state_btn(enum power_states st);
  35. double get_target_temperature(int room_idx);
  36. bool get_heater_order(int room_idx);
  37. void apply_automatic_state(void);
  38. private slots:
  39. void temperature_slot(int idx, double val);
  40. void hygro_slot(int idx, double val);
  41. void availability_slot(int idx, bool ok);
  42. void change_state(void);
  43. void apply_order_to_heaters(void);
  44. void show_boost(void);
  45. void show_main(void);
  46. void show_menu(void);
  47. void boost_slot(int idx, struct boost_data &data);
  48. signals:
  49. void setAllHeatersOn(bool on);
  50. };
  51. #endif // MAINWINDOW_H
  52. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */