Sensors now work over broadcast pipe
Added Polynomal actor Added Item adding dialog Added Factor Actor
This commit is contained in:
@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user