acutally set value from micro line

This commit is contained in:
uvos 2022-02-01 22:57:46 +01:00
parent ee1baab3f6
commit 00bfa72455

View File

@ -105,7 +105,7 @@ std::shared_ptr<Item> Microcontroller::processTrainLine(const QString& buffer)
QStringList bufferList = buffer.split(' ');
if(bufferList.size() >= 14 && buffer.startsWith("TRAIN NUMBER:"))
{
return std::shared_ptr<Item>(new Train(bufferList[2].toInt(), bufferList[4].toInt(), bufferList[13].toInt()));
return std::shared_ptr<Item>(new Train(bufferList[2].toInt(), bufferList[4].toInt(), bufferList[13].toInt(), bufferList[9].toInt()));
}
return nullptr;
}
@ -113,9 +113,9 @@ std::shared_ptr<Item> Microcontroller::processTrainLine(const QString& buffer)
std::shared_ptr<Item> Microcontroller::processTurnoutLine(const QString& buffer)
{
QStringList bufferList = buffer.split(' ');
if(bufferList.size() >= 7 && buffer.startsWith("TURNOUT NUMBER:"))
if(bufferList.size() >= 11 && buffer.startsWith("TURNOUT NUMBER:"))
{
return std::shared_ptr<Item>(new Turnout(bufferList[2].toInt(), bufferList[2].toInt(), bufferList[6].toInt()));
return std::shared_ptr<Item>(new Turnout(bufferList[2].toInt(), bufferList[2].toInt(), bufferList[6].toInt(), bufferList[11].toInt()));
}
return nullptr;
}