|
|
|
|
|
#ifndef NMCALCULATIONDLLPEBISOLVERTASK_H
|
|
|
|
|
|
#define NMCALCULATIONDLLPEBISOLVERTASK_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QThread>
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|
|
#include "nmCalculationDefine.h"
|
|
|
|
|
|
#include "nmCalculation_global.h"
|
|
|
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
|
|
|
|
// 主窗口现在直接创建DLL求解线程任务,因此类需要导出,供nmSubWnd模块跨DLL使用。
|
|
|
|
|
|
class NMCALCULATION_EXPORT nmCalculationDllPebiSolverTask : public QThread {
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
nmCalculationDllPebiSolverTask(QString sPostprocessingDir,
|
|
|
|
|
|
QObject *parent = nullptr);
|
|
|
|
|
|
~nmCalculationDllPebiSolverTask();
|
|
|
|
|
|
|
|
|
|
|
|
void run();
|
|
|
|
|
|
// PSO 等待线程结束后通过该接口判断本次结果是否可以继续参与误差计算.
|
|
|
|
|
|
// 返回 false 时调用方会丢弃本次结果, 防止复用上一粒子留下的旧曲线.
|
|
|
|
|
|
bool wasSuccessful() const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
bool execute();
|
|
|
|
|
|
|
|
|
|
|
|
// 执行PEBI求解流程。
|
|
|
|
|
|
bool execPebiMode();
|
|
|
|
|
|
// 将PEBI求解结果保存回数据对象。
|
|
|
|
|
|
bool savePebiModeResult(HX_NWTM_MODEL_OUTPUT& p1, int modelType);
|
|
|
|
|
|
|
|
|
|
|
|
void logHX_NWTM_MODEL_INPUT_Simplified(const HX_NWTM_MODEL_INPUT& p0);
|
|
|
|
|
|
bool saveHX_NWTM_MODEL_INPUT_ToTxt(const HX_NWTM_MODEL_INPUT& p0, const QString& filePath);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
QString m_sPostprocessingDir;
|
|
|
|
|
|
// run() 在线程内保存 execute() 结果, 等待线程结束的调用方只读取该状态.
|
|
|
|
|
|
bool m_lastRunSucceeded;
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
//void slotTaskUpdateProgress();
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
void sig_calculateDone(bool isSuccessed);
|
|
|
|
|
|
//void sigTaskProgressUpdated(int progress);
|
|
|
|
|
|
//void sigResSolverProgressUpdated(int progress);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NMCALCULATIONDLLPEBISOLVERTASK_H
|