You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
2.8 KiB
C++
102 lines
2.8 KiB
C++
#ifndef RTask_H
|
|
#define RTask_H
|
|
|
|
#include "lpbengine.h"
|
|
#include "qimage.h"
|
|
|
|
#define BE_KEY_TASK_IMAGE "originImage"
|
|
#define BE_KEY_ALGO_EXEC_TIME "algotime"
|
|
#define BE_KEY_TASK_EXEC_TIME "tasktime"
|
|
#define BE_KEY_ALGO_RLT "algoRlt"
|
|
|
|
class CDetectorTask : public IDetectorTask
|
|
{
|
|
public:
|
|
CDetectorTask();
|
|
virtual ~CDetectorTask();
|
|
virtual IDetectorROI* AddROI(const PLP_DETECTOR_ROI pROI, bool bRet = true);
|
|
virtual bool DeleteROI(int nROIID);
|
|
virtual IDetectorROI* GetROI(int nROIID);
|
|
virtual int EnumROI(IDetectorROI** lppROI, int nCount);
|
|
|
|
virtual IDetectorAlgorithm* AddAlgorithm(const PLP_DETECTOR_ALGORITHM pAlgorithm, bool bRet = true);
|
|
virtual bool DeleteAlgorithm(int nAlgorithmID);
|
|
virtual IDetectorAlgorithm* GetAlgorithm(int nAlgorithmID);
|
|
virtual int GetAlgorithmCount();
|
|
virtual QMap<int, IDetectorAlgorithm*> GetAllAlgorithms();
|
|
|
|
virtual bool SetTaskInfo(const PLP_DETECTOR_TASK pTask);
|
|
virtual PLP_DETECTOR_TASK GetTaskInfo();
|
|
virtual QString GetTaskName();
|
|
void SetID(int nID);
|
|
virtual int GetID() const;
|
|
virtual int GetAlgoBaseID() const;
|
|
virtual void Release();
|
|
bool Initialize(IDetectorSolution* pSolution, IAlgorithmLibMgr* pAlgoLibMgr);
|
|
|
|
bool SerializePropertyToJson(QJsonObject* pJsonObject);
|
|
bool SerializePropertyFromJson(QJsonObject* pJsonObject);
|
|
|
|
virtual bool Copy(IDetectorTask* pSrcTask, bool bRet = true);
|
|
|
|
void CleanUp();
|
|
|
|
virtual bool SetRunAlgo(int nAlgoID);
|
|
virtual IDetectorAlgorithm* GetRunAlgo();
|
|
|
|
virtual IDetectorSolution* GetParentSolution();
|
|
|
|
virtual QVariant GetSystemInfoValue(const QString &key);
|
|
|
|
virtual bool PushImage(PLP_DETECTOR_IMAGE_CACHE_DATA pImageData);
|
|
|
|
virtual void SaveUserParamValue();
|
|
virtual void LoadUserParamValue();
|
|
virtual void ClearUserParamValue();
|
|
|
|
virtual bool SaveFile(const QString& strPath);
|
|
virtual bool LoadFile(const QString& strPath);
|
|
virtual bool RemoveFile();
|
|
virtual bool RenameFile(QString strOldName, QString strNewName);
|
|
virtual bool AppendOtherFile(QString strpath);
|
|
|
|
bool SerializeToJson(QJsonObject& jsonObject);
|
|
bool SerializeFromJson(QJsonObject* pJsonObject);
|
|
|
|
virtual bool Exec();
|
|
|
|
virtual bool IsRunning() const {
|
|
return m_bRunning;
|
|
}
|
|
|
|
virtual double ExecTime() const { return m_dExecTime; }
|
|
virtual bool SyncMapResult(const QVariantMap& vMap);
|
|
|
|
virtual QString GetPath() { return m_taskPath; }
|
|
virtual void SetPath(QString path) { m_taskPath = path; }
|
|
protected:
|
|
int GetProductCount();
|
|
|
|
private:
|
|
int m_nID;
|
|
int m_nBaseID;
|
|
int m_nAlgorithmBaseID;
|
|
int m_nRunAlgoID;
|
|
LP_DETECTOR_TASK m_tTask;
|
|
QVector<IDetectorROI*> m_vecROI;
|
|
QMap<int, IDetectorAlgorithm*> m_mapAlgorithm;
|
|
|
|
IDetectorSolution* m_pSolution;
|
|
IAlgorithmLibMgr* m_pAlgoLibMgr;
|
|
|
|
bool m_bRunning;
|
|
double m_dExecTime;
|
|
std::string _strPath;//图像路径
|
|
|
|
QString strtempImgPath;
|
|
QString strParamFilePath;
|
|
QStringList strPathList;
|
|
QString m_taskPath;
|
|
};
|
|
|
|
#endif // RTask_H
|