|
@ -77,6 +77,13 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
connect(this, SIGNAL(setAllHeatersOn(bool)), m_mqtt, SLOT(allHeatersOn(bool))); |
|
|
connect(this, SIGNAL(setAllHeatersOn(bool)), m_mqtt, SLOT(allHeatersOn(bool))); |
|
|
|
|
|
|
|
|
connect(&m_state_btn, SIGNAL(clicked()), this, SLOT(change_state())); |
|
|
connect(&m_state_btn, SIGNAL(clicked()), this, SLOT(change_state())); |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Heater timer |
|
|
|
|
|
*/ |
|
|
|
|
|
m_timer = new QTimer(this); |
|
|
|
|
|
connect(m_timer, SIGNAL(timeout()), this, SLOT(apply_order_to_heaters())); |
|
|
|
|
|
m_timer->start(600000); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
MainWindow::~MainWindow() |
|
|
MainWindow::~MainWindow() |
|
@ -119,6 +126,11 @@ void MainWindow::change_state(void) |
|
|
|
|
|
|
|
|
update_state_btn(m_pwr_state); |
|
|
update_state_btn(m_pwr_state); |
|
|
|
|
|
|
|
|
|
|
|
apply_order_to_heaters(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::apply_order_to_heaters(void) |
|
|
|
|
|
{ |
|
|
switch (m_pwr_state) { |
|
|
switch (m_pwr_state) { |
|
|
case ON: |
|
|
case ON: |
|
|
emit setAllHeatersOn(true); |
|
|
emit setAllHeatersOn(true); |
|
|