Files
RRJServer/ServerLMS/Systems/recognizesystem.h
2025-01-17 16:47:22 +03:00

68 lines
1.6 KiB
C++

#ifndef RECOGNIZESYSTEM_H
#define RECOGNIZESYSTEM_H
#include <QDataStream>
#include <QTcpSocket>
#include <QMutex>
#include <Systems/updatecontroller.h>
#include <Systems/tools.h>
#include <Systems/Parsers/dataparser.h>
#include <Data/Client.h>
#include <Data/PacketType.h>
#include "serverlmswidget.h"
class UpdateController;
class ServerLMSWidget;
class ClientHandler;
class RecognizeSystem : public QObject
{
Q_OBJECT
public:
RecognizeSystem(QObject *parent = nullptr);
void initialize(UpdateController *updateController,DataParser *dataParser,
ServerLMSWidget *server,SendSystem *sendSystem, ClientHandler *handler);
void recognize();
~RecognizeSystem();
signals:
void sigCalculateHash();
void sigSendToLogger(QString string);
void sigXmlParser(ClientHandler *clientHandler,QByteArray data);
void sigChangeVersion(QString versionName);
void sigDeleteVersion(QString versionName);
void sigCopyVersion(QString versionName,QString newVersionName);
private:
UpdateController *updateController;
SendSystem *sendSystem;
DataParser *dataParser;
ServerLMSWidget *server;
QString command;
PacketType packetType;
QString filePath;
ClientHandler *clientHandler;
QMutex *mutex;
QTcpSocket *socket;
QByteArray tmpBlock;
qint64 sizeReceiveData;
qint64 fileSize;
int countSend;
bool isPackageTypeInited;
void packetTypeInit(PacketType packet,Client *client);
void packetTypeInit(PacketType type);
QString createFullPath(QString path);
bool checkIsChangeable();
bool checkNonStaticData(QString path);
};
#endif // RECOGNIZESYSTEM_H