|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "IxSerDes.h"
|
|
|
|
|
#include "IxPtyPano.h"
|
|
|
|
|
#include "ZxXpf.h"
|
|
|
|
|
#include "ZxSerializer.h"
|
|
|
|
|
|
|
|
|
|
#include "ZxBaseUtil.h"
|
|
|
|
|
#include "mModuleDefines.h"
|
|
|
|
|
|
|
|
|
|
#include "mSubWnd_global.h"
|
|
|
|
|
|
|
|
|
|
class ZxMainWindow;
|
|
|
|
|
class ZxMdiSubWindow;
|
|
|
|
|
class ZxTabWidget;
|
|
|
|
|
class ZxPtyDock;
|
|
|
|
|
class iDockBaseWx;
|
|
|
|
|
|
|
|
|
|
class ZxDataWell;
|
|
|
|
|
class ZxDataJobInfo;
|
|
|
|
|
class ZxDataGaugeBase;
|
|
|
|
|
|
|
|
|
|
class ZxPlot;
|
|
|
|
|
class iGuiPlot;
|
|
|
|
|
class ZxRenderItem;
|
|
|
|
|
|
|
|
|
|
class ZxRstJobWnd;
|
|
|
|
|
|
|
|
|
|
// 各类型窗体MDI类型
|
|
|
|
|
#define s_MdiType_DataManager "DataManager"
|
|
|
|
|
#define s_MdiType_DataEdit "DataEdit"
|
|
|
|
|
#define s_MdiType_DataAnal "DataAnal"
|
|
|
|
|
#define s_MdiType_DataIPR "DataIPR"
|
|
|
|
|
#define s_MdiType_DataMiniFr "DataMiniFr"
|
|
|
|
|
#define s_MdiType_DataAnalDn "DataDesign"
|
|
|
|
|
#define s_MdiType_DataFit "DataFit"
|
|
|
|
|
#define s_MdiType_DataConfig "DataConfig"
|
|
|
|
|
#define s_MdiType_ResCompare "ResCompare"
|
|
|
|
|
#define s_MdiType_DataNum "DataNum"
|
|
|
|
|
#define s_MdiType_Free "Free"
|
|
|
|
|
|
|
|
|
|
// 子窗体基类
|
|
|
|
|
class M_SUB_WND_EXPORT iSubWnd : public QMainWindow,
|
|
|
|
|
virtual public IxSerDes
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/// @brief 子窗体基类构造
|
|
|
|
|
/// @param parent:父
|
|
|
|
|
/// @param sExt指的是辅助信息,如操作的表名等等
|
|
|
|
|
explicit iSubWnd(QWidget *parent = 0, QString sExt = "");
|
|
|
|
|
~iSubWnd();
|
|
|
|
|
|
|
|
|
|
void setMainWindow(ZxMainWindow* p); //主窗体
|
|
|
|
|
|
|
|
|
|
virtual void initUI(); //初始化入口
|
|
|
|
|
virtual void configWnd(); //配置窗体
|
|
|
|
|
virtual void loadData(QString sWell = ""); //加载数据
|
|
|
|
|
virtual void runUpdate(); //刷新
|
|
|
|
|
virtual void firstLoadAndUpdate(); //窗体初始后允许数据加载及刷新
|
|
|
|
|
virtual bool onConfirmClosing(); //窗体关闭之前的确认
|
|
|
|
|
virtual void onActivated(); //当前窗体激活时被调用
|
|
|
|
|
virtual void finalDeals(); //窗体完成并且在显示之前,允许再做些调整
|
|
|
|
|
|
|
|
|
|
void setProgressBar(QProgressBar* p); //进度条传递
|
|
|
|
|
|
|
|
|
|
virtual void setDataWell(ZxDataWell* p); //操作对象井传递
|
|
|
|
|
ZxDataWell* getDataWell();
|
|
|
|
|
|
|
|
|
|
void setWndID(QString sID); //窗体ID
|
|
|
|
|
QString getWndID();
|
|
|
|
|
|
|
|
|
|
// 为了触发消息,新增标题修改函数,触发
|
|
|
|
|
void setWndTag(QString s);
|
|
|
|
|
|
|
|
|
|
// 是否强制创建MDI
|
|
|
|
|
bool isForcedMdiWnd();
|
|
|
|
|
|
|
|
|
|
void setMdiWndType(QString sType); //窗体MdiWndType
|
|
|
|
|
QString getMdiWndType();
|
|
|
|
|
|
|
|
|
|
void setMdiChild(ZxMdiSubWindow *p);
|
|
|
|
|
ZxMdiSubWindow* getMdiChild();
|
|
|
|
|
ZxTabWidget* getTabWx();
|
|
|
|
|
|
|
|
|
|
// 临时变量,对应的窗体Obj
|
|
|
|
|
virtual void setRstJobWnd(ZxRstJobWnd* p);
|
|
|
|
|
ZxRstJobWnd* getRstJobWnd();
|
|
|
|
|
|
|
|
|
|
// 执行命令:通常来自Ribbon
|
|
|
|
|
virtual bool runCmdBy(QString sName, QString sID);
|
|
|
|
|
|
|
|
|
|
/// @brief 命令是否Enabled的状态判断,通常来自Ribbon
|
|
|
|
|
/// @param b (out),true:Enabled false:disabled
|
|
|
|
|
/// @param sName (in),Cmd Name
|
|
|
|
|
/// @param nID (in),Cmd ID
|
|
|
|
|
/// @param bLicensed (in),当前是否有授权
|
|
|
|
|
/// @return 本窗体是否已经进行状态判断(即属于本窗体可执行的命令)
|
|
|
|
|
virtual bool checkCmdEnable(bool &b, \
|
|
|
|
|
QString sName, int nID, \
|
|
|
|
|
bool bLicensed);
|
|
|
|
|
|
|
|
|
|
// 辅助信息
|
|
|
|
|
void setExt(QString s);
|
|
|
|
|
QString getExt();
|
|
|
|
|
|
|
|
|
|
// readonly
|
|
|
|
|
void setReadonly(bool b);
|
|
|
|
|
bool isReadonly();
|
|
|
|
|
|
|
|
|
|
// 对于缓存已经保存的压力流量进行刷新处理
|
|
|
|
|
void addTempSavedPFs(QString sCode);
|
|
|
|
|
virtual void freshByTempSavedPFs();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
void keyPressEvent(QKeyEvent* e);
|
|
|
|
|
|
|
|
|
|
// 序列化
|
|
|
|
|
virtual void onSerialize(ZxSerializer* ser);
|
|
|
|
|
virtual void onDeserialize(ZxSerializer* ser);
|
|
|
|
|
virtual void onDeserialized();
|
|
|
|
|
|
|
|
|
|
// Rst
|
|
|
|
|
virtual bool saveRstInfoToArr(QByteArray& v, IxSerDes*& pSerObj);
|
|
|
|
|
virtual bool loadRstInfoFromArr(QByteArray& v, IxSerDes*& pSerObj);
|
|
|
|
|
|
|
|
|
|
// graph
|
|
|
|
|
virtual bool loadOnePlot(ZxPlot*& p, QByteArray& v);
|
|
|
|
|
virtual bool saveOnePlot(ZxPlot* p, QByteArray& v);
|
|
|
|
|
|
|
|
|
|
// 保存加载
|
|
|
|
|
virtual bool loadRss();
|
|
|
|
|
virtual bool saveRss();
|
|
|
|
|
virtual bool _runSaveRss(ZxRstJobWnd* pRstWnd);
|
|
|
|
|
virtual bool _runLoadRss(ZxRstJobWnd* pRstWnd);
|
|
|
|
|
|
|
|
|
|
// 状态
|
|
|
|
|
virtual void setModified(bool b);
|
|
|
|
|
virtual bool isModified();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 初始化参数
|
|
|
|
|
virtual void initStyleSheets(); //Sheet
|
|
|
|
|
|
|
|
|
|
// 初始化UI
|
|
|
|
|
virtual void initUiMain();
|
|
|
|
|
virtual QWidget* initUiMainWx();
|
|
|
|
|
virtual void initUiDockPtys();
|
|
|
|
|
virtual void initUiDockToolBar();
|
|
|
|
|
virtual void initUiDockWxs();
|
|
|
|
|
|
|
|
|
|
// 绑定属性载体
|
|
|
|
|
virtual void bindDockPty(IxPtySource* pPtyObj);
|
|
|
|
|
|
|
|
|
|
// 绑定图形信号
|
|
|
|
|
virtual void bindChartSignals(iGuiPlot* pWxPlot);
|
|
|
|
|
|
|
|
|
|
// 执行命令:通常来自图形右侧/左侧的工具栏
|
|
|
|
|
virtual bool runActionOf(QString sAction);
|
|
|
|
|
|
|
|
|
|
// 权限验证
|
|
|
|
|
bool checkLicensed(bool bPromptLicenseDlg = false);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
// 当通过外界创建了一个PF数据后,刷新到TreeCtrl
|
|
|
|
|
void sigPfObjFinished(ZxDataGaugeBase* p);
|
|
|
|
|
|
|
|
|
|
// 窗体的大小,附带需要所在的MDI进行变化
|
|
|
|
|
// 0: Normal 1 Max 2 Min
|
|
|
|
|
void sigMdiChildShow(int);
|
|
|
|
|
|
|
|
|
|
// m_pRstWnd为空时,提醒父窗体进行创建指定
|
|
|
|
|
void sigNeedCreateRstWnd(bool& );
|
|
|
|
|
|
|
|
|
|
// 进度条
|
|
|
|
|
void sigShowProgressAbout(bool);
|
|
|
|
|
|
|
|
|
|
// 触发信号刷新Ribbon按钮状态
|
|
|
|
|
void sigFreshRnStates();
|
|
|
|
|
|
|
|
|
|
// 触发信息,关闭或者显示左侧工区数据树
|
|
|
|
|
void sigLeftTreeDocksVisible(bool);
|
|
|
|
|
|
|
|
|
|
/// @brief 在SubWnd中创建Dock并且显示至主窗体之中,该Dock由SubWnd进行管理
|
|
|
|
|
/// @param pDockWx (in) Dock指针
|
|
|
|
|
/// @param areaDefault(in) 默认布局区域
|
|
|
|
|
void sigAppendDock2Main(iDockBaseWx* pDockWx, \
|
|
|
|
|
Qt::DockWidgetArea areaDefault = Qt::LeftDockWidgetArea);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
// 进度条
|
|
|
|
|
virtual void slotPrsRangeSet(int nMin, int nMax);
|
|
|
|
|
virtual void slotPrsValueSet(int nPos);
|
|
|
|
|
virtual void slotPrsFormatSet(QString s);
|
|
|
|
|
|
|
|
|
|
// Toolbar按钮消息响应
|
|
|
|
|
virtual void slotBtnTriggered();
|
|
|
|
|
virtual void slotGraphItemPoliciesInstalled(ZxRenderItem*);
|
|
|
|
|
|
|
|
|
|
// 当前窗体所有信息的保存,比如关闭时提问的保存
|
|
|
|
|
virtual bool slotSaveAll();
|
|
|
|
|
|
|
|
|
|
virtual void slotShowProperty();
|
|
|
|
|
virtual void updateView();
|
|
|
|
|
|
|
|
|
|
// 获取当前主窗口有多少Fit窗口(即;Anal对应的Fitting窗口,也可以扩展为其他同类)
|
|
|
|
|
virtual void slotGetBrotherFitWnds(QMap<QString, iSubWnd*>& map);
|
|
|
|
|
|
|
|
|
|
// 属性模板
|
|
|
|
|
virtual void slotItemPropertyTempl(IxPtySource* p,
|
|
|
|
|
bool bLoad,
|
|
|
|
|
bool bSelf);
|
|
|
|
|
|
|
|
|
|
// 外部传递已修改信号
|
|
|
|
|
virtual void slotGuiPlotModified(bool b);
|
|
|
|
|
|
|
|
|
|
// 从子控件触发Action
|
|
|
|
|
virtual void slotChildActioned(QString sAction, bool& b);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
virtual void paintEvent(QPaintEvent *);
|
|
|
|
|
|
|
|
|
|
// /// @brief 拖拽支持
|
|
|
|
|
// void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
|
// void dropEvent(QDropEvent* event);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 主窗体
|
|
|
|
|
ZxMainWindow* m_pMainWindow;
|
|
|
|
|
|
|
|
|
|
// toolbar、属性等成员变量
|
|
|
|
|
QToolBar* m_pToolBar;
|
|
|
|
|
ZxPtyDock* m_pDockPty;
|
|
|
|
|
QList<IxPtySource*> m_listProps;
|
|
|
|
|
|
|
|
|
|
// 辅助信息,如操作的表名等等
|
|
|
|
|
QString m_sExt;
|
|
|
|
|
|
|
|
|
|
// MdiSubWnd Type
|
|
|
|
|
QString m_sMdiWndType;
|
|
|
|
|
|
|
|
|
|
// 该窗体是否显示ToolBar
|
|
|
|
|
bool m_bShowToolbar;
|
|
|
|
|
|
|
|
|
|
// 与数据库对应的真实数据(外界传入,本类不进行创建释放维护)
|
|
|
|
|
ZxDataWell* m_pDataWell;
|
|
|
|
|
|
|
|
|
|
// ID
|
|
|
|
|
QString m_sWndID;
|
|
|
|
|
|
|
|
|
|
// 从属的Mdi窗口,内含TabWx,主窗口传递过来
|
|
|
|
|
ZxMdiSubWindow* m_pMdiChild; //
|
|
|
|
|
|
|
|
|
|
// 按钮类别,如需增加工具栏,只需在构造中对该变量赋值
|
|
|
|
|
QString m_sCmdType;
|
|
|
|
|
|
|
|
|
|
// 临时变量,对应的窗体Obj
|
|
|
|
|
bool m_bDeserialzing;
|
|
|
|
|
ZxRstJobWnd* m_pRstWnd;
|
|
|
|
|
|
|
|
|
|
// 临时变量
|
|
|
|
|
bool m_bModified;
|
|
|
|
|
|
|
|
|
|
// 进度条
|
|
|
|
|
QProgressBar* m_pProgressBar;
|
|
|
|
|
// 进度条刷新间隔
|
|
|
|
|
int m_nProgressLoop;
|
|
|
|
|
|
|
|
|
|
// 临时
|
|
|
|
|
bool m_bReadonly;
|
|
|
|
|
|
|
|
|
|
// 临时,当前涉及到的,可能得已经发生保存的压力/流量code,只需要刷新本视窗
|
|
|
|
|
QStringList m_listTempSavedPFs;
|
|
|
|
|
|
|
|
|
|
bool m_bUnableSP; //临时变量不参与序列化
|
|
|
|
|
|
|
|
|
|
// 是否启用新的样式表,ZXF202407,不参与序列化
|
|
|
|
|
bool m_bNovelQss;
|
|
|
|
|
|
|
|
|
|
// 该窗口是否强制创建MDI,比如流动段选择+试井设计+LPR+小型压裂准备 需要强制创建Mdi
|
|
|
|
|
bool m_bForcedMdiWnd;
|
|
|
|
|
};
|