|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "iWxPvtBase.h"
|
|
|
|
|
#include "mToolPvt_global.h"
|
|
|
|
|
|
|
|
|
|
class iAlgPvtBase;
|
|
|
|
|
class iGuiPlot;
|
|
|
|
|
class ZxTableView;
|
|
|
|
|
class ZxTableModel;
|
|
|
|
|
class iWxPvtSubHeader;
|
|
|
|
|
class M_TOOL_PVT_EXPORT iWxPvtUtilItem : public iWxPvtBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
explicit iWxPvtUtilItem(QWidget *parent = 0);
|
|
|
|
|
~iWxPvtUtilItem();
|
|
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
virtual void initUI();
|
|
|
|
|
|
|
|
|
|
// 传递参数
|
|
|
|
|
virtual void setInfos(QString sFluidType, QString sPhaseType, QString sPara);
|
|
|
|
|
|
|
|
|
|
// 设置选项,从外界
|
|
|
|
|
virtual void selectMethod(QString s);
|
|
|
|
|
|
|
|
|
|
// 设置关联
|
|
|
|
|
virtual void setBindInfos(iWxPvtSubHeader* pSubHeader);
|
|
|
|
|
|
|
|
|
|
// 设置算法载体
|
|
|
|
|
virtual void setAlgPvt(iAlgPvtBase* p);
|
|
|
|
|
|
|
|
|
|
// 返回原始的两列数据
|
|
|
|
|
virtual bool getRawData(VecDouble& x, VecDouble& y);
|
|
|
|
|
virtual bool getRawData(VVecVariant& vvec);
|
|
|
|
|
|
|
|
|
|
// 计算点
|
|
|
|
|
virtual bool calResultPos(QPointF& pt);
|
|
|
|
|
virtual bool calReferPbPos(QPointF& pt);
|
|
|
|
|
|
|
|
|
|
// 返回数据
|
|
|
|
|
virtual bool getParaValue(QString sPara,
|
|
|
|
|
double &fValue,
|
|
|
|
|
QString sUnitDest = "");
|
|
|
|
|
|
|
|
|
|
virtual void forceMethodChanged();
|
|
|
|
|
|
|
|
|
|
// 文件标识
|
|
|
|
|
virtual QString getFilePvtTag();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
virtual void initUI_MainLayout();
|
|
|
|
|
virtual void initUI_MethodOptions();
|
|
|
|
|
virtual void initUI_MainViews();
|
|
|
|
|
virtual QWidget* initUI_Chart();
|
|
|
|
|
virtual QWidget* initUI_TableView();
|
|
|
|
|
virtual void fillTableViewWithDefault();
|
|
|
|
|
virtual void initUI_Others();
|
|
|
|
|
virtual void initUI_Others_Btns(QHBoxLayout* pLayoutH);
|
|
|
|
|
virtual void initUI_Others_Paras(QHBoxLayout* pLayoutH);
|
|
|
|
|
virtual void changeOthersBtns(QString s);
|
|
|
|
|
virtual void changeOthersParas(QString s);
|
|
|
|
|
virtual void fuzzyLayoutWH(int n, int& szW, int& szH);
|
|
|
|
|
|
|
|
|
|
void runZgMatch();
|
|
|
|
|
void getMathExps(VecPointF& vec);
|
|
|
|
|
void updateMatchPlot(VecDouble x, VecDouble y, VecPointF vecExps);
|
|
|
|
|
void freshPpcs(double fPpc, double fPpcNew = -1.f);
|
|
|
|
|
|
|
|
|
|
// check是否温度模式
|
|
|
|
|
virtual void checkIfModeT();
|
|
|
|
|
// check是否需要考虑PB压力点
|
|
|
|
|
virtual void checkIfPbConsidered();
|
|
|
|
|
|
|
|
|
|
// 算法有多少种
|
|
|
|
|
virtual void dealwithMethods();
|
|
|
|
|
// 标题
|
|
|
|
|
virtual void dealwithTitles();
|
|
|
|
|
|
|
|
|
|
// 刷新
|
|
|
|
|
virtual void refresh();
|
|
|
|
|
virtual void refreshByMethod(QString s);
|
|
|
|
|
virtual bool refreshByMethod_C(QString s, VecDouble& x, VecDouble& y); //通用方法
|
|
|
|
|
virtual bool refreshByMethod_S(QString s, VecDouble& x, VecDouble& y); //特殊方法如Table等
|
|
|
|
|
virtual void refreshChart(VVecVariant& vvec);
|
|
|
|
|
virtual void refreshChart(VecDouble& x, VecDouble& y);
|
|
|
|
|
virtual void refreshTable(VecDouble& x, VecDouble& y);
|
|
|
|
|
virtual void refreshHitPoint();
|
|
|
|
|
virtual void clearChart();
|
|
|
|
|
|
|
|
|
|
// 表格数据改变
|
|
|
|
|
virtual void freshChartByTableChange();
|
|
|
|
|
// Const数据改变
|
|
|
|
|
virtual void freshChartByConstChange();
|
|
|
|
|
|
|
|
|
|
// 显示常数部分
|
|
|
|
|
virtual void showConstAbouts(bool bVisible);
|
|
|
|
|
// 表格只读
|
|
|
|
|
virtual void setTableEditable(bool bEditable);
|
|
|
|
|
|
|
|
|
|
// 获取当前选中的方法在算法类中的类型(剔除Table、Const等特殊)
|
|
|
|
|
virtual int getMethodSubType();
|
|
|
|
|
// 根据不同方法,对算法类赋值
|
|
|
|
|
virtual void setMemberValuesOfAlgo();
|
|
|
|
|
|
|
|
|
|
// 获取x方向数据
|
|
|
|
|
virtual void getVecX(VecDouble& x);
|
|
|
|
|
|
|
|
|
|
// 计算点
|
|
|
|
|
virtual double calResultPosY(double fX, QString sMethod);
|
|
|
|
|
|
|
|
|
|
// 辅助信息
|
|
|
|
|
virtual void dealwithDesc();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
virtual void paintEvent(QPaintEvent*);
|
|
|
|
|
virtual void resizeEvent(QResizeEvent*);
|
|
|
|
|
|
|
|
|
|
virtual void onSerialize(ZxSerializer* ser);
|
|
|
|
|
virtual void onDeserialize(ZxSerializer* ser);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
virtual void slotHeaderOptionDataChanged();
|
|
|
|
|
virtual void slotMethodChanged();
|
|
|
|
|
|
|
|
|
|
void slotConstValueChanged(QString s);
|
|
|
|
|
|
|
|
|
|
// 表格
|
|
|
|
|
void slotTableCellChanged(const QModelIndex&, const QModelIndex&);
|
|
|
|
|
void slotTableRowChanged(QModelIndexList listOlds, QModelIndexList listNews, QModelIndex index);
|
|
|
|
|
|
|
|
|
|
// match 功能,20210718
|
|
|
|
|
void slotBtnZgMatchPrepare();
|
|
|
|
|
void slotBtnZgMatchRun();
|
|
|
|
|
void slotCbxZgMatchUsePpc();
|
|
|
|
|
void slotZgMatchExpData(VVecVariant& vvecData);
|
|
|
|
|
|
|
|
|
|
// 凝析气参数设置
|
|
|
|
|
void slotDiffDpRatioGPP();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
void sigMethodSelected(QString sPara, QString sMethod);
|
|
|
|
|
void sigMemberValueNeeded(iAlgPvtBase*& );
|
|
|
|
|
void sigReferPbNeeded(QPointF& pt);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// FluidType,这是主类型
|
|
|
|
|
QString m_sFluidType;
|
|
|
|
|
// PhaseType,相类型
|
|
|
|
|
QString m_sPhaseType;
|
|
|
|
|
// 当前计算的参数对象,通常英文
|
|
|
|
|
QString m_sPara;
|
|
|
|
|
|
|
|
|
|
// 当前参数对象计算方法有几种
|
|
|
|
|
QStringList m_listMethods;
|
|
|
|
|
// 特殊方法的标识,与配置xml文件要对应,而且必须放在列表的最前面
|
|
|
|
|
QStringList m_listSpecialMethodTags; //所有
|
|
|
|
|
|
|
|
|
|
// Radio选项
|
|
|
|
|
QVector<QRadioButton*> m_vecRadios;
|
|
|
|
|
|
|
|
|
|
// Group
|
|
|
|
|
QGroupBox* m_pGbxMethods;
|
|
|
|
|
|
|
|
|
|
// 布局
|
|
|
|
|
QVBoxLayout* m_pMainLayout;
|
|
|
|
|
|
|
|
|
|
// 辅助信息显示
|
|
|
|
|
QLabel* m_pLblDesc;
|
|
|
|
|
|
|
|
|
|
// SubHeader
|
|
|
|
|
iWxPvtSubHeader* m_pSubHeader;
|
|
|
|
|
|
|
|
|
|
// 对应的实体类
|
|
|
|
|
iAlgPvtBase* m_pAlgPvt;
|
|
|
|
|
|
|
|
|
|
// 绘图/表格展示
|
|
|
|
|
iGuiPlot* m_pWxPlot;
|
|
|
|
|
ZxTableView* m_pTableView;
|
|
|
|
|
ZxTableModel* m_pTableModel;
|
|
|
|
|
|
|
|
|
|
// 坐标轴
|
|
|
|
|
QString m_sTitleX;
|
|
|
|
|
QString m_sTitleY;
|
|
|
|
|
QString m_sUnitX;
|
|
|
|
|
QString m_sUnitY;
|
|
|
|
|
|
|
|
|
|
// 结果的点
|
|
|
|
|
QPointF m_ptResult;
|
|
|
|
|
QPointF m_ptReferPb;
|
|
|
|
|
|
|
|
|
|
// Const
|
|
|
|
|
double m_fConst;
|
|
|
|
|
QVector<QWidget*> m_vecConstCtrls;
|
|
|
|
|
|
|
|
|
|
// 是否温度模式
|
|
|
|
|
bool m_bModeT;
|
|
|
|
|
|
|
|
|
|
// 是否需要考虑PB压力点
|
|
|
|
|
bool m_bReferPbConsidered;
|
|
|
|
|
|
|
|
|
|
// 当前选项
|
|
|
|
|
QString m_sLastMethod;
|
|
|
|
|
|
|
|
|
|
// match 功能,20210718
|
|
|
|
|
QPushButton* m_pBtnZgMatchPrepare;
|
|
|
|
|
QPushButton* m_pBtnZgMatchRun;
|
|
|
|
|
QLabel* m_pLblPpcs;
|
|
|
|
|
QCheckBox* m_pCbxUsePpc;
|
|
|
|
|
|
|
|
|
|
VVecVariant m_vvecExps; //match需要的edit数据
|
|
|
|
|
|
|
|
|
|
QLineEdit* m_pTbxGPP;
|
|
|
|
|
QLabel* m_pLblGPP;
|
|
|
|
|
|
|
|
|
|
};
|