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/nmNum/nmSubWnd/nmSubWndDemo.h

136 lines
3.3 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 "iSubWndBaseAF.h"
#include "nmSubWnd_global.h"
class ZxObjBase;
class ZxObjCurve;
class ZxDataObject;
class nmGuiPlot;
class ZxTableView;
class iDockBaseWx;
class nmWxParaProperty;
class NM_SUB_WND_EXPORT nmSubWndDemo : public iSubWndBaseAF
{
Q_OBJECT
public:
explicit nmSubWndDemo(QWidget *parent = 0, QString sExt = "");
~nmSubWndDemo();
// 配置窗体
virtual void configWnd();
// 初始化UI
virtual void initUI();
virtual QWidget* initUiMainWx();
virtual void initUiDockWxs();
virtual void initUiDockPtys();
#ifdef QT_DEBUG
// 示例演示增加Dock并且追加至程序主窗口
void initUiTop();
#endif
// 窗体初始后允许数据加载及刷新
virtual void firstLoadAndUpdate();
// 窗体创建完毕之后的尾处理
virtual void finalDeals();
// 当前窗体激活时被调用
virtual void onActivated();
#ifdef QT_DEBUG
// 更新左右Dock数据
void updateDockWxs();
// 更新图形
void updatePlots();
/// @brief 从当前井获取压力数据
/// @param sType 具体类型,比如压力、流量、温度等
/// @param sCode 指定Code如果不指定则返回满足条件的第一条
ZxDataObject* getDataObjOf(QString sType, QString sCode = "");
// 把曲线数据刷新至表格
void updateTableByCurve(ZxObjCurve* pObjCurve, ZxTableView* pTableView);
#endif
// 序列化
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
virtual void onDeserialized();
// 成果保存加载
virtual bool loadRss();
virtual bool saveRss();
// 窗体关闭之前的确认
virtual bool onConfirmClosing();
protected:
// 绑定图形信号
virtual void bindChartSignals(iGuiPlot* pWxPlot);
// 重新调整工具栏
virtual void reAdjustToolbar(QToolBar*);
public:
// 执行命令:通常来自图形右侧/左侧的工具栏
virtual bool runActionOf(QString sAction);
// 执行命令通常来自Ribbon
virtual bool runCmdBy(QString sName, QString sID);
/// @brief 命令是否Enabled的状态判断通常来自Ribbon
/// @param b (out)trueEnabled falsedisabled
/// @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);
signals:
public slots:
// Obj选择状态改变
void slotObjSelChanged(ZxObjBase*, bool);
// Obj数据发生了改变
void slotObjPtsChanged(ZxObjBase*);
// 当前窗体所有信息的保存,比如关闭时提问的保存
virtual bool slotSaveAll();
private:
// 绘图相关
nmGuiPlot* m_pWxPlot;
iDockBaseWx* m_pWxDockParas; //模型参数
nmWxParaProperty* m_pWxParas;
iDockBaseWx* m_pWxDockData1; //表格数据样例1
ZxTableView* m_pTableView1;
iDockBaseWx* m_pWxDockData2; //表格数据样例2
ZxTableView* m_pTableView2;
#ifdef QT_DEBUG
// 示例演示增加Dock并且追加至程序主窗口
iDockBaseWx* m_pWxDockTemp;
QListWidget* m_pListWxTemp;
#endif
};