mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Сделал выдачу tasksFIM.xml из сервера по запросу GUI-клиента
This commit is contained in:
@@ -179,6 +179,25 @@ void DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id, void
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DataParser::createQueryTasksXMLMessage(QString type)
|
||||||
|
{
|
||||||
|
QFile file(tempName);
|
||||||
|
file.open(QIODevice::WriteOnly);
|
||||||
|
QXmlStreamWriter xmlWriter(&file);
|
||||||
|
|
||||||
|
xmlWriter.setAutoFormatting(true);
|
||||||
|
xmlWriter.writeStartDocument();
|
||||||
|
xmlWriter.writeStartElement("QueryTasksXML");
|
||||||
|
|
||||||
|
xmlWriter.writeAttribute("Type", type);
|
||||||
|
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
void DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
void DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
||||||
{
|
{
|
||||||
QFile file(tempName);
|
QFile file(tempName);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public:
|
|||||||
void createAuthMessage(ClientAutorization *auth);
|
void createAuthMessage(ClientAutorization *auth);
|
||||||
void createToClientMessage(ToClientMessage *toClientMessage);
|
void createToClientMessage(ToClientMessage *toClientMessage);
|
||||||
void createQueryToDBMessage(ClientQueryToDB *queryToDB, int id = 0, void* data = nullptr);
|
void createQueryToDBMessage(ClientQueryToDB *queryToDB, int id = 0, void* data = nullptr);
|
||||||
|
void createQueryTasksXMLMessage(QString type);
|
||||||
void createDeAuthMessage(ClientDeAutorization *deAuth);
|
void createDeAuthMessage(ClientDeAutorization *deAuth);
|
||||||
void createAuthData(ServerAuthorization *serverAuth);
|
void createAuthData(ServerAuthorization *serverAuth);
|
||||||
void createAuthDataOffline(QString username,QString pass);
|
void createAuthDataOffline(QString username,QString pass);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
#include "instructor.h"
|
#include "instructor.h"
|
||||||
|
#include "tasksAmmFim.h"
|
||||||
|
#include "fimtaskswidget.h"
|
||||||
|
|
||||||
|
|
||||||
RecognizeSystem::RecognizeSystem(QObject *parent):
|
RecognizeSystem::RecognizeSystem(QObject *parent):
|
||||||
@@ -276,6 +278,22 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
|
|||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//xml-ответы на запросы AdditionalFiles
|
||||||
|
if(packetType == PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_FIM ||
|
||||||
|
packetType == PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_AMM)
|
||||||
|
{
|
||||||
|
QByteArray array;
|
||||||
|
stream.startTransaction();
|
||||||
|
stream >> array;
|
||||||
|
|
||||||
|
if(!stream.commitTransaction())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
xmlParserQueryTasksXML(packetType, array);
|
||||||
|
|
||||||
|
packetType = PacketType::TYPE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
packetType = PacketType::TYPE_NONE;
|
packetType = PacketType::TYPE_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -547,6 +565,19 @@ void RecognizeSystem::xmlParserQueryToDB(PacketType packetType, QByteArray array
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RecognizeSystem::xmlParserQueryTasksXML(PacketType packetType, QByteArray array)
|
||||||
|
{
|
||||||
|
QList<TaskAmmFim> listTaskAmmFim;
|
||||||
|
|
||||||
|
//парсинг XML
|
||||||
|
listTaskAmmFim = FIMtasksWidget::loadTasksAmmFimFromXML(array);
|
||||||
|
|
||||||
|
if(packetType == TYPE_XMLANSWER_QUERY_TASKS_XML_FIM)
|
||||||
|
emit sigAnswerQueryTasksXML_FIM(listTaskAmmFim);
|
||||||
|
else if(packetType == TYPE_XMLANSWER_QUERY_TASKS_XML_AMM)
|
||||||
|
emit sigAnswerQueryTasksXML_AMM(listTaskAmmFim);
|
||||||
|
}
|
||||||
|
|
||||||
void RecognizeSystem::checkAccessType(QString type)
|
void RecognizeSystem::checkAccessType(QString type)
|
||||||
{
|
{
|
||||||
if(type == "instructor")
|
if(type == "instructor")
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "trainee.h"
|
#include "trainee.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "Datas.h"
|
#include "Datas.h"
|
||||||
|
#include "tasksAmmFim.h"
|
||||||
|
|
||||||
|
|
||||||
class RecognizeSystem : public QObject
|
class RecognizeSystem : public QObject
|
||||||
@@ -48,6 +49,9 @@ signals:
|
|||||||
void sigAnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
void sigAnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
||||||
void sigAnswerQueryToDB_ListTasks(QList<Task> listTasks);
|
void sigAnswerQueryToDB_ListTasks(QList<Task> listTasks);
|
||||||
|
|
||||||
|
void sigAnswerQueryTasksXML_FIM(QList<TaskAmmFim> listTaskFim);
|
||||||
|
void sigAnswerQueryTasksXML_AMM(QList<TaskAmmFim> listTaskAmm);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QString> *folderList;
|
QList<QString> *folderList;
|
||||||
//MainWindow *mainWindow;
|
//MainWindow *mainWindow;
|
||||||
@@ -63,6 +67,7 @@ private:
|
|||||||
|
|
||||||
void xmlParser(QByteArray array);
|
void xmlParser(QByteArray array);
|
||||||
void xmlParserQueryToDB(PacketType packetType, QByteArray array);
|
void xmlParserQueryToDB(PacketType packetType, QByteArray array);
|
||||||
|
void xmlParserQueryTasksXML(PacketType packetType, QByteArray array);
|
||||||
|
|
||||||
void checkAccessType(QString type);
|
void checkAccessType(QString type);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ enum PacketType{
|
|||||||
TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES = 102,
|
TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES = 102,
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS = 103,
|
TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS = 103,
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_TASKS = 105
|
TYPE_XMLANSWER_QUERY_DB__LIST_TASKS = 105,
|
||||||
|
|
||||||
|
//xml-ответы на запросы AdditionalFiles
|
||||||
|
TYPE_XMLANSWER_QUERY_TASKS_XML_FIM = 130,
|
||||||
|
TYPE_XMLANSWER_QUERY_TASKS_XML_AMM = 131
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(PacketType)
|
Q_DECLARE_METATYPE(PacketType)
|
||||||
|
|||||||
@@ -80,11 +80,34 @@ bool ConnectorToServer::sendMessageForClient(int id, QString login, QString text
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ConnectorToServer::sendQueryTasksXML(QString type)
|
||||||
|
{
|
||||||
|
if (!client->getIsConnected())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
dataParser->createQueryTasksXMLMessage(type);
|
||||||
|
emit signal_sendXMLmsgGUItoServer();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void ConnectorToServer::SetConnectToServer()
|
void ConnectorToServer::SetConnectToServer()
|
||||||
{
|
{
|
||||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<TaskAmmFim> ConnectorToServer::getListTaskFim()
|
||||||
|
{
|
||||||
|
return listTaskFim;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<TaskAmmFim> ConnectorToServer::getListTaskAmm()
|
||||||
|
{
|
||||||
|
return listTaskAmm;
|
||||||
|
}
|
||||||
|
|
||||||
QList<Instructor> ConnectorToServer::getListInstructors()
|
QList<Instructor> ConnectorToServer::getListInstructors()
|
||||||
{
|
{
|
||||||
return listInstructors;
|
return listInstructors;
|
||||||
@@ -274,6 +297,18 @@ void ConnectorToServer::slot_AnswerQueryToDB_ListTasks(QList<Task> listTasks)
|
|||||||
//emit signal_UpdateDB(false, true);
|
//emit signal_UpdateDB(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConnectorToServer::slot_AnswerQueryTasksXML_FIM(QList<TaskAmmFim> listTaskFim)
|
||||||
|
{
|
||||||
|
this->listTaskFim = listTaskFim;
|
||||||
|
emit signal_UpdateTasksFIM();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnectorToServer::slot_AnswerQueryTasksXML_AMM(QList<TaskAmmFim> listTaskAmm)
|
||||||
|
{
|
||||||
|
this->listTaskAmm = listTaskAmm;
|
||||||
|
emit signal_UpdateTasksAMM();
|
||||||
|
}
|
||||||
|
|
||||||
void ConnectorToServer::slot_msgToClientReady(QString login, QString text)
|
void ConnectorToServer::slot_msgToClientReady(QString login, QString text)
|
||||||
{
|
{
|
||||||
int id = getIdTraineeByLogin(login);
|
int id = getIdTraineeByLogin(login);
|
||||||
@@ -310,6 +345,9 @@ void ConnectorToServer::bindConnection()
|
|||||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListClassrooms,this,&ConnectorToServer::slot_AnswerQueryToDB_ListClassrooms);
|
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListClassrooms,this,&ConnectorToServer::slot_AnswerQueryToDB_ListClassrooms);
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListTasks,this,&ConnectorToServer::slot_AnswerQueryToDB_ListTasks);
|
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListTasks,this,&ConnectorToServer::slot_AnswerQueryToDB_ListTasks);
|
||||||
|
|
||||||
|
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_FIM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_FIM);
|
||||||
|
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_AMM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_AMM);
|
||||||
|
|
||||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer);
|
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,14 @@ public:
|
|||||||
bool sendQueryToDB(TypeQueryToDB typeQuery, int id = 0, void* data = nullptr);
|
bool sendQueryToDB(TypeQueryToDB typeQuery, int id = 0, void* data = nullptr);
|
||||||
bool sendMessageForClient(int id, QString login, QString text);
|
bool sendMessageForClient(int id, QString login, QString text);
|
||||||
|
|
||||||
|
bool sendQueryTasksXML(QString type);
|
||||||
|
|
||||||
void SetConnectToServer();
|
void SetConnectToServer();
|
||||||
|
|
||||||
|
public:
|
||||||
|
QList<TaskAmmFim> getListTaskFim();
|
||||||
|
QList<TaskAmmFim> getListTaskAmm();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//Запросы к БД (локальной)
|
//Запросы к БД (локальной)
|
||||||
QList<Instructor> getListInstructors();
|
QList<Instructor> getListInstructors();
|
||||||
@@ -61,6 +67,9 @@ public slots:
|
|||||||
void slot_AnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
void slot_AnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
||||||
void slot_AnswerQueryToDB_ListTasks(QList<Task> listTasks);
|
void slot_AnswerQueryToDB_ListTasks(QList<Task> listTasks);
|
||||||
|
|
||||||
|
void slot_AnswerQueryTasksXML_FIM(QList<TaskAmmFim> listTaskFim);
|
||||||
|
void slot_AnswerQueryTasksXML_AMM(QList<TaskAmmFim> listTaskAmm);
|
||||||
|
|
||||||
void slot_msgToClientReady(QString login, QString text);
|
void slot_msgToClientReady(QString login, QString text);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -76,6 +85,9 @@ signals:
|
|||||||
|
|
||||||
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
||||||
|
|
||||||
|
void signal_UpdateTasksFIM();
|
||||||
|
void signal_UpdateTasksAMM();
|
||||||
|
|
||||||
void signal_ConnectedToServer(bool state);
|
void signal_ConnectedToServer(bool state);
|
||||||
|
|
||||||
void signal_InitMessanger(QList<Trainee> listTrainees);
|
void signal_InitMessanger(QList<Trainee> listTrainees);
|
||||||
@@ -102,6 +114,9 @@ private:
|
|||||||
QList<Computer> listComputers;
|
QList<Computer> listComputers;
|
||||||
QList<Classroom> listClassrooms;
|
QList<Classroom> listClassrooms;
|
||||||
QList<Task> listTasks;
|
QList<Task> listTasks;
|
||||||
|
|
||||||
|
QList<TaskAmmFim> listTaskFim;
|
||||||
|
QList<TaskAmmFim> listTaskAmm;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONNECTORTOSERVER_H
|
#endif // CONNECTORTOSERVER_H
|
||||||
|
|||||||
@@ -62,6 +62,19 @@ void DocTasksWidget::on_treeWidget_currentItemChanged(QTreeWidgetItem *current,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DocTasksWidget::slot_NeedUpdateUI()
|
||||||
|
{
|
||||||
|
loadTasksAMM();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DocTasksWidget::loadTasksAMM()
|
||||||
|
{
|
||||||
|
//Обновление дерева
|
||||||
|
treeWidget->clear();
|
||||||
|
|
||||||
|
//TODO собственно обновление дерева
|
||||||
|
}
|
||||||
|
|
||||||
void DocTasksWidget::domElementParser(QDomElement element, Module* moduleParent)
|
void DocTasksWidget::domElementParser(QDomElement element, Module* moduleParent)
|
||||||
{
|
{
|
||||||
QString name;
|
QString name;
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ public:
|
|||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
//Слот обработки сигнала необходимости обновления интерфейса
|
||||||
|
void slot_NeedUpdateUI();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void domElementParser(QDomElement element, Module* moduleParent);
|
void domElementParser(QDomElement element, Module* moduleParent);
|
||||||
void loadDocTasksFromXML();
|
void loadDocTasksFromXML();
|
||||||
@@ -38,11 +42,14 @@ private:
|
|||||||
void updateTreeWidget();
|
void updateTreeWidget();
|
||||||
void addModuleToTreeWidget(Module* module, QTreeWidgetItem* parentItem = nullptr);
|
void addModuleToTreeWidget(Module* module, QTreeWidgetItem* parentItem = nullptr);
|
||||||
|
|
||||||
|
void loadTasksAMM();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DocTasksWidget *ui;
|
Ui::DocTasksWidget *ui;
|
||||||
QTreeWidget* treeWidget;
|
QTreeWidget* treeWidget;
|
||||||
|
|
||||||
QList<Module*> listAllModules;
|
QList<Module*> listAllModules;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DOCTASKSWIDGET_H
|
#endif // DOCTASKSWIDGET_H
|
||||||
|
|||||||
@@ -6,17 +6,18 @@
|
|||||||
#include "ui_fimtaskswidget.h"
|
#include "ui_fimtaskswidget.h"
|
||||||
#include "tasksAmmFim.h"
|
#include "tasksAmmFim.h"
|
||||||
|
|
||||||
FIMtasksWidget::FIMtasksWidget(QWidget *parent) :
|
FIMtasksWidget::FIMtasksWidget(ConnectorToServer* connectorToServer, QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::FIMtasksWidget)
|
ui(new Ui::FIMtasksWidget),
|
||||||
|
connectorToServer(connectorToServer)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
loadTasksAmmFimFromXML();
|
//loadTasksAmmFimFromXML();
|
||||||
|
|
||||||
preparationTreeWidget();
|
preparationTreeWidget();
|
||||||
|
|
||||||
fillTree();
|
//fillTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
FIMtasksWidget::~FIMtasksWidget()
|
FIMtasksWidget::~FIMtasksWidget()
|
||||||
@@ -24,92 +25,86 @@ FIMtasksWidget::~FIMtasksWidget()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FIMtasksWidget::loadTasksAmmFimFromXML()
|
QList<TaskAmmFim> FIMtasksWidget::loadTasksAmmFimFromXML(QByteArray array)
|
||||||
{
|
{
|
||||||
|
QList<TaskAmmFim> listTaskAmmFim;
|
||||||
|
|
||||||
QDomDocument docTasksDOM;
|
QDomDocument docTasksDOM;
|
||||||
QString xmlFileName = "./tasksFIM.xml";
|
|
||||||
QFile xmlInFile(xmlFileName);
|
|
||||||
if (!xmlInFile.open(QFile::ReadOnly | QFile::Text))
|
|
||||||
{
|
|
||||||
QMessageBox::critical(nullptr, tr("Attention!"), tr("The file could not be opened ") + xmlFileName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
docTasksDOM.setContent(xmlInFile.readAll());
|
|
||||||
xmlInFile.close();
|
|
||||||
|
|
||||||
QDomElement RRJTasksElement = docTasksDOM.firstChildElement("RRJTasks");
|
docTasksDOM.setContent(array);
|
||||||
if(RRJTasksElement.isNull())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QDomElement taskElement = RRJTasksElement.firstChildElement();
|
QDomElement RRJTasksElement = docTasksDOM.firstChildElement("RRJTasks");
|
||||||
if(taskElement.isNull())
|
if(RRJTasksElement.isNull())
|
||||||
return;
|
return listTaskAmmFim;
|
||||||
|
|
||||||
do
|
QDomElement taskElement = RRJTasksElement.firstChildElement();
|
||||||
{/*task*/
|
if(taskElement.isNull())
|
||||||
QString name = taskElement.nodeName();
|
return listTaskAmmFim;
|
||||||
QDomNamedNodeMap nodeMap = taskElement.attributes();
|
|
||||||
|
|
||||||
if(name == "task")
|
do
|
||||||
|
{/*task*/
|
||||||
|
QString name = taskElement.nodeName();
|
||||||
|
QDomNamedNodeMap nodeMap = taskElement.attributes();
|
||||||
|
|
||||||
|
if(name == "task")
|
||||||
|
{
|
||||||
|
TaskAmmFim task;
|
||||||
|
|
||||||
|
task.initialize(nodeMap.namedItem("id").nodeValue().toInt(),
|
||||||
|
nodeMap.namedItem("type").nodeValue(),
|
||||||
|
nodeMap.namedItem("title").nodeValue(),
|
||||||
|
nodeMap.namedItem("status").nodeValue(),
|
||||||
|
nodeMap.namedItem("created").nodeValue(),
|
||||||
|
nodeMap.namedItem("changed").nodeValue());
|
||||||
|
|
||||||
|
QDomElement malfunctionElement = taskElement.firstChildElement();
|
||||||
|
if(!malfunctionElement.isNull())
|
||||||
{
|
{
|
||||||
TaskAmmFim task;
|
do
|
||||||
|
{/*malfunction*/
|
||||||
|
QString name = malfunctionElement.nodeName();
|
||||||
|
QDomNamedNodeMap nodeMap = malfunctionElement.attributes();
|
||||||
|
|
||||||
task.initialize(nodeMap.namedItem("id").nodeValue().toInt(),
|
if(name == "malfunction")
|
||||||
nodeMap.namedItem("type").nodeValue(),
|
{
|
||||||
nodeMap.namedItem("title").nodeValue(),
|
Malfunction malfunction;
|
||||||
nodeMap.namedItem("status").nodeValue(),
|
|
||||||
nodeMap.namedItem("created").nodeValue(),
|
|
||||||
nodeMap.namedItem("changed").nodeValue());
|
|
||||||
|
|
||||||
QDomElement malfunctionElement = taskElement.firstChildElement();
|
malfunction.initialize(nodeMap.namedItem("dmCode").nodeValue(),
|
||||||
if(!malfunctionElement.isNull())
|
nodeMap.namedItem("num").nodeValue(),
|
||||||
{
|
nodeMap.namedItem("description").nodeValue());
|
||||||
do
|
|
||||||
{/*malfunction*/
|
|
||||||
QString name = malfunctionElement.nodeName();
|
|
||||||
QDomNamedNodeMap nodeMap = malfunctionElement.attributes();
|
|
||||||
|
|
||||||
if(name == "malfunction")
|
QDomElement signElement = malfunctionElement.firstChildElement();
|
||||||
|
if(!signElement.isNull())
|
||||||
{
|
{
|
||||||
Malfunction malfunction;
|
do
|
||||||
|
{/*malfunctionSign*/
|
||||||
|
QString name = signElement.nodeName();
|
||||||
|
QDomNamedNodeMap nodeMap = signElement.attributes();
|
||||||
|
|
||||||
malfunction.initialize(nodeMap.namedItem("dmCode").nodeValue(),
|
if(name == "malfunctionSign")
|
||||||
nodeMap.namedItem("num").nodeValue(),
|
{
|
||||||
nodeMap.namedItem("description").nodeValue());
|
MalfunctionSign sign;
|
||||||
|
|
||||||
QDomElement signElement = malfunctionElement.firstChildElement();
|
sign.initialize(nodeMap.namedItem("type").nodeValue().toInt(),
|
||||||
if(!signElement.isNull())
|
nodeMap.namedItem("description").nodeValue());
|
||||||
{
|
|
||||||
do
|
|
||||||
{/*malfunctionSign*/
|
|
||||||
QString name = signElement.nodeName();
|
|
||||||
QDomNamedNodeMap nodeMap = signElement.attributes();
|
|
||||||
|
|
||||||
if(name == "malfunctionSign")
|
malfunction.addMalfunctionSign(sign);
|
||||||
{
|
}
|
||||||
MalfunctionSign sign;
|
|
||||||
|
|
||||||
sign.initialize(nodeMap.namedItem("type").nodeValue().toInt(),
|
}while(! (signElement = signElement.nextSiblingElement()).isNull());
|
||||||
nodeMap.namedItem("description").nodeValue());
|
|
||||||
|
|
||||||
malfunction.addMalfunctionSign(sign);
|
|
||||||
}
|
|
||||||
|
|
||||||
}while(! (signElement = signElement.nextSiblingElement()).isNull());
|
|
||||||
}
|
|
||||||
task.addMalfunction(malfunction);
|
|
||||||
}
|
}
|
||||||
}while(! (malfunctionElement = malfunctionElement.nextSiblingElement()).isNull());
|
task.addMalfunction(malfunction);
|
||||||
}
|
}
|
||||||
listTaskAmmFim.append(task);
|
}while(! (malfunctionElement = malfunctionElement.nextSiblingElement()).isNull());
|
||||||
}
|
}
|
||||||
}while (! (taskElement = taskElement.nextSiblingElement()).isNull());
|
listTaskAmmFim.append(task);
|
||||||
}
|
}
|
||||||
|
}while (! (taskElement = taskElement.nextSiblingElement()).isNull());
|
||||||
|
|
||||||
|
return listTaskAmmFim;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FIMtasksWidget::fillTree()
|
void FIMtasksWidget::fillTree(QList<TaskAmmFim> listTaskAmmFim)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < listTaskAmmFim.count(); i++)
|
for(int i = 0; i < listTaskAmmFim.count(); i++)
|
||||||
{/*Задачи*/
|
{/*Задачи*/
|
||||||
@@ -172,3 +167,22 @@ void FIMtasksWidget::reSetHeadTreeWidget()
|
|||||||
QStringList listHeaders = {tr("Title"), tr("ID")};
|
QStringList listHeaders = {tr("Title"), tr("ID")};
|
||||||
ui->treeWidget->setHeaderLabels(listHeaders);
|
ui->treeWidget->setHeaderLabels(listHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FIMtasksWidget::slot_NeedUpdateUI()
|
||||||
|
{
|
||||||
|
loadTasksFIM();
|
||||||
|
}
|
||||||
|
|
||||||
|
void FIMtasksWidget::loadTasksFIM()
|
||||||
|
{
|
||||||
|
//Обновление дерева
|
||||||
|
ui->treeWidget->clear();
|
||||||
|
|
||||||
|
//собственно обновление дерева
|
||||||
|
fillTree(connectorToServer->getListTaskFim());
|
||||||
|
}
|
||||||
|
|
||||||
|
void FIMtasksWidget::on_btnUpdateTasks_clicked()
|
||||||
|
{
|
||||||
|
connectorToServer->sendQueryTasksXML("fim");
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "tasksAmmFim.h"
|
#include "tasksAmmFim.h"
|
||||||
|
#include "connectortoserver.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class FIMtasksWidget;
|
class FIMtasksWidget;
|
||||||
@@ -19,22 +20,34 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FIMtasksWidget(QWidget *parent = nullptr);
|
explicit FIMtasksWidget(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
||||||
~FIMtasksWidget();
|
~FIMtasksWidget();
|
||||||
|
|
||||||
private:
|
public:
|
||||||
void loadTasksAmmFimFromXML();
|
static QList<TaskAmmFim> loadTasksAmmFimFromXML(QByteArray array);
|
||||||
void fillTree();
|
|
||||||
|
private:
|
||||||
|
void fillTree(QList<TaskAmmFim> listTaskAmmFim);
|
||||||
void preparationTreeWidget();
|
void preparationTreeWidget();
|
||||||
void reSetHeadTreeWidget();
|
void reSetHeadTreeWidget();
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
//Слот обработки сигнала необходимости обновления интерфейса
|
||||||
|
void slot_NeedUpdateUI();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void loadTasksFIM();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString userName;
|
QString userName;
|
||||||
QList<TaskAmmFim> listTaskAmmFim;
|
//QList<TaskAmmFim> listTaskAmmFim;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_btnUpdateTasks_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FIMtasksWidget *ui;
|
Ui::FIMtasksWidget *ui;
|
||||||
|
ConnectorToServer* connectorToServer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FIMTASKSWIDGET_H
|
#endif // FIMTASKSWIDGET_H
|
||||||
|
|||||||
@@ -22,6 +22,13 @@
|
|||||||
<string>FIM</string>
|
<string>FIM</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>List of tasks</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QTreeWidget" name="treeWidget">
|
<widget class="QTreeWidget" name="treeWidget">
|
||||||
<column>
|
<column>
|
||||||
@@ -31,12 +38,16 @@
|
|||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>List of tasks</string>
|
<widget class="QToolButton" name="btnUpdateTasks">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
qRegisterMetaType<QList<Classroom>>("QList<Classroom>");
|
qRegisterMetaType<QList<Classroom>>("QList<Classroom>");
|
||||||
qRegisterMetaType<QList<Task>>("QList<Task>");
|
qRegisterMetaType<QList<Task>>("QList<Task>");
|
||||||
|
|
||||||
|
qRegisterMetaType<QList<TaskAmmFim>>("QList<TaskAmmFim>");
|
||||||
|
|
||||||
connectorToServer = new ConnectorToServer(this);
|
connectorToServer = new ConnectorToServer(this);
|
||||||
connect(connectorToServer,&ConnectorToServer::sigLoginResult,this,&InstructorsAndTraineesWidget::checkLoginResult);
|
connect(connectorToServer,&ConnectorToServer::sigLoginResult,this,&InstructorsAndTraineesWidget::checkLoginResult);
|
||||||
connect(connectorToServer,&ConnectorToServer::sigDeLoginResult,this,&InstructorsAndTraineesWidget::checkDeLoginResult);
|
connect(connectorToServer,&ConnectorToServer::sigDeLoginResult,this,&InstructorsAndTraineesWidget::checkDeLoginResult);
|
||||||
@@ -55,7 +57,10 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
|
|
||||||
|
|
||||||
docTasksWidget = new DocTasksWidget(this);
|
docTasksWidget = new DocTasksWidget(this);
|
||||||
fIMtasksWidget = new FIMtasksWidget(this);
|
fIMtasksWidget = new FIMtasksWidget(connectorToServer, this);
|
||||||
|
|
||||||
|
connect(connectorToServer, &ConnectorToServer::signal_UpdateTasksFIM, fIMtasksWidget, &FIMtasksWidget::slot_NeedUpdateUI);
|
||||||
|
connect(connectorToServer, &ConnectorToServer::signal_UpdateTasksAMM, docTasksWidget, &DocTasksWidget::slot_NeedUpdateUI);
|
||||||
|
|
||||||
ui->horizontalLayout_3->addWidget(viewerTrainees);
|
ui->horizontalLayout_3->addWidget(viewerTrainees);
|
||||||
ui->horizontalLayout_3->addWidget(messangerWidget);
|
ui->horizontalLayout_3->addWidget(messangerWidget);
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ Q_DECLARE_METATYPE(QList<Computer>)
|
|||||||
Q_DECLARE_METATYPE(QList<Classroom>)
|
Q_DECLARE_METATYPE(QList<Classroom>)
|
||||||
Q_DECLARE_METATYPE(QList<Task>)
|
Q_DECLARE_METATYPE(QList<Task>)
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QList<TaskAmmFim>)
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class InstructorsAndTraineesWidget;
|
class InstructorsAndTraineesWidget;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ enum PacketType
|
|||||||
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_TASKS = 105,
|
TYPE_XMLANSWER_QUERY_DB__LIST_TASKS = 105,
|
||||||
|
|
||||||
|
//xml-ответы на запросы AdditionalFiles
|
||||||
|
TYPE_XMLANSWER_QUERY_TASKS_XML_FIM = 130,
|
||||||
|
TYPE_XMLANSWER_QUERY_TASKS_XML_AMM = 131,
|
||||||
|
|
||||||
//ответы по обновлениям
|
//ответы по обновлениям
|
||||||
HASH_READY = 150,
|
HASH_READY = 150,
|
||||||
CHANGE_DATA_VERSION = 151,
|
CHANGE_DATA_VERSION = 151,
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ public:
|
|||||||
TypeQueryToDB typeQuery;
|
TypeQueryToDB typeQuery;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ClientQueryTasksXML
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString Type;
|
||||||
|
};
|
||||||
|
|
||||||
class ServerMessage
|
class ServerMessage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ void ProcessParser::read(ClientHandler *client, QByteArray array)
|
|||||||
|
|
||||||
queryToDb(xmlReader,client);
|
queryToDb(xmlReader,client);
|
||||||
}
|
}
|
||||||
|
else if(xmlReader.name() == "QueryTasksXML")
|
||||||
|
{//Запрос файла XML с задачами
|
||||||
|
|
||||||
|
queryTasksXML(xmlReader,client);
|
||||||
|
}
|
||||||
else if(xmlReader.name() == "ClientMessage")
|
else if(xmlReader.name() == "ClientMessage")
|
||||||
{//Сообщение от клиента
|
{//Сообщение от клиента
|
||||||
|
|
||||||
@@ -223,6 +228,24 @@ void ProcessParser::queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client)
|
|||||||
processingSystem->processingClientQueryToDB(client, queryToDB, id, data);
|
processingSystem->processingClientQueryToDB(client, queryToDB, id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessParser::queryTasksXML(QXmlStreamReader &xmlReader, ClientHandler *client)
|
||||||
|
{
|
||||||
|
ClientQueryTasksXML clientQueryTasksXML;
|
||||||
|
|
||||||
|
/*Перебираем все атрибуты тега*/
|
||||||
|
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||||
|
{
|
||||||
|
QString name = attr.name().toString();
|
||||||
|
QString value = attr.value().toString();
|
||||||
|
//addTextToLogger(name + ": " + value);
|
||||||
|
|
||||||
|
if(name == "Type")
|
||||||
|
clientQueryTasksXML.Type = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
processingSystem->processingClientQueryTasksXML(client, clientQueryTasksXML);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessParser::clientMessage(QXmlStreamReader &xmlReader,ClientHandler *client)
|
void ProcessParser::clientMessage(QXmlStreamReader &xmlReader,ClientHandler *client)
|
||||||
{
|
{
|
||||||
ClientMessage clientMessage;
|
ClientMessage clientMessage;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ private:
|
|||||||
void clientDeAuth(QXmlStreamReader &xmlReader,ClientHandler *client);
|
void clientDeAuth(QXmlStreamReader &xmlReader,ClientHandler *client);
|
||||||
void toClientMessage(QXmlStreamReader &xmlReader,ClientHandler *client);
|
void toClientMessage(QXmlStreamReader &xmlReader,ClientHandler *client);
|
||||||
void queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client);
|
void queryToDb(QXmlStreamReader &xmlReader,ClientHandler *client);
|
||||||
|
void queryTasksXML(QXmlStreamReader &xmlReader,ClientHandler *client);
|
||||||
void clientMessage(QXmlStreamReader &xmlReader,ClientHandler *client);
|
void clientMessage(QXmlStreamReader &xmlReader,ClientHandler *client);
|
||||||
void clientNotify(QXmlStreamReader &xmlReader,ClientHandler *client);
|
void clientNotify(QXmlStreamReader &xmlReader,ClientHandler *client);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,10 +2,13 @@
|
|||||||
|
|
||||||
#include <clienthandler.h>
|
#include <clienthandler.h>
|
||||||
|
|
||||||
ProcessingSystem::ProcessingSystem(ProviderDBLMS* providerDBLMS, QObject *parent):
|
ProcessingSystem::ProcessingSystem(ProviderDBLMS* providerDBLMS, UpdateController* updateController, QObject *parent):
|
||||||
QObject(parent)
|
QObject(parent),
|
||||||
|
providerDBLMS(nullptr),
|
||||||
|
updateController(nullptr)
|
||||||
{
|
{
|
||||||
this->providerDBLMS = providerDBLMS;
|
this->providerDBLMS = providerDBLMS;
|
||||||
|
this->updateController = updateController;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessingSystem::initialize(ServerLMSWidget *server, DataParser *dataParser, CommonClientHandler *commonClientHandler,Logger *logger)
|
void ProcessingSystem::initialize(ServerLMSWidget *server, DataParser *dataParser, CommonClientHandler *commonClientHandler,Logger *logger)
|
||||||
@@ -226,6 +229,21 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
|
|||||||
//logger->addTextToLogger("To Client: " + str);
|
//logger->addTextToLogger("To Client: " + str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessingSystem::processingClientQueryTasksXML(ClientHandler *client, ClientQueryTasksXML clientQueryTasksXML)
|
||||||
|
{
|
||||||
|
QByteArray arrayAnswer;
|
||||||
|
|
||||||
|
QString nameFile = "";
|
||||||
|
if(clientQueryTasksXML.Type == "fim")
|
||||||
|
nameFile = tasksFIMfileName;
|
||||||
|
else if(clientQueryTasksXML.Type == "amm")
|
||||||
|
nameFile = tasksAMMfileName;
|
||||||
|
|
||||||
|
arrayAnswer = updateController->getAdditionalFile(nameFile);
|
||||||
|
|
||||||
|
client->sendXmlAnswer(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_FIM);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessingSystem::processingToClientMessage(ClientHandler *client, ToClientMessage toClientMessage)
|
void ProcessingSystem::processingToClientMessage(ClientHandler *client, ToClientMessage toClientMessage)
|
||||||
{
|
{
|
||||||
signal_msgToClientReady(toClientMessage.Login, toClientMessage.Text);
|
signal_msgToClientReady(toClientMessage.Login, toClientMessage.Text);
|
||||||
|
|||||||
@@ -21,12 +21,13 @@ class ProcessingSystem : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ProcessingSystem(ProviderDBLMS* providerDBLMS, QObject *parent = nullptr);
|
explicit ProcessingSystem(ProviderDBLMS* providerDBLMS, UpdateController* updateController, QObject *parent = nullptr);
|
||||||
|
|
||||||
void initialize(ServerLMSWidget *server,DataParser* dataParser,CommonClientHandler *commonClientServer,Logger *logger);
|
void initialize(ServerLMSWidget *server,DataParser* dataParser,CommonClientHandler *commonClientServer,Logger *logger);
|
||||||
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
|
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
|
||||||
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
|
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
|
||||||
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0, void* data = nullptr);
|
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0, void* data = nullptr);
|
||||||
|
void processingClientQueryTasksXML(ClientHandler *client, ClientQueryTasksXML clientQueryTasksXML);
|
||||||
void processingToClientMessage(ClientHandler *client, ToClientMessage toClientMessage);
|
void processingToClientMessage(ClientHandler *client, ToClientMessage toClientMessage);
|
||||||
|
|
||||||
void processingFromClientMessage(ClientHandler *client, ClientMessage clientMessage);
|
void processingFromClientMessage(ClientHandler *client, ClientMessage clientMessage);
|
||||||
@@ -46,6 +47,7 @@ private:
|
|||||||
DataParser *dataParser;
|
DataParser *dataParser;
|
||||||
//InstructorsAndTraineesWidget *pInstructorsAndTrainees;
|
//InstructorsAndTraineesWidget *pInstructorsAndTrainees;
|
||||||
ProviderDBLMS* providerDBLMS;
|
ProviderDBLMS* providerDBLMS;
|
||||||
|
UpdateController* updateController;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PROCESSINGSYSTEM_H
|
#endif // PROCESSINGSYSTEM_H
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
static const QString staticDataFolderName = "StaticData";
|
static const QString staticDataFolderName = "StaticData";
|
||||||
static const QString applicationFolderName = "Application";
|
static const QString applicationFolderName = "Application";
|
||||||
static const QString sharedDataFolderName = "SharedData";
|
static const QString sharedDataFolderName = "SharedData";
|
||||||
|
static const QString additionalFilesFolderName = "AdditionalFiles";
|
||||||
static const QString streamingAssetsFolderName = "StreamingAssets";
|
static const QString streamingAssetsFolderName = "StreamingAssets";
|
||||||
static const QString tempFile = staticDataFolderName + "/save.xml";
|
static const QString tempFile = staticDataFolderName + "/save.xml";
|
||||||
static const QString version = staticDataFolderName + "/version.xml";
|
static const QString version = staticDataFolderName + "/version.xml";
|
||||||
@@ -22,6 +23,8 @@ static const QString versionListFile = staticDataFolderName + "/versionList.xml"
|
|||||||
static const QString hashFileName = staticDataFolderName + "/serverHash.xml";
|
static const QString hashFileName = staticDataFolderName + "/serverHash.xml";
|
||||||
static const QString buildHashName = staticDataFolderName + "/buildHash.xml";
|
static const QString buildHashName = staticDataFolderName + "/buildHash.xml";
|
||||||
static const QString buildDataPath = "/Application/RRJLoader/RRJ_Data/";
|
static const QString buildDataPath = "/Application/RRJLoader/RRJ_Data/";
|
||||||
|
static const QString tasksAMMfileName = "/tasksAmm.xml";
|
||||||
|
static const QString tasksFIMfileName = "/tasksFIM.xml";
|
||||||
|
|
||||||
static const QString baseNameVersion = "base";//может вынести комманды куда нибудь?
|
static const QString baseNameVersion = "base";//может вынести комманды куда нибудь?
|
||||||
|
|
||||||
|
|||||||
@@ -355,6 +355,19 @@ QList<FileData>* UpdateController::calculateHash(QString path)
|
|||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray UpdateController::getAdditionalFile(QString name)
|
||||||
|
{
|
||||||
|
QString path = Tools::createSharedPath("/" + assetManager->getCurrentVersionData()->getViewName() + "/AdditionalFiles" + name);
|
||||||
|
QFile addFile(path);
|
||||||
|
QByteArray array;
|
||||||
|
if(addFile.open(QIODevice::ReadOnly)){
|
||||||
|
array = addFile.readAll();
|
||||||
|
addFile.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
QByteArray UpdateController::getLocalHash()
|
QByteArray UpdateController::getLocalHash()
|
||||||
{
|
{
|
||||||
QFile hashFile(hashFileName);
|
QFile hashFile(hashFileName);
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ public:
|
|||||||
void createVersionListXmlAnswer(QList<StreamingVersionData *> version);
|
void createVersionListXmlAnswer(QList<StreamingVersionData *> version);
|
||||||
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
||||||
void xmlFileDataParse(QByteArray array);
|
void xmlFileDataParse(QByteArray array);
|
||||||
|
|
||||||
|
QByteArray getAdditionalFile(QString name);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void changeAssetVersion(QString versionName);
|
void changeAssetVersion(QString versionName);
|
||||||
void createCopyVersion(QString versionName,QString newVersionName);
|
void createCopyVersion(QString versionName,QString newVersionName);
|
||||||
|
|||||||
@@ -54,14 +54,14 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
|||||||
assetsManager = new AssetsManager;
|
assetsManager = new AssetsManager;
|
||||||
assetsManager->moveToThread(updateThread);
|
assetsManager->moveToThread(updateThread);
|
||||||
|
|
||||||
processingSystem = new ProcessingSystem(providerDBLMS);
|
updateController = new UpdateController;
|
||||||
|
updateController->moveToThread(updateThread);
|
||||||
|
|
||||||
|
processingSystem = new ProcessingSystem(providerDBLMS, updateController);
|
||||||
processingSystem->moveToThread(updateThread);
|
processingSystem->moveToThread(updateThread);
|
||||||
|
|
||||||
dataParser = new DataParser(assetsManager,processingSystem);
|
dataParser = new DataParser(assetsManager,processingSystem);
|
||||||
|
|
||||||
updateController = new UpdateController;
|
|
||||||
updateController->moveToThread(updateThread);
|
|
||||||
|
|
||||||
commonClientHandler = new CommonClientHandler;
|
commonClientHandler = new CommonClientHandler;
|
||||||
|
|
||||||
loggerThread->start();
|
loggerThread->start();
|
||||||
|
|||||||
Reference in New Issue
Block a user