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/mGui/mGuiPlot/iGuiPlotEx.h

79 lines
2.2 KiB
C

#pragma once
#include "iGuiPlot.h"
class ZxTableView;
class ZxTableModel;
class ZxObjCurveBase;
class ZxObjBase;
/// @brief 该类基于iGuiPlot增加了辅助表格实现表图同步
class M_GUI_PLOT_EXPORT iGuiPlotEx : public iGuiPlot
{
Q_OBJECT
public:
explicit iGuiPlotEx(bool bUseBtn = true, QWidget *parent = 0);
~iGuiPlotEx();
// 初始化UI
virtual void initUI(QString sTitle, QSize szDefault = QSize(265, 203));
// 辅助表格设置
void setTableHelperVisible(bool b);
bool isTableHelperVisible();
int getPosMode();
/// @brief 设置位置信息只在显示table时有效
/// @param n 0:表左图右 1表右图左 2:表上图下 3表下图上
void setPosMode(int n);
// 设置表格只读,主要是右键及双击
void setTableReadonly(QString sTag = "", bool bReadonly = true);
protected:
virtual void paintEvent(QPaintEvent *);
QWidget* initTableLayout();
// 为确保一致性updatePlots中调用updateBrotherTables
virtual void updatePlots();
virtual void updateBrotherTables();
// 信号关联
void bindSignals(ZxObjCurveBase* pCurve, ZxTableView* pTableView);
public slots:
// 表格
void slotTableCellChanged(const QModelIndex&, const QModelIndex&);
void slotTableRowChanged(QModelIndexList listOlds, QModelIndexList listNews, QModelIndex index);
void slotSubTableSelChanged();
// Curve
void slotCurveSelChanged(bool bSelect);
void slotCurvePtsChanged();
// plot
void slotObjDeleted(ZxObjBase* p);
// 在iGuiPlotTableHelper保存时通过该信号获取对应的DataObj
void slotGetDataObjOfView(ZxTableView* pView, ZxDataGaugeBase*& p);
signals:
// 一旦压力或流量保存之后,则触发其他窗口的刷新
void sigDataSavedPF(QString sCode);
private:
// Table改变时刷新曲线
void refreshCurveBy(ZxTableModel* p);
public:
// 辅助表格
iGuiPlotTableHelper* m_pTableHelper;
bool m_bShowTableHelper; //是否显示
int m_nPosMode; //在显示辅助表格时,表图的位置关系
//0:表左图右 1表右图左
//2:表上图下 3表下图上
};