|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "iGuiPlot.h"
|
|
|
|
|
#include "iDlgBase.h"
|
|
|
|
|
#include "ZxSegmentInfo.h"
|
|
|
|
|
|
|
|
|
|
class ZxTableView;
|
|
|
|
|
class ZxTableModel;
|
|
|
|
|
class ZxObjCurveBase;
|
|
|
|
|
class ZxObjCurveFlow;
|
|
|
|
|
class ZxObjCurvePressure;
|
|
|
|
|
class ZxObjCurve;
|
|
|
|
|
class ZxObjBase;
|
|
|
|
|
class iGuiPlotPFCmdHelper;
|
|
|
|
|
|
|
|
|
|
/// @brief 针对PF上下显示的需求,特创建本类
|
|
|
|
|
/// @note 本类基于 iGuiPlotEx 的部分功能
|
|
|
|
|
class M_GUI_PLOT_EXPORT iGuiPlotPF : public iDlgBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
explicit iGuiPlotPF(QString sExt, QWidget *parent = 0);
|
|
|
|
|
~iGuiPlotPF();
|
|
|
|
|
|
|
|
|
|
// 初始化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);
|
|
|
|
|
|
|
|
|
|
// 为确保一致性,updatePlots中调用updateBrotherTables
|
|
|
|
|
virtual void runUpdate();
|
|
|
|
|
void reBindTwo();
|
|
|
|
|
bool freshDataOfPF(QVector<ZxDataGaugeBase*>& vecObjs);
|
|
|
|
|
|
|
|
|
|
// 设置图上数据、线的类型(点或者线)
|
|
|
|
|
// 这是一次性设置数据,需要外界显示调用runUpdate刷新
|
|
|
|
|
void setCurveData(QVector<iCurveDesc> vecCurveDesc);
|
|
|
|
|
void changeCurveData(QString sKey, iCurveDesc o);
|
|
|
|
|
// 分配
|
|
|
|
|
void allocateData();
|
|
|
|
|
|
|
|
|
|
// 获取两条线的数据点(绘图对象)
|
|
|
|
|
bool getChartDataXYOfPF(QVector<QPointF>& vec, bool bPressure, \
|
|
|
|
|
QString* pStrCodeF = NULL);
|
|
|
|
|
// 获取两条线的绘图对象
|
|
|
|
|
bool getChartDataObjOfPF(ZxObjCurveBase*& p, bool bPressure);
|
|
|
|
|
// 获取两条线的数据对象
|
|
|
|
|
bool getDataObjOfPF(ZxDataGaugeBase*& p, bool bPressure);
|
|
|
|
|
|
|
|
|
|
// 模拟右键双击
|
|
|
|
|
bool runClickBySimulation();
|
|
|
|
|
|
|
|
|
|
// 信号关联
|
|
|
|
|
void bindTwoPlots();
|
|
|
|
|
|
|
|
|
|
// 建议流动段上下对比调整过程时,随时保存入库
|
|
|
|
|
// 建议采取折中方案,每次流动段弹窗前保存一下
|
|
|
|
|
// 20211216 Added 数据 编辑 也用该函数
|
|
|
|
|
void runPossibleSave();
|
|
|
|
|
bool isPossibleModified();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
// 选定的流动段在当前压力曲线
|
|
|
|
|
// 数据的位置索引(第几个点,从0开始)
|
|
|
|
|
bool prepareSegInfo(ZxSegmentInfo* p);
|
|
|
|
|
bool checkCurrentPF(ZxObjCurvePressure*& pCurveP, \
|
|
|
|
|
ZxObjCurveFlow*& pCurveF);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
void initUI_MainLayout();
|
|
|
|
|
void initUI_P(QString sTitle, QSize sz);
|
|
|
|
|
void initUI_F(QString sTitle, QSize sz);
|
|
|
|
|
void initUI_SplitterPF();
|
|
|
|
|
void initUI_Table();
|
|
|
|
|
void initUI_ToolBar();
|
|
|
|
|
void initUI_SumUp();
|
|
|
|
|
|
|
|
|
|
// 基础Signal
|
|
|
|
|
void buildBaseSignals(bool bP);
|
|
|
|
|
|
|
|
|
|
// Table改变时,刷新曲线
|
|
|
|
|
void refreshCurveBy(ZxTableModel* p, bool bRightColOnly = false);
|
|
|
|
|
QVector<QPointF> getVecPtFrom(VVecVariant& vvecData);
|
|
|
|
|
ZxObjCurve* checkObjCurveFrom(ZxTableModel* pTableModel, \
|
|
|
|
|
QString& sTag);
|
|
|
|
|
iGuiPlot* checkPlotWxFrom(ZxTableModel* pTableModel, \
|
|
|
|
|
QString& sTag);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
virtual void paintEvent(QPaintEvent *);
|
|
|
|
|
|
|
|
|
|
virtual void updateBrotherTables();
|
|
|
|
|
|
|
|
|
|
// 信号关联
|
|
|
|
|
void bindPlotWithTable(ZxPlot *pPlot, ZxObjCurveBase* pCurve, ZxTableView* pTableView);
|
|
|
|
|
|
|
|
|
|
// 获取当前显示的视图中的曲线
|
|
|
|
|
bool getAllVisibleCurves(QVector<ZxObjCurveBase*>& vec);
|
|
|
|
|
bool getAllVisibleCurvesOf(iGuiPlot* p, QVector<ZxObjCurveBase*>& vec);
|
|
|
|
|
bool getCurveDescByName(QString s, iCurveDesc& o);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
// 表格
|
|
|
|
|
void slotTableCellChanged(const QModelIndex& Index, const QModelIndex& nIndex);
|
|
|
|
|
void slotTableRowChanged(QModelIndexList listOlds, QModelIndexList listNews, QModelIndex index);
|
|
|
|
|
// 表格选中
|
|
|
|
|
void slotSubTableSelChanged();
|
|
|
|
|
|
|
|
|
|
// Curve
|
|
|
|
|
void slotCurveSelChanged(bool bSelect);
|
|
|
|
|
void slotCurvePtsChanged();
|
|
|
|
|
// 压力数据,PointState改变
|
|
|
|
|
void slotPressPsChanged(int nIndex, PointState psOld, PointState psNew);
|
|
|
|
|
void slotNewRectSelection();
|
|
|
|
|
|
|
|
|
|
// flow
|
|
|
|
|
void slotFlowVerPtsChanged(int nIndex, double fOld, double fNew);
|
|
|
|
|
void slotFlowSegCurIndexChanged();
|
|
|
|
|
|
|
|
|
|
// plot
|
|
|
|
|
void slotObjDeleted(ZxObjBase* p);
|
|
|
|
|
|
|
|
|
|
// 水平滚动条的同步
|
|
|
|
|
void slotHSrollBarValueChanged(int);
|
|
|
|
|
|
|
|
|
|
// splitter的响应
|
|
|
|
|
void slotSplitterMoved(int pos, int index);
|
|
|
|
|
|
|
|
|
|
// 双击处理(弹出右键流动段,或者 属性页)
|
|
|
|
|
void slotLeftDoubleClicked(const QPointF& pt);
|
|
|
|
|
|
|
|
|
|
// 重新调整ToolBar,此处只是接口传递一下
|
|
|
|
|
void slotToolbarBuilt(QToolBar*);
|
|
|
|
|
|
|
|
|
|
// 为了统一,把流动段方面的绘制提取出来了,而没有放在CurveFlow的类里
|
|
|
|
|
void slotGetBrotherObj(ZxObjBase*&);
|
|
|
|
|
void slotUpdateWhenFlowChanged();
|
|
|
|
|
|
|
|
|
|
// 在iGuiPlotTableHelper保存时,通过该信号获取对应的DataObj
|
|
|
|
|
void slotGetDataObjOfView(ZxTableView* pView, ZxDataGaugeBase*& p);
|
|
|
|
|
|
|
|
|
|
// 是否允许拖拽的响应处理
|
|
|
|
|
void slotCheckDropCurve(ZxDataGaugeBase* pObj, bool& bEnabled);
|
|
|
|
|
|
|
|
|
|
// 拖拽曲线的处理
|
|
|
|
|
void slotDealwithDropCurve(ZxDataGaugeBase* pObj, bool& b);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
// 一旦压力或流量保存之后,则触发其他窗口的刷新
|
|
|
|
|
void sigDataSavedPF(QString sCode);
|
|
|
|
|
|
|
|
|
|
// 当前选泽的流动段改变
|
|
|
|
|
void sigSegmentChanged(ZxSegmentInfo& o, bool bShowOptionWx);
|
|
|
|
|
|
|
|
|
|
// 当前流动段的参数改变,如移动水平线,此时仅仅刷新相应的结果视图
|
|
|
|
|
void sigSegmentParamsChanged(ZxSegmentInfo& o);
|
|
|
|
|
|
|
|
|
|
// 当GuiPlot的toolbar建立后触发,调用方可以做调整,
|
|
|
|
|
// 如增加一些按钮或控件
|
|
|
|
|
void sigToolbarBuilt(QToolBar*);
|
|
|
|
|
|
|
|
|
|
// 对整体布局允许用户进行调整
|
|
|
|
|
void sigAdjustUis(QSplitter* pSplitter);
|
|
|
|
|
|
|
|
|
|
// 弹出属性页(如果当前未显示)
|
|
|
|
|
void sigSetPtyVisible(bool);
|
|
|
|
|
|
|
|
|
|
// 仅仅触发双击事件
|
|
|
|
|
void sigDoubleClicked(ZxPlot* pPlotHit, \
|
|
|
|
|
bool bShowOptionWx, bool& bProcessed);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// 布局
|
|
|
|
|
QVBoxLayout* m_pMainLayout;
|
|
|
|
|
QSplitter* m_pSplitter;
|
|
|
|
|
QWidget* m_pWxChartM;
|
|
|
|
|
|
|
|
|
|
// 图形
|
|
|
|
|
iGuiPlot* m_pWxPlotP;
|
|
|
|
|
iGuiPlot* m_pWxPlotF;
|
|
|
|
|
|
|
|
|
|
// 曲线对应的描述信息map
|
|
|
|
|
QVector<iCurveDesc> m_vecCurveDesc;
|
|
|
|
|
|
|
|
|
|
// 辅助表格
|
|
|
|
|
iGuiPlotTableHelper* m_pTableHelper;
|
|
|
|
|
bool m_bShowTableHelper; //是否显示
|
|
|
|
|
int m_nPosMode; //在显示辅助表格时,表图的位置关系
|
|
|
|
|
//0:表左图右 1:表右图左
|
|
|
|
|
//2:表上图下 3:表下图上
|
|
|
|
|
|
|
|
|
|
// 图形统一的工具栏
|
|
|
|
|
iGuiPlotPFCmdHelper* m_pCmdHelper;
|
|
|
|
|
QWidget* m_pWxToolBar;
|
|
|
|
|
|
|
|
|
|
// 辅助信息 区分是 压力编辑、流量编辑还是 压力流量流动段选择
|
|
|
|
|
QString m_sExt;
|
|
|
|
|
};
|