From 00bfa72455d098c58c199f74315b069bd3352bb0 Mon Sep 17 00:00:00 2001 From: uvos Date: Tue, 1 Feb 2022 22:57:46 +0100 Subject: [PATCH] acutally set value from micro line --- src/microcontroller.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/microcontroller.cpp b/src/microcontroller.cpp index a469106..039db20 100644 --- a/src/microcontroller.cpp +++ b/src/microcontroller.cpp @@ -105,7 +105,7 @@ std::shared_ptr Microcontroller::processTrainLine(const QString& buffer) QStringList bufferList = buffer.split(' '); if(bufferList.size() >= 14 && buffer.startsWith("TRAIN NUMBER:")) { - return std::shared_ptr(new Train(bufferList[2].toInt(), bufferList[4].toInt(), bufferList[13].toInt())); + return std::shared_ptr(new Train(bufferList[2].toInt(), bufferList[4].toInt(), bufferList[13].toInt(), bufferList[9].toInt())); } return nullptr; } @@ -113,9 +113,9 @@ std::shared_ptr Microcontroller::processTrainLine(const QString& buffer) std::shared_ptr 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(new Turnout(bufferList[2].toInt(), bufferList[2].toInt(), bufferList[6].toInt())); + return std::shared_ptr(new Turnout(bufferList[2].toInt(), bufferList[2].toInt(), bufferList[6].toInt(), bufferList[11].toInt())); } return nullptr; }