acutally set value from micro line
This commit is contained in:
		
							parent
							
								
									ee1baab3f6
								
							
						
					
					
						commit
						00bfa72455
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -105,7 +105,7 @@ std::shared_ptr<Item> Microcontroller::processTrainLine(const QString& buffer)
 | 
				
			||||||
    QStringList bufferList = buffer.split(' ');
 | 
					    QStringList bufferList = buffer.split(' ');
 | 
				
			||||||
	if(bufferList.size() >= 14 && buffer.startsWith("TRAIN NUMBER:"))
 | 
						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;
 | 
					    return  nullptr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -113,9 +113,9 @@ std::shared_ptr<Item> Microcontroller::processTrainLine(const QString& buffer)
 | 
				
			||||||
std::shared_ptr<Item> Microcontroller::processTurnoutLine(const QString& buffer)
 | 
					std::shared_ptr<Item> Microcontroller::processTurnoutLine(const QString& buffer)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    QStringList bufferList = buffer.split(' ');
 | 
					    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;
 | 
					    return  nullptr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue