#ifndef FILEPROCESSDLG_H #define FILEPROCESSDLG_H #include #include #include #include #include #include #include #include #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 m_arrSrcFileList; QList m_arrSrcDirList; QMutex m_mutex; bool m_bStop; QDate m_dtStart; QDate m_dtEnd; public: explicit ProgramCopyWorker(QString strDest); explicit ProgramCopyWorker(); void setDestPath(QString strDest); void addSrcFile(QString strfilename); void addSrcDir(QString strDirPath); void setStartDate(QDate &dt){m_dtStart = dt;} void setEndDate(QDate &dt){m_dtEnd = dt;} public slots: void workerMain(); void haccpDownloadMain(); 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); explicit FileProcessDlg(QDate startdt, QDate enddt, QWidget *parent = 0); ~FileProcessDlg(); private slots: void on_ctrBtnCancel_clicked(); void infodataDownload(); void servicedataDownload(); void programDownload(); void programUpload(); void configDownload(); void configUpload(); void haccpdataDownload(); void standardInfoUpload(); signals: 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; QDate m_dtStart; QDate m_dtEnd; bool m_bRst; }; #endif // FILEPROCESSDLG_H