Finish lerge refactor of systems

This commit is contained in:
Carl Philipp Klemm 2026-03-22 23:23:18 +01:00
parent 6d742e60db
commit 913d7df56d
36 changed files with 614 additions and 634 deletions

View file

@ -138,12 +138,10 @@ void Microcontroller::processList(const QString& buffer)
if(bufferList.size() >= 8 && buffer.startsWith("ITEM NUMBER:"))
{
relayList.push_back(processRelayLine(buffer));
qDebug()<<"Micro item recived:"<<relayList.back()->getName();
}
else if(buffer.contains("EOL"))
{
listMode = false;
qDebug()<<"got relay list " << relayList.size();
gotItems(relayList);
relayList.clear();
}
@ -158,13 +156,13 @@ void Microcontroller::processRelayState(const QString& buffer)
void Microcontroller::processSensorState(const QString& buffer)
{
Sensor sensor = Sensor::sensorFromString(buffer);
if(sensor.type != Sensor::TYPE_DUMMY) gotSensorState(sensor);
if(sensor.type != Sensor::TYPE_DUMMY)
gotSensorState(sensor);
}
void Microcontroller::processMicroReturn()
{
qDebug()<<_buffer;
if(listMode)
{
processList(_buffer);
@ -176,8 +174,14 @@ void Microcontroller::processMicroReturn()
listMode = true;
relayList.clear();
}
else if(_buffer.startsWith("ITEM NUMBER:"))processRelayState(_buffer);
else if(_buffer.startsWith("SENSOR")) processSensorState(_buffer);
else if(_buffer.startsWith("ITEM NUMBER:"))
{
processRelayState(_buffer);
}
else if(_buffer.startsWith("SENSOR"))
{
processSensorState(_buffer);
}
}
}
@ -188,8 +192,6 @@ void Microcontroller::isReadyRead()
while(_port->getChar(&charBuf))
{
_buffer.push_back(charBuf);
qDebug()<<_buffer;
if(_buffer.endsWith('\n') )
{
_buffer.remove('\n');