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.
nmWTAI-Platform/Include/mGui/mGuiAnal/iWxPfModelFit.h

92 lines
2.5 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "iWxPfModel.h"
class zxAlgRegress;
class M_GUI_ANAL_EXPORT iWxPfModelFit : public iWxPfModel
{
Q_OBJECT
public:
explicit iWxPfModelFit(QString sPfModelName, QWidget *parent = 0);
~iWxPfModelFit();
// 外部调用
virtual void initUI();
protected:
// 初始化
virtual void initUI_Tops();
// 拟合相关设置的初始化
void _changeFitOptions();
bool _getCurrentFitOptions(DataFittingType& oType, int& nOrder);
// 表达式
QString _getCurrentDefaultExpr();
QString _getDefaultExprOf(DataFittingType oType, int nOrder);
void _freshExpr(QString s);
protected slots:
// 拟合控件
virtual void slotFitTypeChanged(int index);
virtual void slotOrderChanged(int arg1);
// 拟合
virtual void on_btnRunFit_clicked();
protected:
/// @brief 表格及图形刷新,其实就是 freshChartByTableChange
virtual void refreshByTopFitOptions();
/// @brief 调整后的数据进行绘图/拟合等相关操作
/// @note vvecRaw表格中原始数据
/// @note vvecProcessed为调整后数据组织形式仍然是表格 getData 返回的形式
virtual void refreshChart(const VVecVariant& vvecRaw, const VVecVariant& vvecProcessed);
// 添加拟合曲线
virtual bool _appendFitCurve(const VecDouble& vecX, \
const VecDouble& vecY, \
iDefineChartCurve* pDC, \
iGuiPlot* pWxPlot);
protected:
// 拟合过程封装
virtual bool _runAlgFit(const VVecVariant& vvec, VecDouble& vecX, VecDouble& vecY);
void _makesureAlg(DataFittingType oType, int nOrder, bool bForceReset = true);
bool _getDefaultFitRsBy(const VVecVariant& vvec, \
VecDouble& x, VecDouble& y, \
bool bScaled = true);
/// @brief 创建算法对象之后,可以进行约束设定
virtual void _restrainCurentAlg(zxAlgRegress* pAlg);
// 清除内容,状态
void clearAlg();
protected:
/// @brief 计算结果并且组织成文本形式
void _calAndOrgaParaRsts();
/// @brief 具体的结果组织,注意,键值如果配置,则自动,否则则走默认
virtual bool _calModelParaRsts(QMap<QString, double>& mapParas);
/// @brief 组织参数形式
virtual QString _orgaParaOf(QString sPara, double d);
/// @brief 结果刷新
void _freshParaRsts(QString s);
protected:
zxAlgRegress* m_pAlg;
QString m_sParaRsts;
};