|
|
@ -19,11 +19,13 @@ ZoneItem::ZoneItem(const QString &zoneName, QWidget *parent) : |
|
|
|
{ |
|
|
|
m_zoneNameBtn.setText(zoneName); |
|
|
|
m_zoneNameBtn.setFlat(true); |
|
|
|
m_temperatureBtn.setText("20.3°C / 20°C"); |
|
|
|
m_temperatureBtn.setFlat(true); |
|
|
|
m_hygroBtn.setText("45%h"); |
|
|
|
m_hygroBtn.setFlat(true); |
|
|
|
|
|
|
|
m_temperature_value = 0; |
|
|
|
m_hygro_value = 0; |
|
|
|
m_target_temperature = 0; |
|
|
|
|
|
|
|
/*
|
|
|
|
* Layout for the left part of the window |
|
|
|
*/ |
|
|
@ -39,4 +41,38 @@ ZoneItem::~ZoneItem() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
void ZoneItem::refresh(void) |
|
|
|
{ |
|
|
|
QString text; |
|
|
|
|
|
|
|
text += QString::number(m_temperature_value); |
|
|
|
text += QString("°C / "); |
|
|
|
text += QString::number(m_target_temperature); |
|
|
|
text += QString("°C"); |
|
|
|
|
|
|
|
m_temperatureBtn.setText(text); |
|
|
|
|
|
|
|
text = QString::number(m_hygro_value); |
|
|
|
text += QString("%h"); |
|
|
|
m_hygroBtn.setText(text); |
|
|
|
} |
|
|
|
|
|
|
|
void ZoneItem::set_temperature_value(double val) |
|
|
|
{ |
|
|
|
m_temperature_value = val; |
|
|
|
refresh(); |
|
|
|
} |
|
|
|
|
|
|
|
void ZoneItem::set_target_temperature(double val) |
|
|
|
{ |
|
|
|
m_target_temperature = val; |
|
|
|
refresh(); |
|
|
|
} |
|
|
|
|
|
|
|
void ZoneItem::set_hygro_value(double val) |
|
|
|
{ |
|
|
|
m_hygro_value = val; |
|
|
|
refresh(); |
|
|
|
} |
|
|
|
|
|
|
|
/* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */ |