mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Merge branch 'work' into merge-task-and-verController
This commit is contained in:
@@ -26,6 +26,7 @@ add_library(DataBaseLMS SHARED
|
|||||||
classroom.h
|
classroom.h
|
||||||
tasksAmmFim.cpp
|
tasksAmmFim.cpp
|
||||||
tasksAmmFim.h
|
tasksAmmFim.h
|
||||||
|
typeQueryToDB.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(DataBaseLMS PRIVATE Qt5::Widgets)
|
target_link_libraries(DataBaseLMS PRIVATE Qt5::Widgets)
|
||||||
|
|||||||
@@ -426,12 +426,12 @@ int DataBaseLMS::insertGroup(Group group)
|
|||||||
return queryExecInt(queryStr);
|
return queryExecInt(queryStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DataBaseLMS::deleteGroup(int group_id)
|
int DataBaseLMS::deleteGroup(int id_group)
|
||||||
{
|
{
|
||||||
QString queryStr = QString("DELETE FROM public.groups "
|
QString queryStr = QString("DELETE FROM public.groups "
|
||||||
"WHERE group_id = %1 "
|
"WHERE group_id = %1 "
|
||||||
"RETURNING groups.group_id").arg(
|
"RETURNING groups.group_id").arg(
|
||||||
QString::number(group_id));
|
QString::number(id_group));
|
||||||
|
|
||||||
return queryExecInt(queryStr);
|
return queryExecInt(queryStr);
|
||||||
}
|
}
|
||||||
@@ -469,6 +469,47 @@ int DataBaseLMS::updateTaskAMM(TaskAmmFim task)
|
|||||||
return queryExecInt(queryStr);
|
return queryExecInt(queryStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DataBaseLMS::deleteTaskAMM(int id_task)
|
||||||
|
{
|
||||||
|
QString queryStr = QString("DELETE FROM public.tasks_amm "
|
||||||
|
"WHERE task_id = %1 "
|
||||||
|
"RETURNING tasks_amm.task_id").arg(
|
||||||
|
QString::number(id_task));
|
||||||
|
|
||||||
|
return queryExecInt(queryStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
int DataBaseLMS::insertTaskFIM(int id_trainee)
|
||||||
|
{
|
||||||
|
QString queryStr = QString("INSERT INTO public.tasks_fim (title, trainee_task) "
|
||||||
|
"VALUES (DEFAULT, %1) "
|
||||||
|
"RETURNING tasks_fim.task_id").arg(
|
||||||
|
QString::number(id_trainee));
|
||||||
|
|
||||||
|
return queryExecInt(queryStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
int DataBaseLMS::updateTaskFIM(TaskAmmFim task)
|
||||||
|
{
|
||||||
|
QString queryStr = QString("UPDATE public.tasks_fim SET title = '%1' "
|
||||||
|
"WHERE task_id = %2 "
|
||||||
|
"RETURNING tasks_fim.task_id").arg(
|
||||||
|
task.title,
|
||||||
|
QString::number(task.getID()) );
|
||||||
|
|
||||||
|
return queryExecInt(queryStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
int DataBaseLMS::deleteTaskFIM(int id_task)
|
||||||
|
{
|
||||||
|
QString queryStr = QString("DELETE FROM public.tasks_fim "
|
||||||
|
"WHERE task_id = %1 "
|
||||||
|
"RETURNING tasks_fim.task_id").arg(
|
||||||
|
QString::number(id_task));
|
||||||
|
|
||||||
|
return queryExecInt(queryStr);
|
||||||
|
}
|
||||||
|
|
||||||
Trainee DataBaseLMS::selectTrainee(int id_trainee)
|
Trainee DataBaseLMS::selectTrainee(int id_trainee)
|
||||||
{
|
{
|
||||||
Trainee trainee;
|
Trainee trainee;
|
||||||
@@ -721,12 +762,12 @@ int DataBaseLMS::insertTrainee(Trainee trainee)
|
|||||||
return queryExecInt(queryStr);
|
return queryExecInt(queryStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DataBaseLMS::deleteTrainee(int trainee_id)
|
int DataBaseLMS::deleteTrainee(int id_trainee)
|
||||||
{
|
{
|
||||||
QString queryStr = QString("DELETE FROM public.trainees "
|
QString queryStr = QString("DELETE FROM public.trainees "
|
||||||
"WHERE trainee_id = %1 "
|
"WHERE trainee_id = %1 "
|
||||||
"RETURNING trainees.trainee_id").arg(
|
"RETURNING trainees.trainee_id").arg(
|
||||||
QString::number(trainee_id));
|
QString::number(id_trainee));
|
||||||
|
|
||||||
return queryExecInt(queryStr);
|
return queryExecInt(queryStr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,12 +50,17 @@ protected:
|
|||||||
Group selectGroup(int id_group);
|
Group selectGroup(int id_group);
|
||||||
int insertGroup();
|
int insertGroup();
|
||||||
int insertGroup(Group group);
|
int insertGroup(Group group);
|
||||||
int deleteGroup(int group_id);
|
int deleteGroup(int id_group);
|
||||||
int updateGroup(Group group);
|
int updateGroup(Group group);
|
||||||
|
|
||||||
//Задача
|
//Задача AMM
|
||||||
int insertTaskAMM(int id_trainee);
|
int insertTaskAMM(int id_trainee);
|
||||||
int updateTaskAMM(TaskAmmFim task);
|
int updateTaskAMM(TaskAmmFim task);
|
||||||
|
int deleteTaskAMM(int id_task);
|
||||||
|
//Задача FIM
|
||||||
|
int insertTaskFIM(int id_trainee);
|
||||||
|
int updateTaskFIM(TaskAmmFim task);
|
||||||
|
int deleteTaskFIM(int id_task);
|
||||||
|
|
||||||
//Обучаемый
|
//Обучаемый
|
||||||
Trainee selectTrainee(int id_trainee);
|
Trainee selectTrainee(int id_trainee);
|
||||||
@@ -72,7 +77,7 @@ protected:
|
|||||||
|
|
||||||
int insertTrainee(int id_group);
|
int insertTrainee(int id_group);
|
||||||
int insertTrainee(Trainee trainee);
|
int insertTrainee(Trainee trainee);
|
||||||
int deleteTrainee(int trainee_id);
|
int deleteTrainee(int id_trainee);
|
||||||
int updateTrainee(Trainee trainee);
|
int updateTrainee(Trainee trainee);
|
||||||
|
|
||||||
QList<Task> selectTasksOfTrainee(int trainee_id);
|
QList<Task> selectTasksOfTrainee(int trainee_id);
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ int InterfaceDataBaseLMS::newTaskAMM(int id_trainee)
|
|||||||
|
|
||||||
int InterfaceDataBaseLMS::delTaskAMM(int id)
|
int InterfaceDataBaseLMS::delTaskAMM(int id)
|
||||||
{
|
{
|
||||||
return 0;
|
return deleteTaskAMM(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int InterfaceDataBaseLMS::editTaskAMM(TaskAmmFim task)
|
int InterfaceDataBaseLMS::editTaskAMM(TaskAmmFim task)
|
||||||
@@ -296,6 +296,21 @@ int InterfaceDataBaseLMS::editTaskAMM(TaskAmmFim task)
|
|||||||
return updateTaskAMM(task);
|
return updateTaskAMM(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int InterfaceDataBaseLMS::newTaskFIM(int id_trainee)
|
||||||
|
{
|
||||||
|
return insertTaskFIM(id_trainee);
|
||||||
|
}
|
||||||
|
|
||||||
|
int InterfaceDataBaseLMS::delTaskFIM(int id)
|
||||||
|
{
|
||||||
|
return deleteTaskFIM(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
int InterfaceDataBaseLMS::editTaskFIM(TaskAmmFim task)
|
||||||
|
{
|
||||||
|
return updateTaskFIM(task);
|
||||||
|
}
|
||||||
|
|
||||||
int InterfaceDataBaseLMS::newTrainee(int id_group)
|
int InterfaceDataBaseLMS::newTrainee(int id_group)
|
||||||
{
|
{
|
||||||
return insertTrainee(id_group);
|
return insertTrainee(id_group);
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ public:
|
|||||||
int delTaskAMM(int id);
|
int delTaskAMM(int id);
|
||||||
int editTaskAMM(TaskAmmFim task);
|
int editTaskAMM(TaskAmmFim task);
|
||||||
|
|
||||||
|
int newTaskFIM(int id_trainee);
|
||||||
|
int delTaskFIM(int id);
|
||||||
|
int editTaskFIM(TaskAmmFim task);
|
||||||
|
|
||||||
int newTrainee(int id_group);
|
int newTrainee(int id_group);
|
||||||
int delTrainee(int id);
|
int delTrainee(int id);
|
||||||
int editTrainee(Trainee trainee);
|
int editTrainee(Trainee trainee);
|
||||||
|
|||||||
21
DataBaseLMS/typeQueryToDB.h
Normal file
21
DataBaseLMS/typeQueryToDB.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef TYPEQUERYTODB_H
|
||||||
|
#define TYPEQUERYTODB_H
|
||||||
|
|
||||||
|
#include "DataBaseLMS_global.h"
|
||||||
|
|
||||||
|
enum TypeQueryToDB{
|
||||||
|
TYPE_QUERY_GET_ALL_LISTS,
|
||||||
|
TYPE_QUERY_NEW_INSTRUCTOR,
|
||||||
|
TYPE_QUERY_DEL_INSTRUCTOR,
|
||||||
|
TYPE_QUERY_EDIT_INSTRUCTOR,
|
||||||
|
TYPE_QUERY_NEW_GROUP,
|
||||||
|
TYPE_QUERY_DEL_GROUP,
|
||||||
|
TYPE_QUERY_EDIT_GROUP,
|
||||||
|
TYPE_QUERY_NEW_TRAINEE,
|
||||||
|
TYPE_QUERY_DEL_TRAINEE,
|
||||||
|
TYPE_QUERY_EDIT_TRAINEE,
|
||||||
|
TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE,
|
||||||
|
TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TYPEQUERYTODB_H
|
||||||
@@ -78,6 +78,8 @@ add_library(InstructorsAndTrainees SHARED
|
|||||||
tasks/fimtaskswidget.cpp
|
tasks/fimtaskswidget.cpp
|
||||||
tasks/fimtaskswidget.h
|
tasks/fimtaskswidget.h
|
||||||
tasks/fimtaskswidget.ui
|
tasks/fimtaskswidget.ui
|
||||||
|
tasks/tasktreepreparation.cpp
|
||||||
|
tasks/tasktreepreparation.h
|
||||||
#tasks/tasksAmmFim.cpp
|
#tasks/tasksAmmFim.cpp
|
||||||
#tasks/tasksAmmFim.h
|
#tasks/tasksAmmFim.h
|
||||||
widgets/newversionwidget.cpp
|
widgets/newversionwidget.cpp
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ public:
|
|||||||
{
|
{
|
||||||
this->authComplited = authComplited;
|
this->authComplited = authComplited;
|
||||||
}
|
}
|
||||||
|
void clearTree()
|
||||||
|
{
|
||||||
|
treeWidget->clear();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setArchiveVisible(bool archiveVisible)
|
void setArchiveVisible(bool archiveVisible)
|
||||||
|
|||||||
@@ -54,13 +54,12 @@ void DataParser::createFileDataList(QList<FileData> fileDataList,QString filenam
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataParser::createAuthMessage(ClientAutorization *auth)
|
QByteArray DataParser::createAuthMessage(ClientAutorization *auth)
|
||||||
{
|
{
|
||||||
authPassCache = auth; //кэширование даных авторизации, для сохранения при успешном заходе
|
authPassCache = auth; //кэширование даных авторизации, для сохранения при успешном заходе
|
||||||
|
|
||||||
QFile file(tempName);
|
QByteArray array;
|
||||||
file.open(QIODevice::WriteOnly);
|
QXmlStreamWriter xmlWriter(&array);
|
||||||
QXmlStreamWriter xmlWriter(&file);
|
|
||||||
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
xmlWriter.setAutoFormatting(true);
|
||||||
xmlWriter.writeStartDocument();
|
xmlWriter.writeStartDocument();
|
||||||
@@ -74,14 +73,13 @@ void DataParser::createAuthMessage(ClientAutorization *auth)
|
|||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
xmlWriter.writeEndDocument();
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
file.close();
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataParser::createToClientMessage(ToClientMessage *toClientMessage)
|
QByteArray DataParser::createToClientMessage(ToClientMessage *toClientMessage)
|
||||||
{
|
{
|
||||||
QFile file(tempName);
|
QByteArray array;
|
||||||
file.open(QIODevice::WriteOnly);
|
QXmlStreamWriter xmlWriter(&array);
|
||||||
QXmlStreamWriter xmlWriter(&file);
|
|
||||||
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
xmlWriter.setAutoFormatting(true);
|
||||||
xmlWriter.writeStartDocument();
|
xmlWriter.writeStartDocument();
|
||||||
@@ -95,16 +93,15 @@ void DataParser::createToClientMessage(ToClientMessage *toClientMessage)
|
|||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
xmlWriter.writeEndDocument();
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
file.close();
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id, void* data)
|
QByteArray DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id, void* data)
|
||||||
{
|
{
|
||||||
QFile file(tempName);
|
QByteArray array;
|
||||||
file.open(QIODevice::WriteOnly);
|
QXmlStreamWriter xmlWriter(&array);
|
||||||
QXmlStreamWriter xmlWriter(&file);
|
|
||||||
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
xmlWriter.setAutoFormatting(true);
|
||||||
xmlWriter.writeStartDocument();
|
xmlWriter.writeStartDocument();
|
||||||
@@ -195,14 +192,13 @@ void DataParser::createQueryToDBMessage(ClientQueryToDB *queryToDB, int id, void
|
|||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
xmlWriter.writeEndDocument();
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
file.close();
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataParser::createQueryTasksXMLMessage(QString type)
|
QByteArray DataParser::createQueryTasksXMLMessage(QString type)
|
||||||
{
|
{
|
||||||
QFile file(tempName);
|
QByteArray array;
|
||||||
file.open(QIODevice::WriteOnly);
|
QXmlStreamWriter xmlWriter(&array);
|
||||||
QXmlStreamWriter xmlWriter(&file);
|
|
||||||
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
xmlWriter.setAutoFormatting(true);
|
||||||
xmlWriter.writeStartDocument();
|
xmlWriter.writeStartDocument();
|
||||||
@@ -214,14 +210,13 @@ void DataParser::createQueryTasksXMLMessage(QString type)
|
|||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
xmlWriter.writeEndDocument();
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
file.close();
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
QByteArray DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
||||||
{
|
{
|
||||||
QFile file(tempName);
|
QByteArray array;
|
||||||
file.open(QIODevice::WriteOnly);
|
QXmlStreamWriter xmlWriter(&array);
|
||||||
QXmlStreamWriter xmlWriter(&file);
|
|
||||||
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
xmlWriter.setAutoFormatting(true);
|
||||||
xmlWriter.writeStartDocument();
|
xmlWriter.writeStartDocument();
|
||||||
@@ -233,7 +228,7 @@ void DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
|
|||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
xmlWriter.writeEndDocument();
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
file.close();
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,13 @@ public:
|
|||||||
void createServerSettings(QString server,QString port);
|
void createServerSettings(QString server,QString port);
|
||||||
void saveClientSettrings(QString language,bool isAutoStart);
|
void saveClientSettrings(QString language,bool isAutoStart);
|
||||||
void createFileDataList(QList<FileData> fileDataList,QString filename);
|
void createFileDataList(QList<FileData> fileDataList,QString filename);
|
||||||
void createAuthMessage(ClientAutorization *auth);
|
|
||||||
void createToClientMessage(ToClientMessage *toClientMessage);
|
QByteArray createAuthMessage(ClientAutorization *auth);
|
||||||
void createQueryToDBMessage(ClientQueryToDB *queryToDB, int id = 0, void* data = nullptr);
|
QByteArray createToClientMessage(ToClientMessage *toClientMessage);
|
||||||
void createQueryTasksXMLMessage(QString type);
|
QByteArray createQueryToDBMessage(ClientQueryToDB *queryToDB, int id = 0, void* data = nullptr);
|
||||||
void createDeAuthMessage(ClientDeAutorization *deAuth);
|
QByteArray createQueryTasksXMLMessage(QString type);
|
||||||
|
QByteArray createDeAuthMessage(ClientDeAutorization *deAuth);
|
||||||
|
|
||||||
void createAuthData(ServerAuthorization *serverAuth);
|
void createAuthData(ServerAuthorization *serverAuth);
|
||||||
void createAuthDataOffline(QString username,QString pass);
|
void createAuthDataOffline(QString username,QString pass);
|
||||||
void addRunData(QList<int> displays);
|
void addRunData(QList<int> displays);
|
||||||
|
|||||||
@@ -31,21 +31,14 @@ void SendSystem::sendDisable()
|
|||||||
socket->waitForBytesWritten();
|
socket->waitForBytesWritten();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendXMLmsgGUItoServer()
|
void SendSystem::sendXMLmsgGUItoServer(QByteArray array)
|
||||||
{
|
{
|
||||||
QDataStream stream(socket);
|
QDataStream stream(socket);
|
||||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||||
|
|
||||||
QFile file(tempName);
|
|
||||||
file.open(QIODevice::ReadOnly);
|
|
||||||
|
|
||||||
QByteArray array = file.readAll();
|
|
||||||
|
|
||||||
stream << PacketType::TYPE_XMLANSWER;
|
stream << PacketType::TYPE_XMLANSWER;
|
||||||
stream << array;
|
stream << array;
|
||||||
socket->waitForBytesWritten();
|
socket->waitForBytesWritten();
|
||||||
|
|
||||||
file.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendFileBlock(QString path)
|
void SendSystem::sendFileBlock(QString path)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class SendSystem :public QObject
|
|||||||
public:
|
public:
|
||||||
explicit SendSystem(QObject* parent = nullptr);
|
explicit SendSystem(QObject* parent = nullptr);
|
||||||
void setSocket(QTcpSocket *socket);
|
void setSocket(QTcpSocket *socket);
|
||||||
void sendXMLmsgGUItoServer();
|
void sendXMLmsgGUItoServer(QByteArray array);
|
||||||
void sendDisable();
|
void sendDisable();
|
||||||
void sendFileBlock(QString path);
|
void sendFileBlock(QString path);
|
||||||
void sendFolderBlock(QString path);
|
void sendFolderBlock(QString path);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define DATAS_H
|
#define DATAS_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include "typeQueryToDB.h"
|
||||||
|
|
||||||
class ServerSettings{
|
class ServerSettings{
|
||||||
public:
|
public:
|
||||||
@@ -41,7 +42,7 @@ class ClientDeAutorization{
|
|||||||
public:
|
public:
|
||||||
QString Login;
|
QString Login;
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
enum TypeQueryToDB{
|
enum TypeQueryToDB{
|
||||||
TYPE_QUERY_GET_ALL_LISTS,
|
TYPE_QUERY_GET_ALL_LISTS,
|
||||||
TYPE_QUERY_NEW_INSTRUCTOR,
|
TYPE_QUERY_NEW_INSTRUCTOR,
|
||||||
@@ -56,6 +57,7 @@ enum TypeQueryToDB{
|
|||||||
TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE,
|
TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE,
|
||||||
TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE
|
TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
class ClientQueryToDB{
|
class ClientQueryToDB{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ bool ConnectorToServer::authorizationInstructorLocal(QString login, QString pass
|
|||||||
autorization->Password = password;
|
autorization->Password = password;
|
||||||
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
|
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
|
||||||
|
|
||||||
dataParser->createAuthMessage(autorization);
|
QByteArray array = dataParser->createAuthMessage(autorization);
|
||||||
emit signal_sendXMLmsgGUItoServer();
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -44,8 +44,8 @@ bool ConnectorToServer::deAuthorizationInstructorLocal(QString login)
|
|||||||
ClientDeAutorization *deAutorization = new ClientDeAutorization;
|
ClientDeAutorization *deAutorization = new ClientDeAutorization;
|
||||||
deAutorization->Login = login;
|
deAutorization->Login = login;
|
||||||
|
|
||||||
dataParser->createDeAuthMessage(deAutorization);
|
QByteArray array = dataParser->createDeAuthMessage(deAutorization);
|
||||||
emit signal_sendXMLmsgGUItoServer();
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -60,8 +60,8 @@ bool ConnectorToServer::sendQueryToDB(TypeQueryToDB typeQuery, int id, void* dat
|
|||||||
ClientQueryToDB *queryToDB = new ClientQueryToDB;
|
ClientQueryToDB *queryToDB = new ClientQueryToDB;
|
||||||
queryToDB->typeQuery = typeQuery;
|
queryToDB->typeQuery = typeQuery;
|
||||||
|
|
||||||
dataParser->createQueryToDBMessage(queryToDB, id, data);
|
QByteArray array = dataParser->createQueryToDBMessage(queryToDB, id, data);
|
||||||
emit signal_sendXMLmsgGUItoServer();
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -78,8 +78,8 @@ bool ConnectorToServer::sendMessageForClient(int id, QString login, QString text
|
|||||||
toClientMessage->Login = login;
|
toClientMessage->Login = login;
|
||||||
toClientMessage->Text = text;
|
toClientMessage->Text = text;
|
||||||
|
|
||||||
dataParser->createToClientMessage(toClientMessage);
|
QByteArray array = dataParser->createToClientMessage(toClientMessage);
|
||||||
emit signal_sendXMLmsgGUItoServer();
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -91,8 +91,8 @@ bool ConnectorToServer::sendQueryTasksXML(QString type)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataParser->createQueryTasksXMLMessage(type);
|
QByteArray array = dataParser->createQueryTasksXMLMessage(type);
|
||||||
emit signal_sendXMLmsgGUItoServer();
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ signals:
|
|||||||
SendSystem *sendSystem,
|
SendSystem *sendSystem,
|
||||||
QThread *thread);
|
QThread *thread);
|
||||||
|
|
||||||
void signal_sendXMLmsgGUItoServer();
|
void signal_sendXMLmsgGUItoServer(QByteArray array);
|
||||||
|
|
||||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QThread>
|
||||||
#include "instructorsandtraineeswidget.h"
|
#include "instructorsandtraineeswidget.h"
|
||||||
#include "ui_instructorsandtraineeswidget.h"
|
#include "ui_instructorsandtraineeswidget.h"
|
||||||
#include "dialogauthorizationinstructor.h"
|
#include "dialogauthorizationinstructor.h"
|
||||||
@@ -26,6 +27,10 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
qRegisterMetaType<QList<Group>>("QList<Group>");
|
qRegisterMetaType<QList<Group>>("QList<Group>");
|
||||||
qRegisterMetaType<QList<Computer>>("QList<Computer>");
|
qRegisterMetaType<QList<Computer>>("QList<Computer>");
|
||||||
qRegisterMetaType<QList<Classroom>>("QList<Classroom>");
|
qRegisterMetaType<QList<Classroom>>("QList<Classroom>");
|
||||||
|
qRegisterMetaType<QList<Module*>>("QList<Module*>");
|
||||||
|
qRegisterMetaType<QList<QTreeWidgetItem*>>("QList<QTreeWidgetItem*>");
|
||||||
|
|
||||||
|
qDebug() << "InstructorsAndTraineesWidget init thread ID " << QThread::currentThreadId();
|
||||||
|
|
||||||
connectorToServer = new ConnectorToServer(this);
|
connectorToServer = new ConnectorToServer(this);
|
||||||
connect(connectorToServer,&ConnectorToServer::sigLoginResult,this,&InstructorsAndTraineesWidget::checkLoginResult);
|
connect(connectorToServer,&ConnectorToServer::sigLoginResult,this,&InstructorsAndTraineesWidget::checkLoginResult);
|
||||||
@@ -38,8 +43,8 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
connect(viewerInstructors, &ViewerInstructors::signal_BlockAutorization, this, &InstructorsAndTraineesWidget::signal_BlockAutorization);
|
connect(viewerInstructors, &ViewerInstructors::signal_BlockAutorization, this, &InstructorsAndTraineesWidget::signal_BlockAutorization);
|
||||||
connect(viewerTrainees, &ViewerTrainees::signal_BlockAutorization, this, &InstructorsAndTraineesWidget::signal_BlockAutorization);
|
connect(viewerTrainees, &ViewerTrainees::signal_BlockAutorization, this, &InstructorsAndTraineesWidget::signal_BlockAutorization);
|
||||||
|
|
||||||
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
//connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
||||||
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
//connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
||||||
|
|
||||||
connect(connectorToServer,&ConnectorToServer::signal_ConnectedToServer,this,&InstructorsAndTraineesWidget::slot_ConnectedToServer);
|
connect(connectorToServer,&ConnectorToServer::signal_ConnectedToServer,this,&InstructorsAndTraineesWidget::slot_ConnectedToServer);
|
||||||
|
|
||||||
@@ -52,7 +57,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, ammTasksWidget, &AMMtasksWidget::slot_traineeSelected);
|
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, ammTasksWidget, &AMMtasksWidget::slot_traineeSelected);
|
||||||
|
|
||||||
messangerWidget = new MessangerWidget(this);
|
messangerWidget = new MessangerWidget(this);
|
||||||
connect(connectorToServer,&ConnectorToServer::signal_InitMessanger,messangerWidget,&MessangerWidget::slot_InitMessanger);
|
//connect(connectorToServer,&ConnectorToServer::signal_InitMessanger,messangerWidget,&MessangerWidget::slot_InitMessanger);
|
||||||
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, messangerWidget, &MessangerWidget::slot_traineeSelected);
|
connect(viewerTrainees, &ViewerTrainees::signal_traineeSelected, messangerWidget, &MessangerWidget::slot_traineeSelected);
|
||||||
connect(messangerWidget, &MessangerWidget::signal_tabMessengerChanged, viewerTrainees, &ViewerTrainees::slot_tabMessengerChanged);
|
connect(messangerWidget, &MessangerWidget::signal_tabMessengerChanged, viewerTrainees, &ViewerTrainees::slot_tabMessengerChanged);
|
||||||
connect(messangerWidget, &MessangerWidget::signal_msgToClientReady, connectorToServer, &ConnectorToServer::slot_msgToClientReady);
|
connect(messangerWidget, &MessangerWidget::signal_msgToClientReady, connectorToServer, &ConnectorToServer::slot_msgToClientReady);
|
||||||
@@ -172,7 +177,11 @@ void InstructorsAndTraineesWidget::checkLoginResult(ServerAuthorization *serverA
|
|||||||
|
|
||||||
updateLabelLoggedInInstructor(serverAuth->Login, serverAuth->ClientName);
|
updateLabelLoggedInInstructor(serverAuth->Login, serverAuth->ClientName);
|
||||||
connectorToServer->setLoginName(nameInstructorLoggedInLocal);
|
connectorToServer->setLoginName(nameInstructorLoggedInLocal);
|
||||||
QMessageBox::information(this, tr("Instructor authorization"), tr("Successfully!"));
|
|
||||||
|
connectorToServer->sendQueryTasksXML("fim");
|
||||||
|
connectorToServer->sendQueryTasksXML("amm");
|
||||||
|
|
||||||
|
//QMessageBox::information(this, tr("Instructor authorization"), tr("Successfully!"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -194,12 +203,12 @@ void InstructorsAndTraineesWidget::checkDeLoginResult(ServerDeAuthorization *ser
|
|||||||
viewerInstructors->setAuthComplited(false);
|
viewerInstructors->setAuthComplited(false);
|
||||||
viewerTrainees->setAuthComplited(false);
|
viewerTrainees->setAuthComplited(false);
|
||||||
|
|
||||||
Q_EMIT signal_NeedUpdateUI(true, false);
|
//Q_EMIT signal_NeedUpdateUI(true, false);
|
||||||
|
|
||||||
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
||||||
updateLabelLoggedInInstructor("","");
|
updateLabelLoggedInInstructor("","");
|
||||||
|
|
||||||
QMessageBox::information(this, tr("Instructor deauthorization"), tr("Successfully!"));
|
//QMessageBox::information(this, tr("Instructor deauthorization"), tr("Successfully!"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -221,8 +230,18 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
|||||||
{//Сервер отключен
|
{//Сервер отключен
|
||||||
ui->btnConnectionToServer->setEnabled(true);
|
ui->btnConnectionToServer->setEnabled(true);
|
||||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||||
|
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
||||||
|
ui->btnAuthorizationInstructor->setChecked(false);
|
||||||
ui->btnSetVersion->hide();
|
ui->btnSetVersion->hide();
|
||||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||||
|
|
||||||
|
viewerTrainees->clearTree();
|
||||||
|
viewerInstructors->clearTree();
|
||||||
|
|
||||||
|
ammTasksWidget->clearTree();
|
||||||
|
fimTasksWidget->clearTree();
|
||||||
|
|
||||||
|
messangerWidget->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,6 +301,9 @@ void InstructorsAndTraineesWidget::on_btnAuthorizationInstructor_clicked()
|
|||||||
{//Авторизация Инструктора локальная (Администратора)
|
{//Авторизация Инструктора локальная (Администратора)
|
||||||
if(authorizationInstructorDialog(this))
|
if(authorizationInstructorDialog(this))
|
||||||
{
|
{
|
||||||
|
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
||||||
|
connect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
||||||
|
connect(connectorToServer,&ConnectorToServer::signal_InitMessanger,messangerWidget,&MessangerWidget::slot_InitMessanger);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ui->btnAuthorizationInstructor->setChecked(false);
|
ui->btnAuthorizationInstructor->setChecked(false);
|
||||||
@@ -292,6 +314,17 @@ void InstructorsAndTraineesWidget::on_btnAuthorizationInstructor_clicked()
|
|||||||
{
|
{
|
||||||
if(deAuthorizationInstructor(loginInstructorLoggedInLocal))
|
if(deAuthorizationInstructor(loginInstructorLoggedInLocal))
|
||||||
{
|
{
|
||||||
|
disconnect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerInstructors,&ViewerInstructors::slot_NeedUpdateUI);
|
||||||
|
disconnect(connectorToServer,&ConnectorToServer::signal_UpdateDB,viewerTrainees,&ViewerTrainees::slot_NeedUpdateUI);
|
||||||
|
disconnect(connectorToServer,&ConnectorToServer::signal_InitMessanger,messangerWidget,&MessangerWidget::slot_InitMessanger);
|
||||||
|
|
||||||
|
viewerTrainees->clearTree();
|
||||||
|
viewerInstructors->clearTree();
|
||||||
|
|
||||||
|
ammTasksWidget->clearTree();
|
||||||
|
fimTasksWidget->clearTree();
|
||||||
|
|
||||||
|
messangerWidget->clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ui->btnAuthorizationInstructor->setChecked(true);
|
ui->btnAuthorizationInstructor->setChecked(true);
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ Q_DECLARE_METATYPE(QList<Trainee>)
|
|||||||
Q_DECLARE_METATYPE(QList<Group>)
|
Q_DECLARE_METATYPE(QList<Group>)
|
||||||
Q_DECLARE_METATYPE(QList<Computer>)
|
Q_DECLARE_METATYPE(QList<Computer>)
|
||||||
Q_DECLARE_METATYPE(QList<Classroom>)
|
Q_DECLARE_METATYPE(QList<Classroom>)
|
||||||
|
Q_DECLARE_METATYPE(QList<Module*>)
|
||||||
|
Q_DECLARE_METATYPE(QList<QTreeWidgetItem*>)
|
||||||
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class InstructorsAndTraineesWidget;
|
class InstructorsAndTraineesWidget;
|
||||||
|
|||||||
@@ -130,6 +130,12 @@ int MessangerWidget::getIndexTab(QString login)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessangerWidget::clear()
|
||||||
|
{
|
||||||
|
listTrainees.clear();
|
||||||
|
actualizationTabsDialogMessenger();
|
||||||
|
}
|
||||||
|
|
||||||
void MessangerWidget::on_btnSend_clicked()
|
void MessangerWidget::on_btnSend_clicked()
|
||||||
{
|
{
|
||||||
QString text = ui->editMsg->toPlainText();
|
QString text = ui->editMsg->toPlainText();
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public:
|
|||||||
|
|
||||||
int getIndexTab(QString login);
|
int getIndexTab(QString login);
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_btnSend_clicked();
|
void on_btnSend_clicked();
|
||||||
void on_tabWidget_currentChanged(int index);
|
void on_tabWidget_currentChanged(int index);
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QResizeEvent>
|
||||||
#include "ammtaskswidget.h"
|
#include "ammtaskswidget.h"
|
||||||
#include "ui_ammtaskswidget.h"
|
#include "ui_ammtaskswidget.h"
|
||||||
|
|
||||||
@@ -9,10 +11,17 @@ AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, QWidget *pa
|
|||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::AMMtasksWidget),
|
ui(new Ui::AMMtasksWidget),
|
||||||
connectorToServer(connectorToServer),
|
connectorToServer(connectorToServer),
|
||||||
loginTraineeSelected("")
|
treeWidget(nullptr),
|
||||||
|
loginTraineeSelected(""),
|
||||||
|
threadPreparation(nullptr),
|
||||||
|
threadAnimation(nullptr),
|
||||||
|
taskTreePreparation(nullptr),
|
||||||
|
waitAnimationWidget(nullptr)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
qDebug() << "AMMtasksWidget init thread ID " << QThread::currentThreadId();
|
||||||
|
|
||||||
treeWidget = new QTreeWidget();
|
treeWidget = new QTreeWidget();
|
||||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||||
|
|
||||||
@@ -20,15 +29,36 @@ AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, QWidget *pa
|
|||||||
|
|
||||||
preparationTreeWidget();
|
preparationTreeWidget();
|
||||||
|
|
||||||
ui->btnAssignTaskToTrainee->setEnabled(false);
|
ui->btnAssignTaskToTrainee->setEnabled(false);
|
||||||
|
|
||||||
|
threadPreparation = new QThread();
|
||||||
|
taskTreePreparation = new TaskTreePreparation();
|
||||||
|
taskTreePreparation->moveToThread(threadPreparation);
|
||||||
|
threadPreparation->start();
|
||||||
|
threadPreparation->setPriority(QThread::HighestPriority);
|
||||||
|
connect(this, &AMMtasksWidget::signal_prepareListItems, taskTreePreparation, &TaskTreePreparation::slot_prepareListItems);
|
||||||
|
connect(taskTreePreparation, &TaskTreePreparation::signal_listItemsReady, this, &AMMtasksWidget::slot_listItemsReady);
|
||||||
|
|
||||||
|
threadAnimation = new QThread();
|
||||||
|
waitAnimationWidget = new WaitAnimationWidget;
|
||||||
|
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||||
|
waitAnimationWidget->setParent(this);
|
||||||
|
waitAnimationWidget->initialize(movie,this);
|
||||||
|
waitAnimationWidget->moveToThread(threadAnimation);
|
||||||
|
threadAnimation->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
AMMtasksWidget::~AMMtasksWidget()
|
AMMtasksWidget::~AMMtasksWidget()
|
||||||
{
|
{
|
||||||
deleteAllModuls();
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AMMtasksWidget::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
QSize size = event->size();
|
||||||
|
waitAnimationWidget->resize(size);
|
||||||
|
}
|
||||||
|
|
||||||
void AMMtasksWidget::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
void AMMtasksWidget::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
|
||||||
{
|
{
|
||||||
if(current == nullptr)
|
if(current == nullptr)
|
||||||
@@ -67,11 +97,13 @@ void AMMtasksWidget::on_treeWidget_currentItemChanged(QTreeWidgetItem *current,
|
|||||||
|
|
||||||
void AMMtasksWidget::slot_NeedUpdateUI()
|
void AMMtasksWidget::slot_NeedUpdateUI()
|
||||||
{
|
{
|
||||||
|
qDebug() << "AMMtasksWidget::slot_NeedUpdateUI thread ID " << QThread::currentThreadId();
|
||||||
loadTasksAMM();
|
loadTasksAMM();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMMtasksWidget::slot_traineeSelected(QString login)
|
void AMMtasksWidget::slot_traineeSelected(QString login)
|
||||||
{
|
{
|
||||||
|
qDebug() << "AMMtasksWidget::slot_traineeSelected thread ID " << QThread::currentThreadId();
|
||||||
loginTraineeSelected = login;
|
loginTraineeSelected = login;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,138 +112,22 @@ void AMMtasksWidget::loadTasksAMM()
|
|||||||
//Обновление дерева
|
//Обновление дерева
|
||||||
treeWidget->clear();
|
treeWidget->clear();
|
||||||
|
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
|
|
||||||
QByteArray array = connectorToServer->getListTaskAmmArray();
|
QByteArray array = connectorToServer->getListTaskAmmArray();
|
||||||
loadAMMtasksFromXML(array);
|
|
||||||
|
|
||||||
fillTree();
|
signal_prepareListItems(array, &listAllModules);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMMtasksWidget::domElementParser(QDomElement element, Module* moduleParent)
|
void AMMtasksWidget::slot_listItemsReady(QList<QTreeWidgetItem *> listItems)
|
||||||
{
|
{
|
||||||
QString name;
|
//Обновление дерева
|
||||||
|
treeWidget->clear();
|
||||||
|
|
||||||
QDomElement childElement = element.firstChildElement();
|
for(QTreeWidgetItem * item : listItems)
|
||||||
if(childElement.isNull())
|
treeWidget->addTopLevelItem(item);
|
||||||
return;
|
|
||||||
|
|
||||||
Module* module = nullptr;
|
waitAnimationWidget->hideWithStop();
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
name = childElement.nodeName();
|
|
||||||
|
|
||||||
QDomNamedNodeMap nodeMap = childElement.attributes();
|
|
||||||
|
|
||||||
if(name == "pm")
|
|
||||||
{
|
|
||||||
module = new PM();
|
|
||||||
PM* PMmodul = static_cast<PM*>(module);
|
|
||||||
|
|
||||||
PMmodul->initialize(nodeMap.namedItem("modelIdentCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("pmIssuer").nodeValue(),
|
|
||||||
nodeMap.namedItem("pmNumber").nodeValue(),
|
|
||||||
nodeMap.namedItem("pmVolume").nodeValue());
|
|
||||||
|
|
||||||
if(moduleParent)
|
|
||||||
{
|
|
||||||
PMmodul->setParentModule(moduleParent);
|
|
||||||
|
|
||||||
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
|
||||||
PMmodulParent->addChildModule(module);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(name == "dm")
|
|
||||||
{
|
|
||||||
module = new DM();
|
|
||||||
DM* DMmodul = static_cast<DM*>(module);
|
|
||||||
|
|
||||||
DMmodul->initialize(nodeMap.namedItem("modelIdentCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("systemDiffCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("systemCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("subSystemCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("subSubSystemCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("assyCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("disassyCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("disassyCodeVariant").nodeValue(),
|
|
||||||
nodeMap.namedItem("infoCode").nodeValue(),
|
|
||||||
nodeMap.namedItem("infoCodeVariant").nodeValue(),
|
|
||||||
nodeMap.namedItem("itemLocationCode").nodeValue());
|
|
||||||
|
|
||||||
if(moduleParent)
|
|
||||||
{
|
|
||||||
DMmodul->setParentModule(moduleParent);
|
|
||||||
|
|
||||||
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
|
||||||
PMmodulParent->addChildModule(module);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(name == "rus" || name == "eng")
|
|
||||||
{
|
|
||||||
if(moduleParent)
|
|
||||||
{
|
|
||||||
if(moduleParent->getType() == ModuleType::TYPE_PM)
|
|
||||||
{//PM
|
|
||||||
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
|
||||||
|
|
||||||
if(name == "rus")
|
|
||||||
PMmodulParent->setLangStructRus(nodeMap.namedItem("title").nodeValue());
|
|
||||||
else
|
|
||||||
PMmodulParent->setLangStructEng(nodeMap.namedItem("title").nodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{//DM
|
|
||||||
DM* DMmodulParent = static_cast<DM*>(moduleParent);
|
|
||||||
|
|
||||||
if(name == "rus")
|
|
||||||
DMmodulParent->setLangStructRus(nodeMap.namedItem("techName").nodeValue(),
|
|
||||||
nodeMap.namedItem("infoName").nodeValue(),
|
|
||||||
nodeMap.namedItem("pdf").nodeValue(),
|
|
||||||
nodeMap.namedItem("bookmark").nodeValue(),
|
|
||||||
nodeMap.namedItem("xml").nodeValue());
|
|
||||||
else
|
|
||||||
DMmodulParent->setLangStructEng(nodeMap.namedItem("techName").nodeValue(),
|
|
||||||
nodeMap.namedItem("infoName").nodeValue(),
|
|
||||||
nodeMap.namedItem("pdf").nodeValue(),
|
|
||||||
nodeMap.namedItem("bookmark").nodeValue(),
|
|
||||||
nodeMap.namedItem("xml").nodeValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
domElementParser(childElement, module);
|
|
||||||
|
|
||||||
if(moduleParent == nullptr)
|
|
||||||
listAllModules.append(module);
|
|
||||||
|
|
||||||
}while (! (childElement = childElement.nextSiblingElement()).isNull());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMMtasksWidget::loadAMMtasksFromXML(QByteArray array)
|
|
||||||
{
|
|
||||||
deleteAllModuls();
|
|
||||||
|
|
||||||
QDomDocument docTasksDOM;
|
|
||||||
|
|
||||||
docTasksDOM.setContent(array);
|
|
||||||
|
|
||||||
QDomElement manifestElement = docTasksDOM.firstChildElement("manifest");
|
|
||||||
if(manifestElement.isNull())
|
|
||||||
return;
|
|
||||||
|
|
||||||
domElementParser(manifestElement, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMMtasksWidget::deleteAllModuls()
|
|
||||||
{
|
|
||||||
for(Module* module: listAllModules)
|
|
||||||
{
|
|
||||||
if(module->getType() == ModuleType::TYPE_PM)
|
|
||||||
delete static_cast<PM*>(module);
|
|
||||||
else
|
|
||||||
delete static_cast<DM*>(module);
|
|
||||||
}
|
|
||||||
listAllModules.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Module *AMMtasksWidget::searchModuleByID(int id)
|
Module *AMMtasksWidget::searchModuleByID(int id)
|
||||||
@@ -246,59 +162,6 @@ void AMMtasksWidget::reSetHeadTreeWidget()
|
|||||||
treeWidget->setHeaderLabels(listHeaders);
|
treeWidget->setHeaderLabels(listHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMMtasksWidget::fillTree()
|
|
||||||
{
|
|
||||||
//Обновление дерева
|
|
||||||
treeWidget->clear();
|
|
||||||
|
|
||||||
for(Module* module : listAllModules)
|
|
||||||
{
|
|
||||||
addModuleToTreeWidget(module);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMMtasksWidget::addModuleToTreeWidget(Module *module, QTreeWidgetItem* parentItem)
|
|
||||||
{
|
|
||||||
QTreeWidgetItem* itemModule = nullptr;
|
|
||||||
|
|
||||||
QString text;
|
|
||||||
QString ID = QString::number(module->getID());
|
|
||||||
|
|
||||||
if(parentItem)
|
|
||||||
{
|
|
||||||
itemModule = new QTreeWidgetItem();
|
|
||||||
parentItem->addChild(itemModule);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
itemModule = new QTreeWidgetItem(treeWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(module->getType() == ModuleType::TYPE_PM)
|
|
||||||
{
|
|
||||||
PM* PMmodul = static_cast<PM*>(module);
|
|
||||||
text = PMmodul->getLangStructRus().title;
|
|
||||||
|
|
||||||
for(Module* module : PMmodul->getListChildModules())
|
|
||||||
{
|
|
||||||
addModuleToTreeWidget(module, itemModule);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DM* DMmodul = static_cast<DM*>(module);
|
|
||||||
text = DMmodul->getLangStructRus().techName;
|
|
||||||
|
|
||||||
itemModule->setFlags(itemModule->flags() | Qt::ItemIsUserCheckable);
|
|
||||||
itemModule->setCheckState(0, Qt::Checked);
|
|
||||||
itemModule->setIcon(0, QIcon(":/resources/icons/procedure.png"));
|
|
||||||
}
|
|
||||||
|
|
||||||
itemModule->setText(ColumnsTree::clmn_PMorDM, text);
|
|
||||||
itemModule->setText(ColumnsTree::clmn_ID, ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AMMtasksWidget::on_btnUpdateTasks_clicked()
|
void AMMtasksWidget::on_btnUpdateTasks_clicked()
|
||||||
{
|
{
|
||||||
connectorToServer->sendQueryTasksXML("amm");
|
connectorToServer->sendQueryTasksXML("amm");
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <QDomNode>
|
#include <QDomNode>
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "connectortoserver.h"
|
#include "connectortoserver.h"
|
||||||
|
#include "taskTreePreparation.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class AMMtasksWidget;
|
class AMMtasksWidget;
|
||||||
@@ -25,10 +26,18 @@ public:
|
|||||||
explicit AMMtasksWidget(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
explicit AMMtasksWidget(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
||||||
~AMMtasksWidget();
|
~AMMtasksWidget();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void clearTree()
|
||||||
|
{
|
||||||
|
treeWidget->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||||
void on_btnUpdateTasks_clicked();
|
void on_btnUpdateTasks_clicked();
|
||||||
|
|
||||||
void on_btnAssignTaskToTrainee_clicked();
|
void on_btnAssignTaskToTrainee_clicked();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
@@ -38,19 +47,16 @@ public Q_SLOTS:
|
|||||||
void slot_traineeSelected(QString login);
|
void slot_traineeSelected(QString login);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadAMMtasksFromXML(QByteArray array);
|
|
||||||
void domElementParser(QDomElement element, Module* moduleParent);
|
|
||||||
void deleteAllModuls();
|
|
||||||
Module* searchModuleByID(int id);
|
Module* searchModuleByID(int id);
|
||||||
|
|
||||||
void preparationTreeWidget();
|
void preparationTreeWidget();
|
||||||
void reSetHeadTreeWidget();
|
void reSetHeadTreeWidget();
|
||||||
|
|
||||||
void fillTree();
|
|
||||||
void addModuleToTreeWidget(Module* module, QTreeWidgetItem* parentItem = nullptr);
|
|
||||||
|
|
||||||
void loadTasksAMM();
|
void loadTasksAMM();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void signal_prepareListItems(QByteArray array, QList<Module*>* listAllModules);
|
||||||
|
public Q_SLOTS:
|
||||||
|
void slot_listItemsReady(QList<QTreeWidgetItem*> listItems);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AMMtasksWidget *ui;
|
Ui::AMMtasksWidget *ui;
|
||||||
ConnectorToServer* connectorToServer;
|
ConnectorToServer* connectorToServer;
|
||||||
@@ -59,6 +65,11 @@ private:
|
|||||||
private:
|
private:
|
||||||
QList<Module*> listAllModules;
|
QList<Module*> listAllModules;
|
||||||
QString loginTraineeSelected;
|
QString loginTraineeSelected;
|
||||||
|
|
||||||
|
QThread* threadPreparation;
|
||||||
|
QThread* threadAnimation;
|
||||||
|
TaskTreePreparation* taskTreePreparation;
|
||||||
|
WaitAnimationWidget *waitAnimationWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AMMTASKSWIDGET_H
|
#endif // AMMTASKSWIDGET_H
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ public:
|
|||||||
explicit FIMtasksWidget(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
explicit FIMtasksWidget(ConnectorToServer* connectorToServer, QWidget *parent = nullptr);
|
||||||
~FIMtasksWidget();
|
~FIMtasksWidget();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void clearTree()
|
||||||
|
{
|
||||||
|
treeWidget->clear();
|
||||||
|
}
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||||
void on_btnUpdateTasks_clicked();
|
void on_btnUpdateTasks_clicked();
|
||||||
|
|||||||
203
InstructorsAndTrainees/tasks/tasktreepreparation.cpp
Normal file
203
InstructorsAndTrainees/tasks/tasktreepreparation.cpp
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
#include <QThread>
|
||||||
|
#include <QDebug>
|
||||||
|
#include "tasktreepreparation.h"
|
||||||
|
|
||||||
|
TaskTreePreparation::TaskTreePreparation(QObject *parent) :
|
||||||
|
QObject(parent),
|
||||||
|
listAllModules(nullptr)
|
||||||
|
{
|
||||||
|
qDebug() << "TaskTreePreparation init thread ID " << QThread::currentThreadId();
|
||||||
|
}
|
||||||
|
|
||||||
|
TaskTreePreparation::~TaskTreePreparation()
|
||||||
|
{
|
||||||
|
deleteAllModuls();
|
||||||
|
}
|
||||||
|
|
||||||
|
QTreeWidgetItem *TaskTreePreparation::addModuleToTreeWidget(Module *module, QTreeWidgetItem *parentItem)
|
||||||
|
{
|
||||||
|
QTreeWidgetItem* itemModule = nullptr;
|
||||||
|
|
||||||
|
QString text;
|
||||||
|
QString ID = QString::number(module->getID());
|
||||||
|
|
||||||
|
itemModule = new QTreeWidgetItem();
|
||||||
|
|
||||||
|
if(parentItem)
|
||||||
|
parentItem->addChild(itemModule);
|
||||||
|
|
||||||
|
if(module->getType() == ModuleType::TYPE_PM)
|
||||||
|
{
|
||||||
|
PM* PMmodul = static_cast<PM*>(module);
|
||||||
|
text = PMmodul->getLangStructRus().title;
|
||||||
|
|
||||||
|
for(Module* module : PMmodul->getListChildModules())
|
||||||
|
{
|
||||||
|
addModuleToTreeWidget(module, itemModule);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DM* DMmodul = static_cast<DM*>(module);
|
||||||
|
text = DMmodul->getLangStructRus().techName;
|
||||||
|
|
||||||
|
//itemModule->setFlags(itemModule->flags() | Qt::ItemIsUserCheckable);
|
||||||
|
//itemModule->setCheckState(0, Qt::Checked);
|
||||||
|
itemModule->setIcon(0, QIcon(":/resources/icons/procedure.png"));
|
||||||
|
}
|
||||||
|
|
||||||
|
itemModule->setText(0, text);
|
||||||
|
itemModule->setText(1, ID);
|
||||||
|
|
||||||
|
return itemModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskTreePreparation::loadAMMtasksFromXML(QByteArray array)
|
||||||
|
{
|
||||||
|
deleteAllModuls();
|
||||||
|
|
||||||
|
QDomDocument docTasksDOM;
|
||||||
|
|
||||||
|
docTasksDOM.setContent(array);
|
||||||
|
|
||||||
|
QDomElement manifestElement = docTasksDOM.firstChildElement("manifest");
|
||||||
|
if(manifestElement.isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
|
domElementParser(manifestElement, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskTreePreparation::deleteAllModuls()
|
||||||
|
{
|
||||||
|
if(listAllModules == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(Module* module: *listAllModules)
|
||||||
|
{
|
||||||
|
if(module->getType() == ModuleType::TYPE_PM)
|
||||||
|
delete static_cast<PM*>(module);
|
||||||
|
else
|
||||||
|
delete static_cast<DM*>(module);
|
||||||
|
}
|
||||||
|
listAllModules->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskTreePreparation::domElementParser(QDomElement element, Module* moduleParent)
|
||||||
|
{
|
||||||
|
QString name;
|
||||||
|
|
||||||
|
QDomElement childElement = element.firstChildElement();
|
||||||
|
if(childElement.isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Module* module = nullptr;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
name = childElement.nodeName();
|
||||||
|
|
||||||
|
QDomNamedNodeMap nodeMap = childElement.attributes();
|
||||||
|
|
||||||
|
if(name == "pm")
|
||||||
|
{
|
||||||
|
module = new PM();
|
||||||
|
PM* PMmodul = static_cast<PM*>(module);
|
||||||
|
|
||||||
|
PMmodul->initialize(nodeMap.namedItem("modelIdentCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("pmIssuer").nodeValue(),
|
||||||
|
nodeMap.namedItem("pmNumber").nodeValue(),
|
||||||
|
nodeMap.namedItem("pmVolume").nodeValue());
|
||||||
|
|
||||||
|
if(moduleParent)
|
||||||
|
{
|
||||||
|
PMmodul->setParentModule(moduleParent);
|
||||||
|
|
||||||
|
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
||||||
|
PMmodulParent->addChildModule(module);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(name == "dm")
|
||||||
|
{
|
||||||
|
module = new DM();
|
||||||
|
DM* DMmodul = static_cast<DM*>(module);
|
||||||
|
|
||||||
|
DMmodul->initialize(nodeMap.namedItem("modelIdentCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("systemDiffCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("systemCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("subSystemCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("subSubSystemCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("assyCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("disassyCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("disassyCodeVariant").nodeValue(),
|
||||||
|
nodeMap.namedItem("infoCode").nodeValue(),
|
||||||
|
nodeMap.namedItem("infoCodeVariant").nodeValue(),
|
||||||
|
nodeMap.namedItem("itemLocationCode").nodeValue());
|
||||||
|
|
||||||
|
if(moduleParent)
|
||||||
|
{
|
||||||
|
DMmodul->setParentModule(moduleParent);
|
||||||
|
|
||||||
|
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
||||||
|
PMmodulParent->addChildModule(module);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(name == "rus" || name == "eng")
|
||||||
|
{
|
||||||
|
if(moduleParent)
|
||||||
|
{
|
||||||
|
if(moduleParent->getType() == ModuleType::TYPE_PM)
|
||||||
|
{//PM
|
||||||
|
PM* PMmodulParent = static_cast<PM*>(moduleParent);
|
||||||
|
|
||||||
|
if(name == "rus")
|
||||||
|
PMmodulParent->setLangStructRus(nodeMap.namedItem("title").nodeValue());
|
||||||
|
else
|
||||||
|
PMmodulParent->setLangStructEng(nodeMap.namedItem("title").nodeValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{//DM
|
||||||
|
DM* DMmodulParent = static_cast<DM*>(moduleParent);
|
||||||
|
|
||||||
|
if(name == "rus")
|
||||||
|
DMmodulParent->setLangStructRus(nodeMap.namedItem("techName").nodeValue(),
|
||||||
|
nodeMap.namedItem("infoName").nodeValue(),
|
||||||
|
nodeMap.namedItem("pdf").nodeValue(),
|
||||||
|
nodeMap.namedItem("bookmark").nodeValue(),
|
||||||
|
nodeMap.namedItem("xml").nodeValue());
|
||||||
|
else
|
||||||
|
DMmodulParent->setLangStructEng(nodeMap.namedItem("techName").nodeValue(),
|
||||||
|
nodeMap.namedItem("infoName").nodeValue(),
|
||||||
|
nodeMap.namedItem("pdf").nodeValue(),
|
||||||
|
nodeMap.namedItem("bookmark").nodeValue(),
|
||||||
|
nodeMap.namedItem("xml").nodeValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
domElementParser(childElement, module);
|
||||||
|
|
||||||
|
if(moduleParent == nullptr)
|
||||||
|
listAllModules->append(module);
|
||||||
|
|
||||||
|
}while (! (childElement = childElement.nextSiblingElement()).isNull());
|
||||||
|
}
|
||||||
|
|
||||||
|
void TaskTreePreparation::slot_prepareListItems(QByteArray array, QList<Module*>* listAllModules)
|
||||||
|
{
|
||||||
|
qDebug() << "TaskTreePreparation::slot_prepareListItems thread ID " << QThread::currentThreadId();
|
||||||
|
|
||||||
|
this->listAllModules = listAllModules;
|
||||||
|
|
||||||
|
loadAMMtasksFromXML(array);
|
||||||
|
|
||||||
|
listItems.clear();
|
||||||
|
|
||||||
|
for(Module* module : *this->listAllModules)
|
||||||
|
{
|
||||||
|
QTreeWidgetItem* item = addModuleToTreeWidget(module);
|
||||||
|
listItems.append(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_EMIT signal_listItemsReady(listItems);
|
||||||
|
}
|
||||||
33
InstructorsAndTrainees/tasks/tasktreepreparation.h
Normal file
33
InstructorsAndTrainees/tasks/tasktreepreparation.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef TASKTREEPREPARATION_H
|
||||||
|
#define TASKTREEPREPARATION_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QTreeWidgetItem>
|
||||||
|
#include <QDomElement>
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
|
class TaskTreePreparation : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit TaskTreePreparation(QObject *parent = nullptr);
|
||||||
|
~TaskTreePreparation();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTreeWidgetItem* addModuleToTreeWidget(Module* module, QTreeWidgetItem* parentItem = nullptr);
|
||||||
|
void loadAMMtasksFromXML(QByteArray array);
|
||||||
|
void domElementParser(QDomElement element, Module* moduleParent);
|
||||||
|
void deleteAllModuls();
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void slot_prepareListItems(QByteArray array, QList<Module*>* listAllModules);
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void signal_listItemsReady(QList<QTreeWidgetItem*> listItems);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QList<QTreeWidgetItem*> listItems;
|
||||||
|
QList<Module*>* listAllModules;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TASKTREEPREPARATION_H
|
||||||
@@ -29,6 +29,11 @@ void WaitAnimationWidget::hideWithStop()
|
|||||||
loadingMovie->stop();
|
loadingMovie->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WaitAnimationWidget::resize(QSize size)
|
||||||
|
{
|
||||||
|
setFixedSize(size);
|
||||||
|
}
|
||||||
|
|
||||||
WaitAnimationWidget::~WaitAnimationWidget()
|
WaitAnimationWidget::~WaitAnimationWidget()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public:
|
|||||||
void initialize(QMovie *movie,QWidget *parent);
|
void initialize(QMovie *movie,QWidget *parent);
|
||||||
void showWithPlay();
|
void showWithPlay();
|
||||||
void hideWithStop();
|
void hideWithStop();
|
||||||
|
void resize(QSize size);
|
||||||
~WaitAnimationWidget();
|
~WaitAnimationWidget();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include "typeQueryToDB.h"
|
||||||
|
|
||||||
#define NOTIFY_SERVER_END "END"
|
#define NOTIFY_SERVER_END "END"
|
||||||
#define NOTIFY_SERVER_BLOCKED "BLOCKED"
|
#define NOTIFY_SERVER_BLOCKED "BLOCKED"
|
||||||
@@ -60,7 +61,7 @@ class ClientDeAutorization
|
|||||||
public:
|
public:
|
||||||
QString Login;
|
QString Login;
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
enum TypeQueryToDB{
|
enum TypeQueryToDB{
|
||||||
TYPE_QUERY_GET_ALL_LISTS,
|
TYPE_QUERY_GET_ALL_LISTS,
|
||||||
TYPE_QUERY_NEW_INSTRUCTOR,
|
TYPE_QUERY_NEW_INSTRUCTOR,
|
||||||
@@ -75,6 +76,7 @@ enum TypeQueryToDB{
|
|||||||
TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE,
|
TYPE_QUERY_ASSIGN_TASK_AMM_TO_TRAINEE,
|
||||||
TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE
|
TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
class ClientQueryToDB{
|
class ClientQueryToDB{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -240,6 +240,19 @@ void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQu
|
|||||||
//emit sigTasksChanged();
|
//emit sigTasksChanged();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case TypeQueryToDB::TYPE_QUERY_ASSIGN_TASK_FIM_TO_TRAINEE:
|
||||||
|
{
|
||||||
|
int id_new;
|
||||||
|
id_new = providerDBLMS->newTaskFIM(id);
|
||||||
|
if(id_new)
|
||||||
|
{
|
||||||
|
(*(TaskAmmFim*)data).setID(id_new);
|
||||||
|
providerDBLMS->editTaskFIM(*(TaskAmmFim*)data);
|
||||||
|
}
|
||||||
|
//emit sigTasksChanged();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//client->sendXmlAnswer(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_DB_LIST_INSTRUCTORS);
|
//client->sendXmlAnswer(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_DB_LIST_INSTRUCTORS);
|
||||||
|
|||||||
@@ -307,10 +307,25 @@ int ProviderDBLMS::newTaskAMM(int id_trainee)
|
|||||||
|
|
||||||
int ProviderDBLMS::delTaskAMM(int id)
|
int ProviderDBLMS::delTaskAMM(int id)
|
||||||
{
|
{
|
||||||
return 0;
|
return dbLMS->delTaskAMM(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProviderDBLMS::editTaskAMM(TaskAmmFim task)
|
int ProviderDBLMS::editTaskAMM(TaskAmmFim task)
|
||||||
{
|
{
|
||||||
return dbLMS->editTaskAMM(task);
|
return dbLMS->editTaskAMM(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ProviderDBLMS::newTaskFIM(int id_trainee)
|
||||||
|
{
|
||||||
|
return dbLMS->newTaskFIM(id_trainee);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ProviderDBLMS::delTaskFIM(int id)
|
||||||
|
{
|
||||||
|
return dbLMS->delTaskFIM(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ProviderDBLMS::editTaskFIM(TaskAmmFim task)
|
||||||
|
{
|
||||||
|
return dbLMS->editTaskFIM(task);
|
||||||
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ public:
|
|||||||
int delTaskAMM(int id);
|
int delTaskAMM(int id);
|
||||||
int editTaskAMM(TaskAmmFim task);
|
int editTaskAMM(TaskAmmFim task);
|
||||||
|
|
||||||
|
int newTaskFIM(int id_trainee);
|
||||||
|
int delTaskFIM(int id);
|
||||||
|
int editTaskFIM(TaskAmmFim task);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
//сигнал о блокировке авторизации
|
//сигнал о блокировке авторизации
|
||||||
void signal_BlockAutorization(bool block);
|
void signal_BlockAutorization(bool block);
|
||||||
|
|||||||
Reference in New Issue
Block a user