Browse Source

thermostat: shutdown heaters if sensor is not available

master
rico rico 4 years ago
parent
commit
a409bdae50
3 changed files with 12 additions and 4 deletions
  1. +1
    -0
      soft/thermostat/inc/zoneitem.h
  2. +10
    -4
      soft/thermostat/src/mainwindow.cpp
  3. +1
    -0
      soft/thermostat/src/zoneitem.cpp

+ 1
- 0
soft/thermostat/inc/zoneitem.h View File

@ -26,6 +26,7 @@ public:
double m_temperature_value;
double m_hygro_value;
double m_target_temperature;
bool m_available;
bool m_heating_on;
private:


+ 10
- 4
soft/thermostat/src/mainwindow.cpp View File

@ -175,6 +175,9 @@ bool MainWindow::get_heater_order(int room_idx)
if (m_zones.at(room_idx)->m_temperature_value == FORCE_OFF) {
goto out;
}
if (!m_zones.at(room_idx)->m_available) {
goto out;
}
/* TODO: make it smarter */
if (qFabs(get_target_temperature(room_idx)
@ -292,10 +295,13 @@ void MainWindow::availability_slot(int idx, bool ok)
{
Settings *s = Settings::getInstance();
if ((idx < s->nbZones()) && !ok) {
m_zones.at(idx)->m_hygro_value = 0;
m_zones.at(idx)->m_temperature_value = 0;
m_zones.at(idx)->refresh();
if (idx < s->nbZones()) {
m_zones.at(idx)->m_available = ok;
if (!ok) {
m_zones.at(idx)->m_hygro_value = 0;
m_zones.at(idx)->m_temperature_value = 0;
m_zones.at(idx)->refresh();
}
}
}


+ 1
- 0
soft/thermostat/src/zoneitem.cpp View File

@ -26,6 +26,7 @@ ZoneItem::ZoneItem(const QString &zoneName, QWidget *parent) :
m_temperature_value = FORCE_OFF;
m_hygro_value = FORCE_OFF;
m_target_temperature = FORCE_OFF;
m_available = false;
/*
* Layout for the left part of the window


Loading…
Cancel
Save