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.
nmWATI/Include/mTool/mToolPvt/iWxPvtMain.h

136 lines
3.4 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 "iWxPvtBase.h"
#include "mToolPvt_global.h"
class iWxRibbon;
class iRibbonXmlCmd;
class TreeWxConfig;
class iPseudo3Info;
class iPseudoCInfo;
class iWxPvtUtilItemPseudo;
class iWxPvtUtilItemPseudo3;
class iWxPvtUtilItemPseudoC;
class M_TOOL_PVT_EXPORT iWxPvtMain : public iWxPvtBase
{
Q_OBJECT
public:
iWxPvtMain(QWidget* parent = 0);
~iWxPvtMain();
/// @brief 设置PVT流体相态
/// @param listPhases所有相英文标识
/// @param sBasePhase基准相/主相,英文标识
/// @note:规定如果传入sBasePhase基准相/主相,则默认为解析,否则认为是数值
void setPhaseInfos(QStringList listPhases, \
QString sBasePhase = QString());
// 是否向导模式
void setWizardMode(bool b);
// 初始化
virtual void initUI();
virtual bool savePvt();
virtual bool loadPvt();
// 文件标识
virtual QString getFilePvtTag();
private:
//
void init();
//
// 初始化
void initUI_MainLayout();
void initUI_Tops();
void initUI_StackedWx();
void initUI_Bottoms();
// 具体的内容填充
void initStatckedWxs();
void createAndAppendSubWxByName(QString sName);
void calAndFreshPseu(bool bCreateIfFirst = true);
void calAndFreshPseu3(bool bCreateIfFirst = true);
void calAndFreshPseuC(bool bCreateIfFirst = true);
// 该Action是否必须执行
bool isActionMust(QString sAction, bool bApplyMode);
// 刷新
void refresh();
//
void runAction(QString sAction);
void refreshActionStates();
// 是否解析模式
bool isAnalMode();
// 是否包含相态
bool isPhaseIncluded(QString sPhase);
protected:
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent*);
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
public:
signals:
void sigPvtResultsChanged(QMap<QString, double>& map);
void sigPseudoResults(VVecDouble& vvec);
void sigPseudoResults3(const VVecDouble&, const QMap<QString, iPseudo3Info*>&, const QMap<QString, double>&);
void sigPseudoResultsC(const VVecDouble&, const QMap<QString, iPseudoCInfo*>&, const QMap<QString, double>&);
private slots:
void slotBtnTriggered();
void slotBtnHelp();
void slotBtnApply();
void slotBtnOK();
void slotBtnCancel();
// 某项参数计算结果数据更改
void slotParaRstDataChanged(QString sPara);
void slotActionByRibbon(QWidget* pCtrl,
iRibbonXmlCmd* pInfo,
QVariant o);
/// @brief 响应当Heade中流体选项发生改变时
/// @param nMain 大类,常规/特殊/状态方程
/// @param vecSubs 子类,油/气/水/凝析
void slotHeaderOptionFluidChanged(int nMain, VecInt& vecSubs);
private:
// 规定如果m_sBasePhase非空则默认为解析否则认为是数值
// 对于解析:区分是否主相
QString m_sBasePhase;
// 对于解析:包括哪些相
// 对于数值:包括哪些相
QStringList m_listPhases;
// Ribbon
iWxRibbon* m_pRibbon;
// 子窗体与Cmd的ID一一对应
QMap<QString, iWxPvtBase*> m_mapSubWxs;
// 布局相关
QVBoxLayout* m_pMainLayout;
QStackedWidget* m_pStackedWx;
// 是否向导模式
bool m_bWizardMode;
};