mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Merge branch 'add-versionController' into merge-task-and-verController
# Conflicts: # InstructorsAndTrainees/CMakeLists.txt # InstructorsAndTrainees/connectorToServer/Core/recognizesystem.h # InstructorsAndTrainees/instructorsandtraineeswidget.cpp # ServerLMS/Systems/updatecontroller.cpp # ServerLMS/Systems/updatecontroller.h
This commit is contained in:
@@ -7,7 +7,11 @@ ConnectorToServer::ConnectorToServer(QObject *parent) :
|
||||
client(nullptr),
|
||||
dataParser(nullptr),
|
||||
sendSystem(nullptr),
|
||||
recognizeSystem(nullptr)
|
||||
recognizeSystem(nullptr),
|
||||
versionSelectWidget(nullptr),
|
||||
versionContainer(nullptr),
|
||||
notifyController(nullptr),
|
||||
waitAnimationWidget(nullptr)
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
@@ -93,9 +97,15 @@ bool ConnectorToServer::sendQueryTasksXML(QString type)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConnectorToServer::setLoginName(QString name)
|
||||
{
|
||||
versionSelectWidget->setAuthor(name);
|
||||
}
|
||||
|
||||
void ConnectorToServer::SetConnectToServer()
|
||||
{
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
|
||||
}
|
||||
|
||||
QByteArray ConnectorToServer::getListTaskFimArray()
|
||||
@@ -249,6 +259,12 @@ int ConnectorToServer::getIdTraineeByLogin(QString login)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ConnectorToServer::showVersionSelect()
|
||||
{
|
||||
QByteArray answer = dataParser->xmlAnswer_notify(cmd_CheckVersionList);
|
||||
emit sigSendAnswerToServer(answer);
|
||||
}
|
||||
|
||||
/*
|
||||
void ConnectorToServer::slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
@@ -316,6 +332,11 @@ void ConnectorToServer::slot_msgToClientReady(QString login, QString text)
|
||||
sendMessageForClient(id, login, text);
|
||||
}
|
||||
|
||||
void ConnectorToServer::showServerList(QList<StreamingVersionData *> *serverList)
|
||||
{
|
||||
versionSelectWidget->fillView(serverList);
|
||||
}
|
||||
|
||||
void ConnectorToServer::initialize()
|
||||
{
|
||||
createObjects();
|
||||
@@ -325,6 +346,22 @@ void ConnectorToServer::initialize()
|
||||
emit sigInitializeClient(recognizeSystem,sendSystem,connectionThread);
|
||||
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
|
||||
// QByteArray answer = dataParser->xmlAnswer_notify()
|
||||
// sendSystem->sendXMLAnswer()
|
||||
|
||||
}
|
||||
|
||||
void ConnectorToServer::activateLoadAnimation(bool flag)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
waitAnimationWidget->showWithPlay();
|
||||
}
|
||||
else
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectorToServer::bindConnection()
|
||||
@@ -332,10 +369,13 @@ void ConnectorToServer::bindConnection()
|
||||
connect(this,&ConnectorToServer::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::signal_sendXMLmsgGUItoServer,sendSystem,&SendSystem::sendXMLmsgGUItoServer);
|
||||
connect(this,&ConnectorToServer::sigSendAnswerToServer,sendSystem,&SendSystem::sendXMLAnswer,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::sigLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_MessageForGUI,this,&ConnectorToServer::signal_msgFromClientReady);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigShowServerDataList,this,&ConnectorToServer::showServerList);
|
||||
connect (recognizeSystem,&RecognizeSystem::sigSetVersion,versionContainer,&VersionContainer::setServerVersionData);
|
||||
//connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB,this,&ConnectorToServer::slot_AnswerQueryToDB);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListInstructors,this,&ConnectorToServer::slot_AnswerQueryToDB_ListInstructors);
|
||||
@@ -347,8 +387,11 @@ void ConnectorToServer::bindConnection()
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_FIM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_FIM);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_AMM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_AMM);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnimationActivated,this,&ConnectorToServer::activateLoadAnimation,Qt::AutoConnection);
|
||||
|
||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer);
|
||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
||||
}
|
||||
|
||||
void ConnectorToServer::createObjects()
|
||||
@@ -360,12 +403,25 @@ void ConnectorToServer::createObjects()
|
||||
|
||||
dataParser = new DataParser;
|
||||
|
||||
waitAnimationWidget = new WaitAnimationWidget;
|
||||
|
||||
sendSystem = new SendSystem;
|
||||
sendSystem->moveToThread(connectionThread);
|
||||
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
recognizeSystem->moveToThread(connectionThread);
|
||||
|
||||
notifyController = new NotifyController;
|
||||
versionContainer = new VersionContainer;
|
||||
versionSelectWidget = new VersionSelectWidget;
|
||||
versionSelectWidget->initialize(sendSystem,versionContainer,notifyController);
|
||||
|
||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||
|
||||
waitAnimationWidget->setParent(versionSelectWidget);
|
||||
waitAnimationWidget->initialize(movie,versionSelectWidget);
|
||||
waitAnimationWidget->moveToThread(connectionThread);
|
||||
|
||||
connectionThread->start();
|
||||
connectionThread->setPriority(QThread::HighestPriority);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user