#ifndef RECOGNIZESYSTEM_H
#define RECOGNIZESYSTEM_H

#include "Core/dataparser.h"
#include "Core/postprocessorsystem.h"
#include <QObject>
#include <QDataStream>
#include <QTcpSocket>

#include <QThread>
#include <Core\tools.h>
#include <Core\versioncontainer.h>
#include <Data\streamingversiondata.h>
#include <Core\hashcomparer.h>

class RecognizeSystem : public QObject
{
    Q_OBJECT

public:
    explicit RecognizeSystem(QObject *parent = 0);
    ~RecognizeSystem(){};
    void initialize(DataParser *dataParser, VersionContainer* versionContainer,PostProcessorSystem *postProcessorSystem);
    void recognize(QTcpSocket *socket);
signals:
    void sigUpdateBytesAvailable();
    void sigLoadComplete();
    void sigNeedUpdate(bool flag,qint64 size,quint64 fileCount,quint64 fileDelete);
    void sigSendDebugLog(QString message);
    void sigAnimationActivated(bool flag);
    void sigCheckUpdate();
    void sigdRecalculateHashOnServerState();

private:
    VersionContainer *versionContainer;
    DataParser *dataParser;
    PostProcessorSystem *postProcessorSystem;
    PacketType packetType;
    QString filePath;
    QByteArray tmpBlock;

    qint64 sizeReceiveData;
    qint64 fileSize;
    int countSend;
};

#endif // RECOGNIZESYSTEM_H
