|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "TreeItemMain.h"
|
|
|
|
|
#include "TreeWxBase.h"
|
|
|
|
|
#include "TreeNodeDescBase.h"
|
|
|
|
|
|
|
|
|
|
class ZxDataObjectEx;
|
|
|
|
|
class ZxDataWell;
|
|
|
|
|
class ZxDataJobInfo;
|
|
|
|
|
class ZxRstJobUtils;
|
|
|
|
|
class ZxDataGaugeBase;
|
|
|
|
|
|
|
|
|
|
class M_GUI_TREE_EXPORT TreeWxMain : public TreeWxBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
TreeWxMain(QWidget* parent = 0);
|
|
|
|
|
~TreeWxMain();
|
|
|
|
|
|
|
|
|
|
// 全局项目指针
|
|
|
|
|
void setDataProject(ZxDataProject* p);
|
|
|
|
|
|
|
|
|
|
// 数据树与成果树需要相互关联+消息响应
|
|
|
|
|
void setBrother(TreeWxMain* p);
|
|
|
|
|
void setUnableSP(bool b);
|
|
|
|
|
|
|
|
|
|
// 根据某节点获取其父井节点的Code
|
|
|
|
|
virtual QString getParentWellCodeOf(TreeItemBase* p);
|
|
|
|
|
|
|
|
|
|
// 获取特定节点对应的井、Job信息
|
|
|
|
|
bool getObjCodeInfos(QTreeWidgetItem* p,
|
|
|
|
|
QString& sWell,
|
|
|
|
|
QString& sJob,
|
|
|
|
|
QString& sWndID);
|
|
|
|
|
|
|
|
|
|
// 当批量保存井基础数据后的刷新
|
|
|
|
|
// virtual void freshTreeEx();
|
|
|
|
|
|
|
|
|
|
// 刷新Brother
|
|
|
|
|
void freshBotherTreeWx();
|
|
|
|
|
|
|
|
|
|
// 根据井型油气水获取相应图标
|
|
|
|
|
static void getWellIcon(QString sType, QString& sIcon);
|
|
|
|
|
|
|
|
|
|
// 这是在SubWndData表格右键删除时,触发,然后借助树进行响应
|
|
|
|
|
// 不用tips进行确认,在此之前已经确认
|
|
|
|
|
virtual bool forceDelByDataObjs(QStringList& listKeys, \
|
|
|
|
|
QString& sTable, \
|
|
|
|
|
QString& sError);
|
|
|
|
|
virtual bool collectItemsOfDataObjs(QList<TreeItemBase*>& list, \
|
|
|
|
|
QStringList& listKeys, \
|
|
|
|
|
QString& sTable, \
|
|
|
|
|
QString& sError);
|
|
|
|
|
bool collectItemsOfDataCodes(TreeItemBase* pItemP, \
|
|
|
|
|
bool bTopLevelOnly, \
|
|
|
|
|
QStringList& listKeys, \
|
|
|
|
|
QList<TreeItemBase*>& listTrItems);
|
|
|
|
|
|
|
|
|
|
// 遍历查找所有井一级的节点
|
|
|
|
|
virtual bool findAllWellNodes(TreeItemBase* pItemP, \
|
|
|
|
|
QList<TreeItemBase*>& listTrItems);
|
|
|
|
|
|
|
|
|
|
// 遍历查找数据对象所关联的节点
|
|
|
|
|
virtual TreeItemMain* findItemNodeOf(ZxDataObject* pObj, TreeItemBase* pItemP);
|
|
|
|
|
// 拖拽时,暂时移走
|
|
|
|
|
virtual void takeawayItemNode(TreeItemBase* pItem);
|
|
|
|
|
// 插入节点
|
|
|
|
|
virtual void insertItemNode(TreeItemBase* pItem, TreeItemBase* pItemP, int nIndex);
|
|
|
|
|
// 查找父级节点(其中类型为oType)
|
|
|
|
|
virtual TreeItemMain* findParentItemNodeOf(TreeItemBase* pItem, MainTreeNodeType oType);
|
|
|
|
|
// 是否父级节点
|
|
|
|
|
virtual bool isParentLevelsOf(TreeItemBase* pItem, TreeItemBase* pItemP);
|
|
|
|
|
|
|
|
|
|
// 改变当前选项状态
|
|
|
|
|
virtual void modifyCurrentItemStates(QString sItemName, bool bInit);
|
|
|
|
|
|
|
|
|
|
// 保存时,确保树中的Node的存在
|
|
|
|
|
virtual TreeItemMain* makeureBlockNode(QString sBlockName);
|
|
|
|
|
virtual TreeItemMain* makeureWellNode(ZxDataWell* pWell);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 填充
|
|
|
|
|
virtual void fillTree();
|
|
|
|
|
|
|
|
|
|
// 填写树
|
|
|
|
|
//virtual void initTopLevels();
|
|
|
|
|
virtual void initTopLevels();
|
|
|
|
|
virtual void initTopLevel_OneBlock(QString sBlockName, \
|
|
|
|
|
TreeItemMain*& pItem, \
|
|
|
|
|
ZxDataObjectList& vecObjs);
|
|
|
|
|
virtual void initTopLevel_OneWell(ZxDataObject* p, \
|
|
|
|
|
TreeItemMain*& pItem, \
|
|
|
|
|
TreeItemMain* pItemP, \
|
|
|
|
|
bool bExcusive = true);
|
|
|
|
|
virtual void initSubLevels(TreeItemMain* pItem);
|
|
|
|
|
|
|
|
|
|
// 填写时,该数据对象是否考虑,比如填写成果树时,如果井下面没有成果则不考虑
|
|
|
|
|
virtual bool isDataObjConsidered(ZxDataObject* pObj);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 获取筛选后的区块名称(可能根据井进行适当筛选,比如没有成果的)
|
|
|
|
|
QStringList getFilteredBlocks(bool bAutoSort = true);
|
|
|
|
|
|
|
|
|
|
// 初始化节点信息,从INi获取
|
|
|
|
|
void loadCommonNodeDescs();
|
|
|
|
|
|
|
|
|
|
// 右键菜单功能_节点通用
|
|
|
|
|
virtual void initContextMenuCommonNode(QMenu* pMenu);
|
|
|
|
|
// 空节点通用
|
|
|
|
|
virtual void initContextMenuCommonAll(QMenu* pMenu);
|
|
|
|
|
|
|
|
|
|
// 右键节点级别的菜单
|
|
|
|
|
virtual void initContextMenuWell(QMenu* pMenu);
|
|
|
|
|
virtual void initContextMenuBlock(QMenu* pMenu);
|
|
|
|
|
|
|
|
|
|
// 右键的部分功能重载实现
|
|
|
|
|
virtual bool showOrEditNode(QTreeWidgetItem* pItem);
|
|
|
|
|
virtual bool delCurrentNodes(QList<TreeItemBase *> &listItems);
|
|
|
|
|
virtual bool delOneNode(TreeItemMain* pItem);
|
|
|
|
|
virtual bool renameCurrentNode(QString sNew);
|
|
|
|
|
virtual void doubleClickItem(QTreeWidgetItem* pItem);
|
|
|
|
|
virtual void enteredItem(QTreeWidgetItem* pItem);
|
|
|
|
|
|
|
|
|
|
// 当p的一孩子被删除后,刷新p
|
|
|
|
|
// 此时,孩子已经被删除
|
|
|
|
|
virtual void updateParentWhenDel(QTreeWidgetItem* pParent);
|
|
|
|
|
|
|
|
|
|
// 拖拽相关的信号
|
|
|
|
|
virtual bool isDragAccepted(QDragEnterEvent* event);
|
|
|
|
|
virtual void dealwithDrop(QDropEvent* event);
|
|
|
|
|
ZxDataObjectEx* parseMimeData(const QMimeData* pMimeData, \
|
|
|
|
|
MainTreeNodeType& oType);
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
|
|
|
|
|
// 当前井该变
|
|
|
|
|
void sigSetCurrentWell(const QString&, const QString&);
|
|
|
|
|
void sigConfirmChangingCurWell(bool& b);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 更改节点属性
|
|
|
|
|
virtual void changeNodeAttrs(TreeItemMain*& p);
|
|
|
|
|
|
|
|
|
|
// 获取节点tips,以\r\n换行
|
|
|
|
|
virtual QString getTipsOf(TreeItemMain*& p);
|
|
|
|
|
|
|
|
|
|
// 获取井的区块名称,如果为空,则返回“其他”
|
|
|
|
|
QString getBlockNameOf(ZxDataWell* pDataWell);
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
|
|
// 右键响应
|
|
|
|
|
void slotSetCurrentWell(); //设为当前井
|
|
|
|
|
void slotScanData(); //浏览数据
|
|
|
|
|
void slotEditNodeObj(); //编辑Node
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
// 树节点特殊的节点标识
|
|
|
|
|
QString m_sAllDataTag;
|
|
|
|
|
QString m_sWellDataTag;
|
|
|
|
|
|
|
|
|
|
// 部分常用节点信息,从ini获取
|
|
|
|
|
vecTreeNodeDescPtr m_vecCommonNodeDescs;
|
|
|
|
|
|
|
|
|
|
// 数据对象载体
|
|
|
|
|
ZxDataProject* m_pDataProject;
|
|
|
|
|
|
|
|
|
|
// Brother
|
|
|
|
|
TreeWxMain* m_pBrother;
|
|
|
|
|
|
|
|
|
|
// 在其它brother刷新中,不能触发信号
|
|
|
|
|
bool m_bUnableSP;
|
|
|
|
|
|
|
|
|
|
bool m_bEnableBlockOthers;//是否启用,区块没填写时,自动为其他
|
|
|
|
|
};
|