ref: refactoring treads, check local update instructor

This commit is contained in:
semenov
2024-12-17 17:22:33 +03:00
parent 7aeb9d8000
commit f7ca02444c
53 changed files with 2292 additions and 1558 deletions

View File

@@ -9,13 +9,16 @@ TCPClient::TCPClient(QObject *parent) :
{
}
void TCPClient::initialize(RecognizeSystem *recognize,ExternalExecuter *externalExecuter,SendSystem *sendSystem)
void TCPClient::initialize(MainWindow *mainWindow,RecognizeSystem *recognize,ExternalExecuter *externalExecuter,SendSystem *sendSystem)
{
this->recognizeSystem = recognize;
this->externalExecuter = externalExecuter;
this->sendSystem = sendSystem;
isConnected = false;
connect(this,&TCPClient::sigConnectionState,mainWindow,&MainWindow::slotConnectionState,Qt::AutoConnection);
connect(this,&TCPClient::sigServerDisconnect,mainWindow,&MainWindow::slotServerDisconnect);
emit sigSendDebugLog(Tools::getTime() + " Client started");
}
@@ -36,14 +39,10 @@ void TCPClient::setConnect(ServerSettings *serverSettings)
if (socket->waitForConnected(2000))
{
connect(socket,&QTcpSocket::readyRead,this,&TCPClient::slotReadyRead,Qt::DirectConnection);
connect(socket,&QTcpSocket::readyRead,this,&TCPClient::slotReadyRead,Qt::AutoConnection);
connect(socket,&QTcpSocket::disconnected,this,&TCPClient::setDisconnect);
//connect(socket,&QTcpSocket::connected,this,&TCPClient::slotConnectNotify);
connect(this,&TCPClient::sigRecognize,recognizeSystem,&RecognizeSystem::recognize,Qt::DirectConnection);
connect(this,&TCPClient::sigSetSocket,sendSystem,&SendSystem::setSocket);
emit sigSetSocket(socket);
sendSystem->setSocket(socket);
slotConnectNotify();
}
else
@@ -131,7 +130,7 @@ void TCPClient::slotReadyRead()
return;
}
emit sigRecognize(socket);
recognizeSystem->recognize(socket);
}
bool TCPClient::getIsConnected() const