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.

74 lines
1.6 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 "edit_prog_dlg.h"
  23. #include "settings.h"
  24. class MainWindow : public QMainWindow
  25. {
  26. Q_OBJECT
  27. public:
  28. explicit MainWindow(QWidget *parent = NULL);
  29. ~MainWindow();
  30. private:
  31. MQTTClient *m_mqtt;
  32. QPushButton *m_state_btn;
  33. QVector<ZoneItem *> m_zones;
  34. QTimer *m_timer;
  35. BoostDlg *m_boost;
  36. EditDlg *m_edit_dlg;
  37. MenuDlg *m_menu;
  38. QStackedWidget m_central_widget;
  39. void update_state_btn(enum power_states st);
  40. double get_target_temperature(int room_idx);
  41. bool get_heater_order(int room_idx);
  42. void apply_automatic_state(void);
  43. private slots:
  44. void temperature_slot(int idx, double val);
  45. void hygro_slot(int idx, double val);
  46. void availability_slot(int idx, bool ok);
  47. void change_state(void);
  48. void apply_order_to_heaters(void);
  49. void show_boost(void);
  50. void do_show_edit_dlg(void);
  51. void show_main(void);
  52. void show_menu(void);
  53. void boost_slot(int idx, struct boost_data &data);
  54. void do_show_holiday_dlg(void);
  55. void do_close_holiday_dlg(void);
  56. void do_show_edit_prog_dlg(struct Program &p);
  57. void do_close_edit_prog_dlg(void);
  58. void set_holiday_mode(QDateTime end_date);
  59. signals:
  60. void setAllHeatersOn(bool on);
  61. };
  62. #endif // MAINWINDOW_H
  63. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */