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/nmPlot/nmGuiPlot.h

90 lines
2.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 "iGuiPlot.h"
#include "nmDefines.h"
#include "nmPlot_global.h"
class nmObjBase;
// 数值试井绘图载体的样例
class NM_PLOT_EXPORT nmGuiPlot : public iGuiPlot
{
Q_OBJECT
public:
explicit nmGuiPlot(bool bUseBtn = true, QWidget *parent = 0);
~nmGuiPlot();
// 初始化UI
virtual void initUI(QString sTitle, QSize szDefault = QSize(265, 203));
// 初始化Sheet
void initSheets();
// 初始化布局
virtual void initMainLayout();
QWidget* initChartLayout(QString sTitle, QSize szDefault);
// 刷新图形
virtual void runUpdate();
// Action命令执行
virtual bool runAction(QString sAction);
// 创建添加一个Obj
nmObjBase* appendOneObj(NM_Obj_Type o, QString& sName, QVector<QPointF>& vec);
nmObjBase* _createOneObj(NM_Obj_Type o, QString& sName);
// 绑定绘图对象的信号
void bindObjSignals(ZxObjBase* pObj);
#ifdef QT_DEBUG
/// @brief 刷新指定的绘图对象
/// @param sName 绘图对象名称
/// @param vecX 数据点
/// @param vecY 绘图对象名称
/// @param bPressureLike 压力模式还是流量模式,通常都是压力模式
/// @param bUseY2 是否启用第二y轴右侧
/// @param bClearAll 刷新指定绘图对象时,是否把原有所有绘图对象清除
ZxObjBase* updatePlotObjBy(QString sName, \
VecFloat& vecX, VecFloat& vecY, \
bool bPressureLike = true, \
bool bUseY2 = false, \
bool bClearAll = false);
#endif
public slots:
// Obj选择状态改变
void slotObjSelChanged(bool);
// Obj数据发生了改变
void slotObjPtsChanged();
signals:
// 绘图对象选择状态发生改变
void sigObjSelChanged(ZxObjBase*, bool);
// 绘图对象数据点发生改变
void sigObjPtsChanged(ZxObjBase*);
public:
// 序列化
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
// 反序列化后把数据重新加入m_mapCurveData与m_mapCurveType
virtual void resetAfterDeserialized();
protected:
// 绘制Painter函数重载
virtual void paintEvent(QPaintEvent *);
};