Sensors now work over broadcast pipe

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

View file

@ -131,7 +131,7 @@ std::shared_ptr<Relay> Microcontroller::processRelayLine(const QString& buffer)
if(name.size() > 1)name.remove(name.size()-1, 1);
else name = "Relay " + QString::number(bufferList[1].toInt(nullptr, 2));
qDebug()<<"Relay "<<bufferList[2].toInt()<<"Name "<<name<<" id "<<bufferList[4].toInt(nullptr, 2)<<" state "<<bufferList[6].toInt();
return std::shared_ptr<Relay>( new Relay(nullptr, this, bufferList[2].toInt(), name, bufferList[4].toInt(nullptr, 2), bufferList[6].toInt()));
return std::shared_ptr<Relay>( new Relay(this, bufferList[2].toInt(), name, bufferList[4].toInt(nullptr, 2), bufferList[6].toInt()));
}
return nullptr;
}
@ -160,10 +160,8 @@ void Microcontroller::processRelayState(const QString& buffer)
void Microcontroller::processSensorState(const QString& buffer)
{
QStringList bufferList = buffer.split(' ');
Sensor sensor(bufferList[2].toUInt(), bufferList[4].toUInt(), bufferList[6].toUInt());
if(sensor.type == Sensor::TYPE_HUMIDITY || sensor.type == Sensor::TYPE_TEMPERATURE) sensor.field = sensor.field/10;
if(bufferList.size() >= 7)gotSensorState(sensor);
Sensor sensor = Sensor::sensorFromString(buffer);
if(sensor.type != Sensor::TYPE_DUMMY) gotSensorState(sensor);
}