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.
69 lines
1.7 KiB
C++
69 lines
1.7 KiB
C++
#ifndef WORKMGRCTLR_H
|
|
#define WORKMGRCTLR_H
|
|
|
|
#include <QObject>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QVariantMap>
|
|
#include <QFileInfoList>
|
|
#include <QJsonObject>
|
|
#include <QJsonArray>
|
|
#include <QJsonValue>
|
|
#include <QJsonDocument>
|
|
#include "IWheelCtrl.h"
|
|
struct SimuItem{
|
|
QString key;
|
|
QStringList strDefectList;
|
|
QString strAbout;
|
|
bool bUse;
|
|
SimuItem(){ };
|
|
};
|
|
class QWorkMgrCtlr : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
QWorkMgrCtlr(IWheelCtrl *ptr, QObject *parent = 0);
|
|
~QWorkMgrCtlr();
|
|
void setFormulaHeader(QString headerStr){ };
|
|
void setTargetFile(QString filepath);
|
|
void clear();
|
|
void readManageFile();
|
|
void saveManageFile();
|
|
QStringList getItemKeys();
|
|
QStringList *getItemKeysPtr(){ return &strs; };
|
|
void RowChange(int from, int to);
|
|
bool AddItem(QString key, SimuItem nItem);
|
|
bool delItem(QString key);
|
|
bool ModItem(QString oldkey, SimuItem nItem);
|
|
bool ModAllItem(const QString &str);
|
|
SimuItem * getItem(QString key);
|
|
void setDebugModel(int nmodel){ nDebugmodel = nmodel; };
|
|
QStringList getDefectList(){
|
|
if (ForUse.isEmpty())
|
|
{
|
|
if (mMagerMap.size() > 0)
|
|
return mMagerMap.first().strDefectList;
|
|
else
|
|
return QStringList();
|
|
}
|
|
return mMagerMap.value(ForUse).strDefectList; };
|
|
void setDefectStr(QString str){ ForUse = str; };
|
|
QString getDetectStr(){ return ForUse; };
|
|
protected:
|
|
bool ReadJsonFile(QString filePath, QJsonObject &obj);
|
|
bool SaveJsonFIle(QString filePath, QJsonObject &obj);
|
|
private:
|
|
QString predictFile;
|
|
QMap<QString, SimuItem> mMagerMap;
|
|
QStringList strs;//show to list
|
|
QString strAppPath;
|
|
int nDebugmodel;
|
|
QString ForUse;
|
|
IWheelCtrl *m_pCtrl;
|
|
signals:
|
|
void sgValueMap(QVariantMap);
|
|
};
|
|
#endif // WORKMGRCTLR_H
|