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.

71 lines
1.5 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 <QTimer>
  16. #include <QDate>
  17. #include "mqttclient.h"
  18. #include "zoneitem.h"
  19. #include "boost_dlg.h"
  20. #include "menu_dlg.h"
  21. #include "edit_dlg.h"
  22. #include "settings.h"
  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. BoostDlg *m_boost;
  35. EditDlg *m_edit_dlg;
  36. MenuDlg *m_menu;
  37. QStackedWidget m_central_widget;
  38. void update_state_btn(enum power_states st);
  39. double get_target_temperature(int room_idx);
  40. bool get_heater_order(int room_idx);
  41. void apply_automatic_state(void);
  42. private slots:
  43. void temperature_slot(int idx, double val);
  44. void hygro_slot(int idx, double val);
  45. void availability_slot(int idx, bool ok);
  46. void change_state(void);
  47. void apply_order_to_heaters(void);
  48. void show_boost(void);
  49. void do_show_edit_dlg(void);
  50. void show_main(void);
  51. void show_menu(void);
  52. void boost_slot(int idx, struct boost_data &data);
  53. void do_show_holiday_dlg(void);
  54. void do_close_holiday_dlg(void);
  55. void set_holiday_mode(QDateTime end_date);
  56. signals:
  57. void setAllHeatersOn(bool on);
  58. };
  59. #endif // MAINWINDOW_H
  60. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */