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/mSubWnd/iSubWndDataPF.h

112 lines
3.4 KiB
C

#pragma once
#include "iSubWndData.h"
class ZxDataWell;
class iPlotCurveWxT;
class ZxDataGaugeBase;
class M_SUB_WND_EXPORT iSubWndDataPF : public iSubWndData
{
Q_OBJECT
public:
explicit iSubWndDataPF(QWidget *parent = 0, QString sExt = "");
~iSubWndDataPF();
// 配置窗体
virtual void configWnd();
virtual void runUpdate(); //刷新
virtual void setColWidths();
virtual bool loadDataBy(QString sTable, QString sFilterWellCode);
virtual void simuAutoLoad(); //如果没有数据,则自动弹出加载
protected:
// 初始化UI
virtual QWidget* initUiMainWx();
virtual void initUiDockToolBar();
// 执行命令:通常来自图形右侧/左侧的工具栏
virtual bool runActionOf(QString sAction);
public slots:
// 具体的按钮按钮操作
virtual void slotDataLoadP();
virtual void slotDataLoadF();
// 数据加载信号相应
void slotPfObjSaved(ZxDataGaugeBase* p);
virtual void slotSaveDatabase();
// 表格删除行时,对应删除数据库数据
// 如果sError非常证明未删除成功
virtual void slotRemoveRowsOfDB(int nRowFrom, int nRowTo, QString& sError);
virtual void slotTableCellClicked(const QModelIndex &index);
virtual void slotDataTableModified();
void slotSubTableSelChanged();
virtual void slotTableCellChanged(const QModelIndex& Index, const QModelIndex& nIndex);
// 主要是为了,右键删除之后,刷新右侧图
virtual void slotRowDeleted(QModelIndexList listOlds, QModelIndexList listNews, QModelIndex index);
protected:
void activeByTableMain(int nIndexRow, int nIndexCol);
void activeByTableSub(int nIndexCol, bool foceRedraw = false);
void freshRightSubByCode(QString sCode);
VVecVariant convertBa(QByteArray& ba, bool forceConvert = false);
virtual bool scanInfosByTable(QString sTable, QString& sSql);
// 20240613启用隐藏列故该方式不再启用
/// @brief 对数据做一些特殊处理,比如隐藏某些列的处理
/// @param bLoad :
/// true load+show(隐藏)
/// false save(Add)
/// @param vvec (in & out)
/// @param listTitles (in & out)
// virtual void adjustData(bool bLoadMode, \
// VVecVariant& vvec, \
// QStringList* pListTitles = NULL, \
// bool bTitlesOnly = false);
// 更新辅助表格
void refreshBindTable(VVecVariant& vvec);
QString getTitleOfCol(int indexOGW);
QString getTitleNameOfCol(int indexOGW);
QString getTitleUnitOfCol(int indexOGW);
// 更新辅助图形
void refreshBindChart(QByteArray& ba, \
int indexOGW, QString sWellInfo = "");
void refreshBindChart(VecDouble& vecX, VecDouble& vecY, \
int indexOGW, \
QString sWellInfo = "");
// 保存
bool saveOneGauge();
bool sumCurGaugeData(QByteArray& ba);
// 保存数据
virtual bool _saveData(VVecVariant& vvec);
// 和一开始的备份对比是否修改
bool isRowDataChanged(VecVariant& vec);
// 对于缓存已经保存的压力流量进行刷新处理
virtual void freshByTempSavedPFs();
private:
ZxTableView* m_pTableViewBind; //辅助显示(压力+流量)
iPlotCurveWxT* m_pPlotWx;
bool m_bGaugeModeF; //在m_bGaugeMode为true时有效
int m_nLastSubCol;
ZxDataWell* m_pWell;
};