mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Переделано под один мега-проект LMS с общим CMakeLists.txt
This commit is contained in:
107
InstructorsAndTrainees/connectorToServer/connectortoserver.h
Normal file
107
InstructorsAndTrainees/connectorToServer/connectortoserver.h
Normal file
@@ -0,0 +1,107 @@
|
||||
#ifndef CONNECTORTOSERVER_H
|
||||
#define CONNECTORTOSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include "Core\tcpclient.h"
|
||||
#include "Core\dataparser.h"
|
||||
#include "Core\sendsystem.h"
|
||||
#include "Core\recognizesystem.h"
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "computer.h"
|
||||
#include "classroom.h"
|
||||
#include "task.h"
|
||||
|
||||
class ConnectorToServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ConnectorToServer(QObject *parent = nullptr);
|
||||
|
||||
bool authorizationInstructorLocal(QString login, QString password);
|
||||
bool deAuthorizationInstructorLocal(QString login);
|
||||
|
||||
bool sendQueryToDB(TypeQueryToDB typeQuery, int id = 0, void* data = nullptr);
|
||||
bool sendMessageForClient(int id, QString login, QString text);
|
||||
|
||||
void SetConnectToServer();
|
||||
|
||||
public:
|
||||
//Запросы к БД (локальной)
|
||||
QList<Instructor> getListInstructors();
|
||||
QList<Trainee> getListTrainees();
|
||||
QList<Group> getListGroups();
|
||||
QList<Computer> getListComputers();
|
||||
QList<Classroom> getListClassrooms();
|
||||
QList<Task> getListTasks();
|
||||
|
||||
bool isArchivedInstructor(int id);
|
||||
bool isAdminInstructor(int id);
|
||||
bool isLoggedInInstructor(int id);
|
||||
Instructor getInstructor(int id);
|
||||
|
||||
QList<Trainee> getListTraineesInGroup(int id);
|
||||
bool isArchivedTrainee(int id);
|
||||
bool isLoggedInTrainee(int id);
|
||||
Trainee getTrainee(int id);
|
||||
Group getGroup(int id);
|
||||
|
||||
int getIdTraineeByLogin(QString login);
|
||||
|
||||
public slots:
|
||||
/*void slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
QList<Group>* listGroups);*/
|
||||
|
||||
void slot_AnswerQueryToDB_ListInstructors(QList<Instructor> listInstructors);
|
||||
void slot_AnswerQueryToDB_ListGroups(QList<Group> listGroups);
|
||||
void slot_AnswerQueryToDB_ListTrainees(QList<Trainee> listTrainees);
|
||||
void slot_AnswerQueryToDB_ListComputers(QList<Computer> listComputers);
|
||||
void slot_AnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
||||
void slot_AnswerQueryToDB_ListTasks(QList<Task> listTasks);
|
||||
|
||||
void slot_msgToClientReady(QString login, QString text);
|
||||
|
||||
signals:
|
||||
void sigSetConnect(ServerSettings* serverSettings,QThread *thread);
|
||||
void sigInitializeClient(RecognizeSystem *recognizeSystem,
|
||||
SendSystem *sendSystem,
|
||||
QThread *thread);
|
||||
|
||||
void signal_sendXMLmsgGUItoServer();
|
||||
|
||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
||||
|
||||
void signal_ConnectedToServer(bool state);
|
||||
|
||||
void signal_InitMessanger(QList<Trainee> listTrainees);
|
||||
|
||||
void signal_msgFromClientReady(QString login, QString text);
|
||||
|
||||
|
||||
private:
|
||||
void initialize();
|
||||
void bindConnection();
|
||||
void createObjects();
|
||||
|
||||
private:
|
||||
QThread *connectionThread;
|
||||
TCPClient *client;
|
||||
DataParser *dataParser;
|
||||
SendSystem *sendSystem;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
|
||||
//Списочная модель БД СУО
|
||||
QList<Instructor> listInstructors;
|
||||
QList<Group> listGroups;
|
||||
QList<Trainee> listTrainees;
|
||||
QList<Computer> listComputers;
|
||||
QList<Classroom> listClassrooms;
|
||||
QList<Task> listTasks;
|
||||
};
|
||||
|
||||
#endif // CONNECTORTOSERVER_H
|
||||
Reference in New Issue
Block a user