New Sensor-> Actor -> Item system (half implemented, relay support
only), new ui, Relay dehardcoeding.
This commit is contained in:
parent
74f117db69
commit
b04fbfb5bc
66 changed files with 3905 additions and 123 deletions
33
src/ui/sensorlistwidget.cpp
Normal file
33
src/ui/sensorlistwidget.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include "sensorlistwidget.h"
|
||||
|
||||
SensorListWidget::SensorListWidget(QWidget *parent): QListWidget (parent)
|
||||
{}
|
||||
|
||||
SensorListWidget::SensorListWidget(SensorStore& sensorStore, QWidget* parent): QListWidget (parent)
|
||||
{
|
||||
sensorsChanged(*(sensorStore.getSensors()));
|
||||
}
|
||||
|
||||
|
||||
void SensorListWidget::sensorsChanged(std::vector<Sensor> sensors)
|
||||
{
|
||||
clear();
|
||||
for(size_t i = 0; i < sensors.size(); ++i)
|
||||
{
|
||||
QString itemString = sensors[i].name + ": ";
|
||||
|
||||
if(sensors[i].type == Sensor::TYPE_DOOR)
|
||||
{
|
||||
if(sensors[i].field) itemString.append("Open");
|
||||
else itemString.append("Closed");
|
||||
}
|
||||
else if(sensors[i].type == Sensor::TYPE_AUDIO_OUTPUT)
|
||||
{
|
||||
if(sensors[i].field) itemString.append("Playing");
|
||||
else itemString.append("Silent");
|
||||
}
|
||||
else itemString.append(QString::number(sensors[i].field));
|
||||
addItem(itemString);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue