mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: send xml answer
This commit is contained in:
@@ -16,10 +16,17 @@ void MainWindow::Initialize()
|
||||
{
|
||||
|
||||
ui->settingsWidget->hide();
|
||||
updateControllerThread = new QThread;
|
||||
connectionThread = new QThread;
|
||||
|
||||
client = new TCPClient;
|
||||
client->moveToThread(connectionThread);
|
||||
|
||||
dataParser = new DataParser;
|
||||
|
||||
updateController = new UpdateController(dataParser);
|
||||
updateController->moveToThread(updateControllerThread);
|
||||
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
screenChecker = new ScreenChecker;
|
||||
externalExecuter = new ExternalExecuter;
|
||||
@@ -28,10 +35,22 @@ void MainWindow::Initialize()
|
||||
connect(recognizeSystem, &RecognizeSystem::LoadComplete,this,&MainWindow::LoadComplete);
|
||||
connect(recognizeSystem,&RecognizeSystem::onNeedUpdate,this,&MainWindow::SetNeedUpdate);
|
||||
connect(recognizeSystem, &RecognizeSystem::onSendDebugLog,this,&MainWindow::DebugLog);
|
||||
connect(recognizeSystem, &RecognizeSystem::SockedDisabled,this,&MainWindow::LostConnection);
|
||||
|
||||
connect(client,&TCPClient::onSendDebugLog,this,&MainWindow::DebugLog);
|
||||
|
||||
client->Initialize(updateController,recognizeSystem,externalExecuter);
|
||||
recognizeSystem->Initialize(updateController);
|
||||
connect(this,&MainWindow::onInitializeClient,client,&TCPClient::Initialize);
|
||||
connect(this,&MainWindow::onSetConnect,client,&TCPClient::SetConnect);
|
||||
connect(this,&MainWindow::onSendMessage,client,&TCPClient::MessageEntered);
|
||||
connect(this,&MainWindow::onCalculateHash,updateController,&UpdateController::CalculateHash);
|
||||
|
||||
connectionThread->start();
|
||||
updateControllerThread->start();
|
||||
|
||||
emit onCalculateHash();
|
||||
emit onInitializeClient(updateController,recognizeSystem,externalExecuter);
|
||||
|
||||
recognizeSystem->Initialize(updateController,dataParser);
|
||||
|
||||
screenChecker->Check();
|
||||
ui->disblayCount->setText(screenChecker->getScreenCount());
|
||||
@@ -41,7 +60,7 @@ void MainWindow::Initialize()
|
||||
maxBytesAvailable = 0;
|
||||
ui->loadingProgressBar->setValue(0);
|
||||
|
||||
client->SetConnect(dataParser->GetServerSettings());
|
||||
emit onSetConnect(dataParser->GetServerSettings());
|
||||
|
||||
}
|
||||
|
||||
@@ -68,20 +87,29 @@ void MainWindow::SetNeedUpdate(bool flag)
|
||||
ui->startButton->setEnabled(!flag);
|
||||
}
|
||||
|
||||
void MainWindow::LostConnection()
|
||||
{
|
||||
ui->loadingProgressBar->setValue(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_loginButton_clicked()
|
||||
{
|
||||
QString username = ui->loginInputField->text();
|
||||
QString password = ui->passwordInputField->text();
|
||||
|
||||
qDebug() << "Try login: " << username;
|
||||
qDebug() << "Try pass: " << password;
|
||||
ClientAutorization *autorization = new ClientAutorization;
|
||||
autorization->Login = username;
|
||||
autorization->Password = password;
|
||||
|
||||
dataParser->CreateAuthMessage(autorization);
|
||||
client->SendClientAutorization();
|
||||
}
|
||||
|
||||
void MainWindow::on_updateButton_clicked()
|
||||
{
|
||||
client->onMessageEntered("update");
|
||||
emit onSendMessage("update");
|
||||
ui->loadingProgressBar->setValue(0);
|
||||
}
|
||||
|
||||
@@ -100,7 +128,8 @@ void MainWindow::on_saveServerButton_clicked()
|
||||
QString port = ui->portInputField->text();
|
||||
|
||||
dataParser->CreateServerSettings(server,port);
|
||||
client->SetConnect(dataParser->GetServerSettings());
|
||||
|
||||
emit onSetConnect(dataParser->GetServerSettings());
|
||||
}
|
||||
|
||||
void MainWindow::on_settingsButton_clicked()
|
||||
@@ -122,11 +151,15 @@ void MainWindow::DebugLog(QString message)
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
connectionThread->quit();
|
||||
connectionThread->wait();
|
||||
|
||||
delete connectionThread;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_checkUpdate_clicked()
|
||||
{
|
||||
client->onMessageEntered("check");
|
||||
emit onSendMessage("check");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user