mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
ref 2
This commit is contained in:
@@ -100,6 +100,7 @@ bool DocsUpdater::slot_updateDocsXML()
|
||||
}
|
||||
|
||||
emit signal_DocsChanged();
|
||||
emit signal_UpdateDocsCompleted();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ private:
|
||||
|
||||
signals:
|
||||
void signal_DocsChanged();
|
||||
void signal_UpdateDocsCompleted();
|
||||
|
||||
private:
|
||||
UpdateController* updateController;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "clienthandler.h"
|
||||
#include "recognizesystem.h"
|
||||
|
||||
#include <QThread>
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamAttribute>
|
||||
#include <QFile>
|
||||
#include <QThread>
|
||||
#include <QErrorMessage>
|
||||
|
||||
#include "serverlmswidget.h"
|
||||
#include "dialogsettingstray.h"
|
||||
@@ -33,16 +28,16 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
assetsManager(nullptr),
|
||||
docsUpdater(nullptr),
|
||||
cfiController(nullptr),
|
||||
first(true),
|
||||
language(languageENG),
|
||||
errorCode(0),
|
||||
stateVersionMaterials("..."),
|
||||
dbIsConnected(false),
|
||||
stateServer(EStateServer::stoped),
|
||||
stateBlockAutorization(EStateBlockAutorization::unblocked),
|
||||
state_VersionMaterials("..."),
|
||||
state_dbIsConnected(false),
|
||||
state_Server(EStateServer::stoped),
|
||||
state_BlockAutorization(EStateBlockAutorization::unblocked),
|
||||
flStartInitialization(false),
|
||||
flTryConnectionToDB(false),
|
||||
flNeedReconnectDB(false)
|
||||
flNeedReconnectDB(false),
|
||||
flTryUpdateDocs(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -63,55 +58,78 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||
waitAnimationWidget->setParent(this);
|
||||
waitAnimationWidget->initialize(movie,this);
|
||||
|
||||
updateStateOnlyVersionMaterials();
|
||||
}
|
||||
|
||||
ServerLMSWidget::~ServerLMSWidget()
|
||||
{
|
||||
if(flStartInitialization)
|
||||
{
|
||||
if(server)
|
||||
emit signal_StopServer();
|
||||
//server->stopServer();
|
||||
|
||||
if(updateThread)
|
||||
{
|
||||
updateThread->quit();
|
||||
updateThread->wait();
|
||||
delete updateThread;
|
||||
}
|
||||
|
||||
if(serverThread)
|
||||
{
|
||||
serverThread->quit();
|
||||
serverThread->wait();
|
||||
delete serverThread;
|
||||
}
|
||||
|
||||
if(server)
|
||||
delete server;
|
||||
if(commonClientHandler)
|
||||
delete commonClientHandler;
|
||||
if(dataParser)
|
||||
delete dataParser;
|
||||
if(processingSystem)
|
||||
delete processingSystem;
|
||||
if(updateController)
|
||||
delete updateController;
|
||||
if(cfiController)
|
||||
delete cfiController;
|
||||
if(docsUpdater)
|
||||
delete docsUpdater;
|
||||
if(assetsManager)
|
||||
delete assetsManager;
|
||||
if(chatSystem)
|
||||
delete chatSystem;
|
||||
|
||||
if(loggerThread)
|
||||
{
|
||||
loggerThread->quit();
|
||||
loggerThread->wait();
|
||||
delete loggerThread;
|
||||
|
||||
delete providerDBLMS;
|
||||
}
|
||||
|
||||
if(providerDBLMS)
|
||||
delete providerDBLMS;
|
||||
|
||||
|
||||
if(waitAnimationWidget)
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
delete waitAnimationWidget;
|
||||
}
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
//INTERFACE
|
||||
void ServerLMSWidget::start()
|
||||
void ServerLMSWidget::startInitialization()
|
||||
{
|
||||
startInitialization_step0();
|
||||
}
|
||||
|
||||
QString ServerLMSWidget::getLanguage()
|
||||
{
|
||||
return language;
|
||||
}
|
||||
|
||||
|
||||
//EVENT
|
||||
|
||||
@@ -122,6 +140,7 @@ void ServerLMSWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
ui->retranslateUi(this); // переведём окно заново
|
||||
|
||||
//И все состояния
|
||||
updateStateOnlyServer();
|
||||
updateStateOnlyDB();
|
||||
updateStateOnlyVersionMaterials();
|
||||
@@ -193,9 +212,9 @@ void ServerLMSWidget::initLanguageInterfase()
|
||||
|
||||
void ServerLMSWidget::updateStateOnlyServer()
|
||||
{
|
||||
if(stateServer == EStateServer::started)
|
||||
if(state_Server == EStateServer::started)
|
||||
{
|
||||
if(stateBlockAutorization == EStateBlockAutorization::unblocked)
|
||||
if(state_BlockAutorization == EStateBlockAutorization::unblocked)
|
||||
{
|
||||
ui->lblOnOffText->setText(tr("started"));
|
||||
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
@@ -212,18 +231,18 @@ void ServerLMSWidget::updateStateOnlyServer()
|
||||
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/stoped.png")));
|
||||
}
|
||||
|
||||
emit signal_updateStateServer(stateServer, stateBlockAutorization);
|
||||
emit signal_Tray_UpdateStateServer(state_Server, state_BlockAutorization);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::updateStateOnlyDB()
|
||||
{
|
||||
if(dbIsConnected)
|
||||
if(state_dbIsConnected)
|
||||
{
|
||||
//Настройки БД
|
||||
QString strDBsettings = tr("connected") + QString(" [%1 (%2) %3 : %4]").arg(dbSettings.dbName,
|
||||
dbSettings.dbType,
|
||||
dbSettings.dbHostName,
|
||||
QString::number(dbSettings.dbPort));
|
||||
QString strDBsettings = tr("connected") + QString(" [%1 (%2) %3 : %4]").arg(state_dbSettings.dbName,
|
||||
state_dbSettings.dbType,
|
||||
state_dbSettings.dbHostName,
|
||||
QString::number(state_dbSettings.dbPort));
|
||||
ui->lblDBsettings->setText(strDBsettings);
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
|
||||
}
|
||||
@@ -239,7 +258,7 @@ void ServerLMSWidget::updateStateOnlyDB()
|
||||
|
||||
void ServerLMSWidget::updateStateOnlyVersionMaterials()
|
||||
{
|
||||
ui->lblVersionText->setText(stateVersionMaterials);
|
||||
ui->lblVersionText->setText(state_VersionMaterials);
|
||||
}
|
||||
|
||||
|
||||
@@ -252,8 +271,6 @@ void ServerLMSWidget::slot_UpdateListClients(QStringList listFullName)
|
||||
|
||||
for (const QString clientFullName : listFullName)
|
||||
{
|
||||
//QString clientFullName = handler->getClient()->getFullName();
|
||||
|
||||
ui->listWidget_Clients->addItem(clientFullName);
|
||||
ui->listWidget_Clients->scrollToBottom();
|
||||
ui->listWidget_Clients->setCurrentRow(ui->listWidget_Clients->count() - 1);
|
||||
@@ -276,14 +293,14 @@ void ServerLMSWidget::slot_ErrorPostgreSQL(QString text)
|
||||
|
||||
void ServerLMSWidget::slot_StateConnectionToDB(bool dbIsConnected, DataBaseSettings dbSettings)
|
||||
{
|
||||
this->dbIsConnected = dbIsConnected;
|
||||
this->dbSettings = dbSettings;
|
||||
this->state_dbIsConnected = dbIsConnected;
|
||||
this->state_dbSettings = dbSettings;
|
||||
updateStateOnlyDB();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_StateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization)
|
||||
{
|
||||
if(this->stateServer != stateServer)
|
||||
if(this->state_Server != stateServer)
|
||||
{
|
||||
if(stateServer == EStateServer::started)
|
||||
{
|
||||
@@ -298,14 +315,14 @@ void ServerLMSWidget::slot_StateServer(EStateServer stateServer, EStateBlockAuto
|
||||
emit signal_Tray_ShowMessage(tr("Server is stoped!"));
|
||||
}
|
||||
}
|
||||
this->stateServer = stateServer;
|
||||
this->stateBlockAutorization = stateBlockAutorization;
|
||||
this->state_Server = stateServer;
|
||||
this->state_BlockAutorization = stateBlockAutorization;
|
||||
updateStateOnlyServer();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_StateVersionMaterials(QString versionStr)
|
||||
{
|
||||
this->stateVersionMaterials = versionStr;
|
||||
this->state_VersionMaterials = versionStr;
|
||||
updateStateOnlyVersionMaterials();
|
||||
}
|
||||
|
||||
@@ -329,6 +346,12 @@ void ServerLMSWidget::slot_ResultTryConnectDb(bool result)
|
||||
emit signal_Tray_ShowMessage(tr("Database connection OK!") + "\n" + strDBsettings);
|
||||
|
||||
on_btnStartServer_clicked();
|
||||
|
||||
if(flStartInitialization)
|
||||
{
|
||||
flStartInitialization = false;
|
||||
startInitialization_step3();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,10 +380,27 @@ void ServerLMSWidget::slot_ResultTryDisConnectDb(bool result)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ServerLMSWidget::slot_UpdateDocs()
|
||||
void ServerLMSWidget::slot_SetError(int code)
|
||||
{
|
||||
emit signal_updateDocsXML();
|
||||
if(code == 100)
|
||||
{
|
||||
QString textError = tr("No Client files found!") + "\n\n" +
|
||||
tr("* check Application for the presence of a folder with a build \n"
|
||||
"* check SharedData for a folder with the base version and the name base");
|
||||
|
||||
SpecMsgBox::CriticalClose(this, textError);
|
||||
}
|
||||
errorCode = code;
|
||||
emit signal_StartInitHasError(code);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_UpdateDocsCompleted()
|
||||
{
|
||||
if(flTryUpdateDocs)
|
||||
{
|
||||
flTryUpdateDocs = false;
|
||||
startInitialization_step2();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_UpdateControllerInitializeFinished()
|
||||
@@ -368,21 +408,16 @@ void ServerLMSWidget::slot_UpdateControllerInitializeFinished()
|
||||
startInitialization_step1();
|
||||
}
|
||||
|
||||
|
||||
void ServerLMSWidget::slot_BlockAutorizationIndicate(bool block, QString blocker, QString types)
|
||||
{
|
||||
if(block)
|
||||
{
|
||||
//server->blockAutorization();
|
||||
Logger::instance().log(QString("BLOCK from: %1").arg(blocker), LogLevel::INFO);
|
||||
//if(type != "")
|
||||
Logger::instance().log(QString("Blockers: %1").arg(types), LogLevel::DEBUG);
|
||||
}
|
||||
else
|
||||
{
|
||||
//server->unBlockAutorization();
|
||||
Logger::instance().log(QString("UNBLOCK from: %1").arg(blocker), LogLevel::INFO);
|
||||
//if(type != "")
|
||||
Logger::instance().log(QString("Blockers: %1").arg(types), LogLevel::DEBUG);
|
||||
}
|
||||
updateStateOnlyServer();
|
||||
@@ -402,39 +437,17 @@ void ServerLMSWidget::slot_LanguageChanged(QString language)
|
||||
void ServerLMSWidget::on_btnStartServer_clicked()
|
||||
{
|
||||
emit signal_StartServer();
|
||||
//if(server->startServer())
|
||||
{
|
||||
//QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
ui->btnStartServer->setEnabled(false);
|
||||
ui->btnStopServer->setEnabled(true);
|
||||
//slot_BlockAutorizationIndicate(false, "SERVER");
|
||||
|
||||
//updateStateOnlyServer();
|
||||
|
||||
//emit signal_Tray_ShowMessage(tr("Server is started!"));
|
||||
|
||||
//QApplication::restoreOverrideCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::on_btnStopServer_clicked()
|
||||
{
|
||||
emit signal_StopServer();
|
||||
//if(server->stopServer())
|
||||
{
|
||||
//QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
ui->btnStopServer->setEnabled(false);
|
||||
ui->btnStartServer->setEnabled(true);
|
||||
//slot_BlockAutorizationIndicate(true, "SERVER");
|
||||
|
||||
//updateStateOnlyServer();
|
||||
|
||||
//emit signal_Tray_ShowMessage(tr("Server is stoped!"));
|
||||
|
||||
//QApplication::restoreOverrideCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::on_btnSettings_clicked()
|
||||
@@ -450,10 +463,7 @@ void ServerLMSWidget::on_btnSettings_clicked()
|
||||
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
connect(&dlg, &DialogSettingsTray::signal_LanguageChanged, this, &ServerLMSWidget::slot_LanguageChanged);
|
||||
//connect(&dlg, &DialogSettingsTray::signal_UpdateStyleSheet, this, &ServerLMSWidget::slot_UpdateStyleSheet);
|
||||
|
||||
connect(&dlg, &DialogSettingsTray::signal_UpdateDocs, this, &ServerLMSWidget::slot_UpdateDocs);
|
||||
|
||||
connect(&dlg, &DialogSettingsTray::signal_UpdateDocs, docsUpdater, &DocsUpdater::slot_updateDocsXML);
|
||||
|
||||
switch( dlg.exec() )
|
||||
{
|
||||
@@ -465,17 +475,11 @@ void ServerLMSWidget::on_btnSettings_clicked()
|
||||
{
|
||||
on_btnStopServer_clicked();
|
||||
|
||||
//providerDBLMS->deAuthorizationAll();
|
||||
|
||||
//providerDBLMS->DisConnectionFromDB();
|
||||
|
||||
flNeedReconnectDB = true;
|
||||
flTryConnectionToDB = false;
|
||||
|
||||
emit signal_TryDisConnectionFromDB();
|
||||
|
||||
//updateStateOnlyDB();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -520,10 +524,12 @@ void ServerLMSWidget::startInitialization_step0()
|
||||
updateController = new UpdateController;
|
||||
updateController->moveToThread(updateThread);
|
||||
|
||||
docsUpdater = new DocsUpdater(updateController/*, this*/);
|
||||
docsUpdater = new DocsUpdater(updateController);
|
||||
docsUpdater->moveToThread(updateThread);
|
||||
|
||||
cfiController = new CfiController(updateController/*, this*/);
|
||||
connect(docsUpdater, &DocsUpdater::signal_UpdateDocsCompleted, this, &ServerLMSWidget::slot_UpdateDocsCompleted);
|
||||
|
||||
cfiController = new CfiController(updateController);
|
||||
cfiController->moveToThread(updateThread);
|
||||
|
||||
processingSystem = new ProcessingSystem(providerDBLMS, updateController, docsUpdater, cfiController);
|
||||
@@ -563,24 +569,31 @@ void ServerLMSWidget::startInitialization_step0()
|
||||
Logger::instance().setLoggingType(LoggingType::WIDGET);
|
||||
Logger::instance().setLogToFile(true);
|
||||
|
||||
connect(this, &ServerLMSWidget::sigUpdateControllerInitialize, updateController, &UpdateController::initialize);
|
||||
connect(this, &ServerLMSWidget::signal_UpdateControllerInitialize, updateController, &UpdateController::initialize);
|
||||
connect(updateController, &UpdateController::sigInitializeFinished, this, &ServerLMSWidget::slot_UpdateControllerInitializeFinished);
|
||||
connect(this, &ServerLMSWidget::sigCalculateFullHash, updateController, &UpdateController::calculateFullHash, Qt::AutoConnection);
|
||||
connect(updateController, &UpdateController::sigErrorRequired, this, &ServerLMSWidget::setError);
|
||||
connect(updateController, &UpdateController::sigUpdateDocs, this, &ServerLMSWidget::slot_UpdateDocs, Qt::AutoConnection);
|
||||
connect(updateController, &UpdateController::sigErrorRequired, this, &ServerLMSWidget::slot_SetError);
|
||||
connect(updateController, &UpdateController::sigUpdateDocs, docsUpdater, &DocsUpdater::slot_updateDocsXML, Qt::AutoConnection);
|
||||
connect(&Logger::instance(), &Logger::sigLogToWidget, this, &ServerLMSWidget::slot_AddMessageToLog, Qt::QueuedConnection);
|
||||
|
||||
connect(assetsManager, &AssetsManager::signal_setVersion, this, &ServerLMSWidget::slot_StateVersionMaterials);
|
||||
|
||||
connect(this, &ServerLMSWidget::signal_updateDocsXML, docsUpdater, &DocsUpdater::slot_updateDocsXML);
|
||||
connect(this, &ServerLMSWidget::signal_UpdateDocsXML, docsUpdater, &DocsUpdater::slot_updateDocsXML);
|
||||
|
||||
emit sigUpdateControllerInitialize(commonClientHandler, dataParser, assetsManager);
|
||||
emit signal_UpdateControllerInitialize(commonClientHandler, dataParser, assetsManager);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::startInitialization_step1()
|
||||
{
|
||||
if(errorCode == 100)
|
||||
return;
|
||||
|
||||
Logger::instance().log("Update docs.xml...");
|
||||
slot_UpdateDocs();
|
||||
flTryUpdateDocs = true;
|
||||
emit signal_UpdateDocsXML();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::startInitialization_step2()
|
||||
{
|
||||
Logger::instance().log("Update docs.xml completed!");
|
||||
|
||||
ui->btnStopServer->setEnabled(false);
|
||||
@@ -592,17 +605,15 @@ void ServerLMSWidget::startInitialization_step1()
|
||||
updateStateOnlyDB();
|
||||
updateStateOnlyVersionMaterials();
|
||||
|
||||
//QApplication::restoreOverrideCursor();
|
||||
|
||||
if(hasError() == 100)
|
||||
return;
|
||||
|
||||
Logger::instance().log("Try connection to DB...");
|
||||
tryConnectionToDB();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::startInitialization_step3()
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
emit signal_InitializeFinished();
|
||||
emit signal_StartInitFinished();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,35 +1,25 @@
|
||||
#ifndef SERVERLMSWIDGET_H
|
||||
#define SERVERLMSWIDGET_H
|
||||
|
||||
#include "ServerLMS_global.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QMap>
|
||||
#include <QTranslator>
|
||||
#include <QMutex>
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
#include <Systems/sendsystem.h>
|
||||
#include <Systems/processingsystem.h>
|
||||
#include <Systems/updatecontroller.h>
|
||||
#include <Systems/assetsmanager.h>
|
||||
#include <Systems/recognizesystem.h>
|
||||
#include <Systems/logger.h>
|
||||
#include <Systems/commonclienthandler.h>
|
||||
#include <Systems/assetsmanager.h>
|
||||
#include "ServerLMS_global.h"
|
||||
|
||||
#include <Data/typesDataServerClient.h>
|
||||
#include <Data/Client.h>
|
||||
#include "logger.h"
|
||||
#include "waitanimationwidget.h"
|
||||
#include "specialmessagebox.h"
|
||||
|
||||
#include "Parsers/dataparser.h"
|
||||
#include "processingsystem.h"
|
||||
#include "updatecontroller.h"
|
||||
#include "assetsmanager.h"
|
||||
#include "commonclienthandler.h"
|
||||
#include "assetsmanager.h"
|
||||
#include "multithreadserver.h"
|
||||
#include "providerdblms.h"
|
||||
#include "docsupdater.h"
|
||||
#include "waitanimationwidget.h"
|
||||
#include "specialmessagebox.h"
|
||||
#include "cficontroller.h"
|
||||
|
||||
|
||||
@@ -38,11 +28,9 @@ class ServerLMSWidget;
|
||||
}
|
||||
|
||||
class DataParser;
|
||||
class SendSystem;
|
||||
class ProcessingSystem;
|
||||
class Logger;
|
||||
class UpdateController;
|
||||
class RecognizeSystem;
|
||||
class ClientHandler;
|
||||
class MultiThreadServer;
|
||||
class AssetsManager;
|
||||
@@ -64,34 +52,31 @@ public:
|
||||
~ServerLMSWidget();
|
||||
|
||||
public:
|
||||
void start();
|
||||
void startInitialization();
|
||||
QString getLanguage();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent * event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
signals:
|
||||
//MAINWINDOW, ТРЕЙ
|
||||
//сигнал смены языка
|
||||
void signal_LanguageChanged(QString language);
|
||||
|
||||
//сигнал вывода сообщения из трея
|
||||
void signal_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
|
||||
|
||||
//синал обновления состояния сервера (иконка в трее)
|
||||
void signal_Tray_UpdateStateServer(EStateServer state_Server, EStateBlockAutorization state_BlockAutorization);
|
||||
//сигналы меню трея
|
||||
void signal_Menu_ShowWindow();
|
||||
void signal_Menu_HideWindow();
|
||||
//сигнал о наличии ошибок начальной инициализации
|
||||
void signal_StartInitHasError(int code);
|
||||
//сигнал об окончании начальной инициализации
|
||||
void signal_StartInitFinished();
|
||||
|
||||
void sigRecognize();
|
||||
void sigCalculateFullHash();
|
||||
void sigUpdateControllerInitialize(CommonClientHandler* commonClientHandler,DataParser *dataParser,AssetsManager *assetManager);
|
||||
|
||||
//void signal_DocsChanged();
|
||||
void signal_hasError(int code);
|
||||
|
||||
void signal_updateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization);
|
||||
|
||||
void signal_updateDocsXML();
|
||||
|
||||
void signal_InitializeFinished();
|
||||
void signal_UpdateControllerInitialize(CommonClientHandler* commonClientHandler,DataParser *dataParser,AssetsManager *assetManager);
|
||||
void signal_UpdateDocsXML();
|
||||
|
||||
void signal_TryConnectionToDB();
|
||||
void signal_TryDisConnectionFromDB();
|
||||
@@ -100,55 +85,23 @@ signals:
|
||||
void signal_StopServer();
|
||||
|
||||
public slots:
|
||||
//ИНДИКАЦИЯ
|
||||
void slot_LanguageChanged(QString language);
|
||||
void slot_UpdateListClients(QStringList listFullName);
|
||||
void slot_BlockAutorizationIndicate(bool block, QString blocker, QString types);
|
||||
void slot_AddMessageToLog(QString message);
|
||||
|
||||
void slot_ErrorPostgreSQL(QString text);
|
||||
void slot_StateConnectionToDB(bool dbIsConnected, DataBaseSettings dbSettings);
|
||||
void slot_StateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization);
|
||||
|
||||
void slot_UpdateDocs();
|
||||
void slot_StateConnectionToDB(bool state_dbIsConnected, DataBaseSettings state_dbSettings);
|
||||
void slot_StateServer(EStateServer state_Server, EStateBlockAutorization state_BlockAutorization);
|
||||
void slot_StateVersionMaterials(QString state_VersionMaterials);
|
||||
|
||||
void slot_UpdateControllerInitializeFinished();
|
||||
|
||||
void slot_StateVersionMaterials(QString stateVersionMaterials);
|
||||
void slot_UpdateDocsCompleted();
|
||||
|
||||
void slot_ResultTryConnectDb(bool result);
|
||||
void slot_ResultTryDisConnectDb(bool result);
|
||||
|
||||
public:
|
||||
QString getLanguage()
|
||||
{
|
||||
return language;
|
||||
}
|
||||
|
||||
void setError(int code)
|
||||
{
|
||||
if(code == 100)
|
||||
{
|
||||
QString textError = tr("No Client files found!") + "\n\n" +
|
||||
tr("* check Application for the presence of a folder with a build \n"
|
||||
"* check SharedData for a folder with the base version and the name base");
|
||||
|
||||
SpecMsgBox::CriticalClose(this, textError);
|
||||
}
|
||||
errorCode = code;
|
||||
emit signal_hasError(code);
|
||||
}
|
||||
|
||||
int hasError() const
|
||||
{
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
ProcessingSystem* getProcessingSystem()
|
||||
{
|
||||
return processingSystem;
|
||||
}
|
||||
|
||||
void removeClient(int socketId);
|
||||
void slot_SetError(int code);
|
||||
|
||||
private slots:
|
||||
void on_btnStartServer_clicked();
|
||||
@@ -168,6 +121,8 @@ private:
|
||||
private:
|
||||
void startInitialization_step0();
|
||||
void startInitialization_step1();
|
||||
void startInitialization_step2();
|
||||
void startInitialization_step3();
|
||||
void tryConnectionToDB();
|
||||
|
||||
private:
|
||||
@@ -192,22 +147,21 @@ private:
|
||||
DocsUpdater* docsUpdater; //updateThread
|
||||
CfiController* cfiController; //updateThread
|
||||
|
||||
bool first; // для тестов Unity
|
||||
|
||||
QTranslator qtLanguageTranslator;
|
||||
QString language;
|
||||
|
||||
int errorCode;
|
||||
|
||||
QString stateVersionMaterials;
|
||||
bool dbIsConnected;
|
||||
DataBaseSettings dbSettings;
|
||||
EStateServer stateServer;
|
||||
EStateBlockAutorization stateBlockAutorization;
|
||||
QString state_VersionMaterials;
|
||||
bool state_dbIsConnected;
|
||||
DataBaseSettings state_dbSettings;
|
||||
EStateServer state_Server;
|
||||
EStateBlockAutorization state_BlockAutorization;
|
||||
|
||||
bool flStartInitialization;
|
||||
bool flTryConnectionToDB;
|
||||
bool flNeedReconnectDB;
|
||||
bool flTryUpdateDocs;
|
||||
};
|
||||
|
||||
#endif // SERVERLMSWIDGET_H
|
||||
|
||||
@@ -22,10 +22,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
serverLMSWidget = new ServerLMSWidget(this);
|
||||
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_InitializeFinished, this, &MainWindow::slot_InitializeFinished);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_hasError, this, &MainWindow::slot_hasError);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_StartInitFinished, this, &MainWindow::slot_InitializeFinished);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_StartInitHasError, this, &MainWindow::slot_hasError);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_updateStateServer, this, &MainWindow::slot_updateStateServer);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_UpdateStateServer, this, &MainWindow::slot_updateStateServer);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_ShowMessage, this, &MainWindow::slot_Tray_ShowMessage);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_TrayMenu_ShowWindow);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow);
|
||||
@@ -188,7 +188,7 @@ void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAut
|
||||
|
||||
void MainWindow::slot_LazyInitialization()
|
||||
{
|
||||
serverLMSWidget->start();
|
||||
serverLMSWidget->startInitialization();
|
||||
}
|
||||
|
||||
void MainWindow::slot_hasError(int code)
|
||||
|
||||
Reference in New Issue
Block a user