Sensors now work over broadcast pipe
Added Polynomal actor Added Item adding dialog Added Factor Actor
This commit is contained in:
parent
f6aaebafc6
commit
772d21a982
63 changed files with 1450 additions and 225 deletions
|
|
@ -22,16 +22,15 @@ void Regulator::sensorEvent(Sensor sensor)
|
|||
if(active && sensor == sensor_)
|
||||
{
|
||||
qDebug()<<"got sensor: "<<sensor.type<<" "<<sensor.id<<" want: "<<sensor_.type<<" "<<sensor_.id;
|
||||
if( sensor.field < setPoint_-band_ && (sensor.field < sensor_.field || sensor_.field > setPoint_-band_) )
|
||||
if( sensor.field < setPoint_-band_ && (sensor.field < sensor_.field || sensor_.field > setPoint_-band_ || first) )
|
||||
{
|
||||
trigger();
|
||||
sigValue(triggerValue);
|
||||
}
|
||||
else if( sensor.field > setPoint_+band_ && (sensor.field > sensor_.field || sensor_.field < setPoint_+band_) )
|
||||
else if( sensor.field > setPoint_+band_ && (sensor.field > sensor_.field || sensor_.field < setPoint_+band_ || first) )
|
||||
{
|
||||
trigger();
|
||||
sigValue(!triggerValue);
|
||||
}
|
||||
first = false;
|
||||
sensor_ = sensor;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,9 +62,9 @@ void Regulator::store(QJsonObject& json)
|
|||
json["SensorName"] = sensor_.name;
|
||||
}
|
||||
|
||||
void Regulator::load(const QJsonObject& json)
|
||||
void Regulator::load(const QJsonObject& json, bool preserve)
|
||||
{
|
||||
Actor::load(json);
|
||||
Actor::load(json, preserve);
|
||||
band_ = json["Band"].toInt(1);
|
||||
setPoint_ = json["SetPoint"].toInt(22);
|
||||
sensor_.type = json["SensorType"].toInt(0);
|
||||
|
|
@ -74,9 +73,9 @@ void Regulator::load(const QJsonObject& json)
|
|||
sensor_.name = json["SensorName"].toString("Sensor");
|
||||
}
|
||||
|
||||
QString Regulator::getName()
|
||||
QString Regulator::getName() const
|
||||
{
|
||||
if(name.size() > 0) return name;
|
||||
if(name_.size() > 0) return name_;
|
||||
else
|
||||
{
|
||||
QString string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue