63 lines
1.8 KiB
C++
63 lines
1.8 KiB
C++
/* 用于单个谱文件分析时的状态(流程)提示
|
|
* 通过对话框类 AnalyseFlowChart 启动一个线程 FlowThread
|
|
* 线程负责分析运算,并将分析状态通过信号传递给对话框类,由对话框类显示接收到的状态 */
|
|
|
|
#ifndef ANALYSEFLOWCHART_H
|
|
#define ANALYSEFLOWCHART_H
|
|
|
|
#include <QThread>
|
|
#include "DataStore.h"
|
|
#include "GammaAnalyAlgLib.h"
|
|
#include "GammaAnalyALG.h"
|
|
#include <QJsonDocument>
|
|
#include <QJsonObject>
|
|
#include <QJsonArray>
|
|
#include <QFile>
|
|
|
|
|
|
class FlowThread : public QThread
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
//FlowThread(PHDFile *phd, QMap<QString, NuclideLines> mapNucLines, stdvec vc, QString strPath, ThrCallBack callFunc, QObject *parent = 0);
|
|
FlowThread(DataStore *store, QString strPath, ThrCallBack callFunc, QObject *parent = 0);
|
|
~FlowThread();
|
|
|
|
protected:
|
|
void run();
|
|
|
|
signals:
|
|
void state_changed(int);
|
|
|
|
private:
|
|
GammaAnalyALG *alg; // 算法类指针
|
|
PHDFile *m_phd; // 谱文件结构指针
|
|
DataStore *m_store;
|
|
QMap<QString, NuclideLines> m_mapNucLines; // 用户核素库中核素射线信息
|
|
stdvec m_vCount; // 当前谱计数
|
|
QString m_strPath;
|
|
ThrCallBack m_callFunc;
|
|
};
|
|
|
|
class AnalyseFlow : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AnalyseFlow(DataStore *store, QString strPath, ThrCallBack callFunc, QObject *parent = 0);
|
|
~AnalyseFlow();
|
|
|
|
void SetSampleType(bool bUpdate); // 设置样品类型,样品类型不同,处理流程不同
|
|
|
|
private:
|
|
|
|
bool m_bUpdate; // 是否需要显示“刻度更新模块”的状态流程
|
|
QString style_run; // 运行状态样式
|
|
QString style_wait; // 等待状态样式
|
|
QString style_finish; // 完成状态样式
|
|
DataStore *m_store;
|
|
FlowThread *m_flowThread; // 算法处理线程指针
|
|
};
|
|
|
|
#endif // ANALYSEFLOWCHART_H
|