mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
ref: refactoring treads, check local update instructor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user