73 lines
1.9 KiB
C++
73 lines
1.9 KiB
C++
#ifndef SRUNNINGPROCESS
|
|
#define SRUNNINGPROCESS
|
|
#include <QObject>
|
|
#include <memory>
|
|
#include <QVector>
|
|
#include "sutilclass.h"
|
|
#include <QTimer>
|
|
#include "scompanyprocess.h"
|
|
#include "serrorprocess.h"
|
|
|
|
class SRunningProcess:public QObject
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
enum class E_PROCESS_MODE
|
|
{
|
|
WAIT = 0,
|
|
RUN
|
|
};
|
|
|
|
public:
|
|
SRunningProcess();
|
|
bool isRunning();
|
|
void setList(const QVector<SEffectRow>& _list);
|
|
void setList(QVector<SEffectRow>&& _list);
|
|
void setList(const QVector<int>& _list);
|
|
void setList(QVector<int>&& _list);
|
|
template <typename T>
|
|
void start(QVector<T>&& _list);
|
|
|
|
public slots:
|
|
void update();
|
|
void stop();
|
|
void start();
|
|
|
|
private:
|
|
void terminate();
|
|
void initConnect();
|
|
|
|
private slots:
|
|
void slotLog(const QString& _strLog);
|
|
void slotUserAbort();
|
|
void slotCompanyComplete(int _num);
|
|
void slotSuccessErrorCompany(int _num);
|
|
void slotTerminateError();
|
|
void slotTerminateNormal();
|
|
void slotCompanyOutDated(const QVector<int>& _vecCompanyNum);
|
|
void slotCompanyStart(int _companyNum);
|
|
|
|
|
|
signals:
|
|
void signalLog(const QString& _strLog);
|
|
void signalUserAbort();
|
|
void signalTerminateNormal(const QVector<SEffectRow>& _error,
|
|
const QMap<int, SReportSummary>& _report);
|
|
void signalTerminateError();
|
|
void signalCompanyComplete(int _num, const SReportSummary& summary);
|
|
void signalSuccessErrorCompany(int _num);
|
|
void signalCompanyOutDated(const QVector<int>& _vecCompanyNum);
|
|
void signalCompanyStart(int _companyNum);
|
|
|
|
private:
|
|
std::unique_ptr<QTimer> m_pTimer;
|
|
std::shared_ptr<SErrorProcess> m_pErrorProcess;
|
|
std::shared_ptr<SCompanyProcess> m_pCompanyProcess;
|
|
E_PROCESS_MODE m_eMode;
|
|
|
|
std::shared_ptr<SParentProcess> m_pCurrentProcess;
|
|
};
|
|
|
|
#endif // SRUNNINGPROCESS
|
|
|