|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "qglobal.h"
|
|
|
|
|
#if (QT_VERSION >= 0x050000)
|
|
|
|
|
#include <QtWebEngineWidgets/QtWebEngineWidgets>
|
|
|
|
|
#define QWebView QWebEngineView
|
|
|
|
|
#else
|
|
|
|
|
#include <QtWebKit/QWebView>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "iWxPvtBase.h"
|
|
|
|
|
#include "mToolPvt_global.h"
|
|
|
|
|
|
|
|
|
|
class iAlgPvtBase;
|
|
|
|
|
class iWxPvtPhaseParaCal;
|
|
|
|
|
class iWxPvtSubHeader;
|
|
|
|
|
class iWxPvtUtilItem;
|
|
|
|
|
|
|
|
|
|
class ZxMdiArea;
|
|
|
|
|
class iPvtParaItem;
|
|
|
|
|
class iWxPvtPhaseParaPlot;
|
|
|
|
|
class ZxRenderItem;
|
|
|
|
|
|
|
|
|
|
class ZxPtyDock;
|
|
|
|
|
class IxPtySource;
|
|
|
|
|
|
|
|
|
|
class ZxObjCurve;
|
|
|
|
|
|
|
|
|
|
class ZxTableView;
|
|
|
|
|
class ZxTableModel;
|
|
|
|
|
class iPvtParaItemGroup;
|
|
|
|
|
class iPvtParaCalRst;
|
|
|
|
|
|
|
|
|
|
class M_TOOL_PVT_EXPORT iWxPvtSubPhase : public iWxPvtBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
explicit iWxPvtSubPhase(QString sFluidType, \
|
|
|
|
|
QString sPhaseType, \
|
|
|
|
|
QWidget *parent = 0);
|
|
|
|
|
~iWxPvtSubPhase();
|
|
|
|
|
|
|
|
|
|
// 设置关联
|
|
|
|
|
void setBindInfos(iWxPvtSubHeader* pSubHeader);
|
|
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
virtual void initUI();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 默认值
|
|
|
|
|
virtual void initDefault();
|
|
|
|
|
|
|
|
|
|
virtual void initLayouts();
|
|
|
|
|
virtual void initMethodLists();
|
|
|
|
|
virtual void dealWithMethodItemExt(QGridLayout* pLayout, \
|
|
|
|
|
QString sPara, int r, int& c);
|
|
|
|
|
virtual void fillParaMethods();
|
|
|
|
|
|
|
|
|
|
iPvtParaItem* getPvtParaConfig(QString sPara);
|
|
|
|
|
|
|
|
|
|
void prepareAlgCalObj();
|
|
|
|
|
|
|
|
|
|
// 主要是为了顺序
|
|
|
|
|
QStringList getCheckedMethodList(QString sPara, bool bIncludeX);
|
|
|
|
|
|
|
|
|
|
// 默认模拟勾选第一个
|
|
|
|
|
void simuCheckFirstOne();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 程序启动,即把所有的参数先计算一遍
|
|
|
|
|
void calAndCacheAll(bool bUpdatePlotsIfChecked);
|
|
|
|
|
void recalAndCacheOf(QString sPara, bool bUpdatePlotsIfChecked);
|
|
|
|
|
virtual void cacheAlgRst(QString sPara, QString sMethodBase, \
|
|
|
|
|
QMap<QString, VecDouble>& mapRs, \
|
|
|
|
|
QPointF& ptRs, QPointF& ptReferPb);
|
|
|
|
|
|
|
|
|
|
// 各个Pvt参数具体涉及到的算法
|
|
|
|
|
void dealwithPvtItemAlgos();
|
|
|
|
|
void dealwithPvtItemAlgos_O(QString sPara);
|
|
|
|
|
void dealwithPvtItemAlgos_G(QString sPara);
|
|
|
|
|
void dealwithPvtItemAlgos_Gc();
|
|
|
|
|
void dealwithPvtItemAlgos_W(QString sPara);
|
|
|
|
|
void dealwithAlgoBindings(); //绑定算法类
|
|
|
|
|
|
|
|
|
|
iPvtParaItemGroup* getCurPvtGroup();
|
|
|
|
|
|
|
|
|
|
void bindDockPty(IxPtySource* pPtyObj);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 绘图相关
|
|
|
|
|
bool freshPlotOf(QString sPara, bool bVisible);
|
|
|
|
|
iWxPvtPhaseParaPlot* getSubPlotBy(QString sPara, \
|
|
|
|
|
bool bExistForced, \
|
|
|
|
|
bool bVisibleForced);
|
|
|
|
|
iWxPvtPhaseParaPlot* initSubPlotBy(QString sPara);
|
|
|
|
|
bool updateSubPlotBy(iWxPvtPhaseParaPlot* pWxPlot, QString sPara);
|
|
|
|
|
void closeSubPlotBy(QString sPara);
|
|
|
|
|
|
|
|
|
|
void relayoutSubWnds();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 表格相关
|
|
|
|
|
virtual void initSubTableAbouts();
|
|
|
|
|
virtual bool setActiveTableAboutsOf(QString sPara);
|
|
|
|
|
bool updateSubTableAboutsBy(QString sMethodBase, QString sPara);
|
|
|
|
|
void updateSubTableDataBy(QString sPara);
|
|
|
|
|
void updateSubTableTitleBy(QString sPara, QString sMethodBase);//指定第2列为table,只有table特殊
|
|
|
|
|
//virtual void refreshTable(ZxObjCurve* pCurve, QString sPara, bool bChangeTitle);
|
|
|
|
|
//void closeSubTableAbouts(QString sPara);
|
|
|
|
|
|
|
|
|
|
virtual void fillTableViewWithDefault(ZxTableView* pTableView, QString sPara);
|
|
|
|
|
virtual void changeTableTitles(ZxTableModel* pTableModel, \
|
|
|
|
|
ZxObjCurve* pCurve = NULL);
|
|
|
|
|
|
|
|
|
|
// 显示常数部分
|
|
|
|
|
virtual void showConstAbouts(QString sPara, bool bVisible);
|
|
|
|
|
|
|
|
|
|
// 表格只读
|
|
|
|
|
virtual void setTableEditable(QString sPara, bool bEditable);
|
|
|
|
|
|
|
|
|
|
void freshByConstChange(QString sPara);
|
|
|
|
|
void freshByTableChange(QString sPara);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
virtual void paintEvent(QPaintEvent*);
|
|
|
|
|
virtual void resizeEvent(QResizeEvent*);
|
|
|
|
|
|
|
|
|
|
virtual void onSerialize(ZxSerializer* ser);
|
|
|
|
|
virtual void onDeserialize(ZxSerializer* ser);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
// 窗体构建及图窗口构建过程中涉及的信号
|
|
|
|
|
virtual void slotToolbarBuilt(QToolBar* pToolBar);
|
|
|
|
|
virtual void slotGuiPlotModified(bool b);
|
|
|
|
|
virtual void slotSubPlotWxActivated(QMdiSubWindow* p);
|
|
|
|
|
virtual void slotPlotAreaClicked(const QPointF&);
|
|
|
|
|
virtual void slotConfirmCloseSubWxs(bool& bClosable);
|
|
|
|
|
virtual void slotSubWxClosed();
|
|
|
|
|
|
|
|
|
|
// 自行调整,绘图视图下侧的内容显示
|
|
|
|
|
virtual void slotAdjustPlotBottomLayout(QString sPara, QHBoxLayout*& pLayoutH);
|
|
|
|
|
|
|
|
|
|
virtual void slotGraphItemPoliciesInstalled(ZxRenderItem*);
|
|
|
|
|
|
|
|
|
|
// 当选择变化时发射,传递复选框选中的索引和单选框的索引
|
|
|
|
|
virtual void slotPvtParaMethodChanged(const QVector<int>& vecIndexCbx, int indexRadio);
|
|
|
|
|
virtual void slotPvtParaPlotChecked();
|
|
|
|
|
|
|
|
|
|
// 计算时,对于参数的设定
|
|
|
|
|
virtual void slotDealwithAlgoMembers(iAlgPvtBase*& p);
|
|
|
|
|
|
|
|
|
|
// 获取表格数据
|
|
|
|
|
virtual void slotGetPvtTableData(QString sPara, VVecVariant& vvec);
|
|
|
|
|
virtual void slotGetPvtConstData(QString sPara, double& d);
|
|
|
|
|
void slotConstValueChanged(QString s);
|
|
|
|
|
|
|
|
|
|
// 参数结果结果获得
|
|
|
|
|
virtual void slotPvtAlgResult(QString sPara, QString sMethodBase, \
|
|
|
|
|
QMap<QString, VecDouble>& mapRs, \
|
|
|
|
|
QPointF& ptRs, QPointF& ptReferPb, \
|
|
|
|
|
bool bUpdatePlotsIfChecked);
|
|
|
|
|
|
|
|
|
|
// 图上选中了某一条曲线
|
|
|
|
|
virtual void slotCurveSelected(ZxObjCurve* pCurve, bool bSelected);
|
|
|
|
|
|
|
|
|
|
// 这是各个Item触发
|
|
|
|
|
//void slotItemParaMethodChanged(QString sPara, QString sMethod);
|
|
|
|
|
|
|
|
|
|
// 获取Pb压力值
|
|
|
|
|
void slotDealwithReferPb(QPointF& pt);
|
|
|
|
|
|
|
|
|
|
// 表格
|
|
|
|
|
void slotTableCellChanged(const QModelIndex&, const QModelIndex&);
|
|
|
|
|
void slotTableRowChanged(QModelIndexList listOlds, QModelIndexList listNews, QModelIndex index);
|
|
|
|
|
|
|
|
|
|
/// @brief 响应:当Header触发参数数据更改时,比如压力数据范围改变
|
|
|
|
|
void slotHeaderOptionDataChanged();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
// 某些计算结果数据更改
|
|
|
|
|
void sigParaRstDataChanged(QString sPara);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// 从当前所有的信息中获取参数的值
|
|
|
|
|
virtual bool getPvtParaValue(QString s, double& d);
|
|
|
|
|
virtual bool getParaValue(QString sPara,
|
|
|
|
|
double &fValue,
|
|
|
|
|
QString sUnitDest = "");
|
|
|
|
|
|
|
|
|
|
// 获取结果
|
|
|
|
|
virtual bool getAllResults(QMap<QString, double>& mapResults);
|
|
|
|
|
|
|
|
|
|
// 获取类似Zg、Cg的页面的原始数据
|
|
|
|
|
virtual bool getRawDataOf(QString sPara, VecDouble& x, VecDouble& y);
|
|
|
|
|
virtual bool getRawDataOf(QString sPara, VVecVariant& vvec);
|
|
|
|
|
|
|
|
|
|
virtual bool savePvt();
|
|
|
|
|
|
|
|
|
|
// 文件标识
|
|
|
|
|
virtual QString getFilePvtTag();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// FluidType,这是主类型
|
|
|
|
|
QString m_sFluidType;
|
|
|
|
|
// PhaseType,相类型
|
|
|
|
|
QString m_sPhaseType;
|
|
|
|
|
// 当前相 涉及的所有参数标识,通常英文
|
|
|
|
|
QStringList m_listAllParas;
|
|
|
|
|
|
|
|
|
|
// SubHeader
|
|
|
|
|
iWxPvtSubHeader* m_pSubHeader;
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
|
// 布局
|
|
|
|
|
QSplitter* m_pSplitter; //拆分器
|
|
|
|
|
|
|
|
|
|
QVBoxLayout* m_pLayoutOptions; //左侧选项
|
|
|
|
|
QGroupBox* m_pGbxMethods; //左侧:方法选择区
|
|
|
|
|
QMap<QString, QComboBox*> m_mapCmbParas; //左侧:方法下拉缓存
|
|
|
|
|
QMap<QString, QCheckBox*> m_mapCbxParas; //左侧:方法是否勾选缓存
|
|
|
|
|
|
|
|
|
|
ZxMdiArea* m_pMdiArea; //中间绘图区域
|
|
|
|
|
QMap<QString, iWxPvtPhaseParaPlot*> m_mapPvtItemPlots;//中间:绘图缓存
|
|
|
|
|
|
|
|
|
|
QTabWidget* m_pTabWxTables; //右侧显示区(多个)
|
|
|
|
|
QStackedWidget* m_pStackedTableWx;//右侧:表格区
|
|
|
|
|
//QMap<QString, QHBoxLayout*> m_mapLayoutConsts; //右侧:常数项
|
|
|
|
|
QMap<QString, QVector<QWidget*> > m_mapWxConsts; //右侧:常数项
|
|
|
|
|
QMap<QString, ZxTableView*> m_mapTableViews; //右侧:表格
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// 算法类,与参数标识对应
|
|
|
|
|
QMap<QString, iAlgPvtBase*> m_mapPvtAlgs;
|
|
|
|
|
iWxPvtPhaseParaCal* m_pAlgCal;
|
|
|
|
|
|
|
|
|
|
// 特殊方法的标识,与配置xml文件要对应,而且必须放在列表的最前面
|
|
|
|
|
QStringList m_listSpecialMethodTags; //所有
|
|
|
|
|
|
|
|
|
|
// 计算结果缓存(当前相的所有计算结果,以 参数标识 为键值)
|
|
|
|
|
QMap<QString, iPvtParaCalRst*> m_mapAllRsDatas;
|
|
|
|
|
|
|
|
|
|
// 常数
|
|
|
|
|
QMap<QString, double> m_mapConstValues;
|
|
|
|
|
|
|
|
|
|
// 临时不涉及序列化
|
|
|
|
|
QMap<QString, iPvtParaItem*> m_mapCachedPvtDefineItems;
|
|
|
|
|
bool m_bMethodItemExt; //是否在Method右侧增加按钮扩展列
|
|
|
|
|
|
|
|
|
|
// 属性框
|
|
|
|
|
ZxPtyDock* m_pDockPty;
|
|
|
|
|
QList<IxPtySource*> m_listProps;
|
|
|
|
|
|
|
|
|
|
bool m_bModified;
|
|
|
|
|
};
|