fileprocessdlg.h
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef FILEPROCESSDLG_H
#define FILEPROCESSDLG_H
#include <QDialog>
#include <QFile>
#include <QTextStream>
#include <QThread>
#include <QList>
#include <QMutex>
#include <QKeyEvent>
#include "config.h"
#include "servicedata.h"
#include "historylistwindow.h"
using namespace Define;
using namespace ERROR_LOG_SPACE;
namespace Ui {
class FileProcessDlg;
}
class ProgramCopyWorker : public QObject{
Q_OBJECT
QString m_strDestDir;
QList<QString> m_arrSrcFileList;
QList<QString> m_arrSrcDirList;
QMutex m_mutex;
bool m_bStop;
public:
explicit ProgramCopyWorker(QString strDest);
explicit ProgramCopyWorker();
void setDestPath(QString strDest);
void addSrcFile(QString strfilename);
void addSrcDir(QString strDirPath);
public slots:
void workerMain();
void workerStop();
signals:
void finished();
void progressed(int progress, int sec);
void errorFired(QString Desc);
};
class FileProcessDlg : public QDialog
{
Q_OBJECT
void saveHistoryLineData(QTextStream &out, uint16_t i, uint16_t cnt, time_t first_fired, time_t last_fried);
public:
explicit FileProcessDlg(QWidget *parent = 0, ConfigType type = config_invalid, bool isDown = true);
~FileProcessDlg();
private slots:
void on_ctrBtnCancel_clicked();
void infodataDownload();
void servicedataDownload();
void programDownload();
void programUpload();
void configDownload();
void configUpload();
void haccpdataDownload();
void standardInfoUpload();
signals:
void stopcopy();
public slots:
void onProgressed(int progress,int sec);
void onProgressFinished();
void onErrorFired(QString Desc);
protected:
void keyPressEvent(QKeyEvent* event);
void keyReleaseEvent(QKeyEvent* event);
private:
Ui::FileProcessDlg *ui;
ConfigType m_nCfgtype;
QThread programCopyThd;
ProgramCopyWorker worker;
};
#endif // FILEPROCESSDLG_H