Fix bug that prevented aquireing new items
Add save button to master that saves json file Remove autosave on quit
This commit is contained in:
parent
5fb9ca7cc0
commit
954eec754c
14 changed files with 61 additions and 18 deletions
|
|
@ -71,10 +71,12 @@ void ItemStore::clear()
|
|||
|
||||
void ItemStore::itemStateChanged(const ItemData& item)
|
||||
{
|
||||
|
||||
for(unsigned i = 0; i < items_.size(); i++ )
|
||||
{
|
||||
if(items_[i]->operator==(item))
|
||||
{
|
||||
|
||||
if(items_[i]->getValue() != item.getValue())items_[i]->informValue(item.getValue());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "poweritem.h"
|
||||
#include <QProcess>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
|
||||
PowerItem::PowerItem(uint32_t itemIdIn, QString name, uint8_t value, QObject* parent): Item(itemIdIn, name, value, parent)
|
||||
{
|
||||
|
|
@ -10,6 +11,7 @@ PowerItem::PowerItem(uint32_t itemIdIn, QString name, uint8_t value, QObject* p
|
|||
|
||||
void PowerItem::setValue(uint8_t value)
|
||||
{
|
||||
qDebug()<<"shutdown";
|
||||
Item::setValue(value);
|
||||
if(!value)
|
||||
{
|
||||
|
|
@ -20,6 +22,7 @@ void PowerItem::setValue(uint8_t value)
|
|||
|
||||
void PowerItem::timeout()
|
||||
{
|
||||
qDebug()<<"shutdown timeout";
|
||||
QProcess::startDetached("syncoff");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ Microcontroller* Relay::micro_ = nullptr;
|
|||
Relay::Relay(uint8_t id, QString name, uint16_t address, bool state, QObject* parent): Item(0, name, state, parent), id_(id), address_(address)
|
||||
{
|
||||
itemId_ = address | ((uint32_t)id << 16);
|
||||
qDebug()<<"Relay "<<id_<<"Name "<<name<<" id "<<itemId_<<" state "<<state<<" addr: "<<address;
|
||||
}
|
||||
|
||||
void Relay::setValue(uint8_t value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue