Sensors now work over broadcast pipe

Added Polynomal actor
Added Item adding dialog
Added Factor Actor
This commit is contained in:
2020-02-04 22:56:10 +01:00
parent f6aaebafc6
commit 772d21a982
63 changed files with 1450 additions and 225 deletions

View File

@ -4,6 +4,7 @@ AlarmTime::AlarmTime(const QDateTime time, QObject *parent) : Actor(parent), tim
{
connect(&timer, SIGNAL(timeout()), this, SLOT(doTick()));
timer.setInterval(1000);
run();
}
AlarmTime::~AlarmTime()
@ -26,9 +27,9 @@ void AlarmTime::makeActive()
run();
}
QString AlarmTime::getName()
QString AlarmTime::getName() const
{
if(name.size() > 0)return name;
if(name_.size() > 0)return name_;
else
{
QString string;
@ -111,6 +112,7 @@ void AlarmTime::doTick()
void AlarmTime::changeTime(const QDateTime& time)
{
time_=time;
qDebug()<<"time: "<<time_;
}
@ -122,9 +124,11 @@ void AlarmTime::store(QJsonObject& json)
json["Repeat"] = repeat_;
}
void AlarmTime::load(const QJsonObject& json)
void AlarmTime::load(const QJsonObject& json, const bool preserve)
{
Actor::load(json);
bool oldActive = isActive();
Actor::load(json, preserve);
time_ = QDateTime::fromString(json["Time"].toString(""));
repeat_ = json["Repeat"].toInt(REPEAT_NEVER);
if(oldActive != isActive()) setActive(isActive());
}