mirror of
https://github.com/thunderbug1/Spherebot-Host-GUI.git
synced 2026-03-24 02:36:50 +01:00
rxthread
outsourced the receiving to a seperate thread. This allows us to use much lower baudrates but still have a responsive UI. Set Baudrate to 57600 baud
This commit is contained in:
27
Spherebot_UI/rxthread.cpp
Normal file
27
Spherebot_UI/rxthread.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "rxthread.h"
|
||||
|
||||
rxThread::rxThread(spherebot *uibot)
|
||||
{
|
||||
bot = uibot;
|
||||
}
|
||||
|
||||
rxThread::~rxThread()
|
||||
{
|
||||
|
||||
}
|
||||
void rxThread::receiveData()
|
||||
{
|
||||
if(bot->port->canReadLine())
|
||||
{
|
||||
line = bot->port->readLine(1024);
|
||||
line.chop(1);
|
||||
qDebug()<<"receiving: " << line << endl;/////////////////////////////
|
||||
emit lineReceived(line);
|
||||
}
|
||||
}
|
||||
|
||||
void rxThread::run()
|
||||
{
|
||||
qDebug()<<"start Receiver";
|
||||
line = "";
|
||||
}
|
||||
Reference in New Issue
Block a user