From c6dc2868d2b220442fe96c954c80d62c912d38bb Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Thu, 5 Mar 2026 08:10:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E8=B1=A1=E6=8B=B7?= =?UTF-8?q?=E8=B4=9D=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataMgr/src/DataHelper.cpp | 20 +++++++++- DataMgr/src/DataHelper.h | 1 + DataMgr/src/DataManagger.cpp | 27 +++++++------ DataMgr/src/DataManagger.h | 3 +- DataMgr/src/DataMgr.pro | 10 +++++ DataMgr/src/InDefTableDlg.cpp | 24 ++++++++---- logPlus/forminfo.cpp | 1 + logPlus/qtprojectwidgets.cpp | 71 ++++++++++++++++++++++++++++++++--- logPlus/qtprojectwidgets.h | 3 +- 9 files changed, 131 insertions(+), 29 deletions(-) diff --git a/DataMgr/src/DataHelper.cpp b/DataMgr/src/DataHelper.cpp index 067ce6b..63c9d99 100644 --- a/DataMgr/src/DataHelper.cpp +++ b/DataMgr/src/DataHelper.cpp @@ -10,7 +10,7 @@ DEFAULTTABLE *DefauleTable=NULL; int DefTabNum=0; bool DataHelper::m_IsGc=true;//false; - +QMap > DataHelper::m_qmapWellFiles; DataHelper::DataHelper() { } @@ -317,7 +317,7 @@ bool DataHelper::IsNullLine(QByteArray line) QStringList DataHelper::GetAllWellName() { QStringList WellNameList; - // WellNameList.clear(); + WellNameList.clear(); // PaiObject *pPrj=GetProject(); // if(!pPrj) return WellNameList; // PaiObject *pObj=pPrj->GetObjectByType(GetClassID_WellsFolder()); @@ -329,6 +329,11 @@ QStringList DataHelper::GetAllWellName() // CObjWell *pWell=dynamic_cast(pChild); // if(pWell) WellNameList.append(pWell->GetName()); // } + int wellnum=m_qmapWellFiles.count(); + for(auto it=m_qmapWellFiles.begin();it!=m_qmapWellFiles.end();++it) + { + WellNameList.append(it.key()); + } return WellNameList; } QStringList DataHelper::GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList) @@ -336,6 +341,17 @@ QStringList DataHelper::GetAllWellRoundName(QString WellName,QStringList& WellRo QStringList WellRoundNameList; WellRoundNameList.clear(); WellRoundFileNameList.clear(); + if(m_qmapWellFiles.contains(WellName)) + { + QList WellFiles = m_qmapWellFiles[WellName]; + foreach(QString strFile,WellFiles) + { + QFileInfo fileInfo(strFile); + WellRoundNameList.append(fileInfo.baseName()); + WellRoundFileNameList.append(strFile); + } + } + // CObjWell * pWell = CDataImport::GetWellByName(WellName); // QList wellroundchildren; // int count=pWell->GetAllWellRound(wellroundchildren); diff --git a/DataMgr/src/DataHelper.h b/DataMgr/src/DataHelper.h index af2eef7..e03bb9f 100644 --- a/DataMgr/src/DataHelper.h +++ b/DataMgr/src/DataHelper.h @@ -50,6 +50,7 @@ public: static bool m_IsGc; static QStringList GetAllWellName(); static QStringList GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList); + static QMap > m_qmapWellFiles; }; class Function { diff --git a/DataMgr/src/DataManagger.cpp b/DataMgr/src/DataManagger.cpp index 4de8f12..da75e5a 100644 --- a/DataMgr/src/DataManagger.cpp +++ b/DataMgr/src/DataManagger.cpp @@ -21,7 +21,7 @@ #include "StatisticsDlg.h" #include "Statistics2Dlg.h" #include "CurveComputePage.h" -// #include "CopyObjectDlg.h" +#include "CopyObjectDlg.h" // #include "WaveComposeDlg.h"//2020.4.14 合成阵列曲线 #include "ShowWave.h"//波列曲线预览 #include "ShowCurve.h"//2020.5.12常规曲线预览 @@ -56,6 +56,11 @@ int CDataManagger::GetDefTabNum() { return DefTabNum; } +void CDataManagger::SetWellFiles(QMap > &mapWellFiles) +{ + DataHelper::m_qmapWellFiles=mapWellFiles; +} + //交互导入数据表 //whp change 2020.3.9 for 统一离散数据入口 void CDataManagger::execInDefTable(int curitemType, @@ -100,16 +105,16 @@ void CDataManagger::execInDefTable(int curitemType, return; pDlg->exec(); } -// //数据对象拷贝 -// void CDataManagger::CopyObject(int curitemType,const QString& WellName,const QString& WellRoundName) -// { -// CCopyObjectDlg *pDlg=new CCopyObjectDlg(); -// pDlg->curitemType=curitemType; -// pDlg->WellName=WellName; -// pDlg->WellRoundFileName=WellRoundName; -// pDlg->Init(); -// pDlg->exec(); -// } +//数据对象拷贝 +void CDataManagger::CopyObject(int curitemType,const QString& WellName,const QString& WellRoundName) +{ + CCopyObjectDlg *pDlg=new CCopyObjectDlg(); + pDlg->curitemType=curitemType; + pDlg->WellName=WellName; + pDlg->WellRoundFileName=WellRoundName; + pDlg->Init(); + pDlg->exec(); +} //数据表自动导入 //whp change 2020.3.9 for 统一离散数据入口 //void CDataManagger::dataInTable(const QStringList& lst) diff --git a/DataMgr/src/DataManagger.h b/DataMgr/src/DataManagger.h index 62a21c6..81238c9 100644 --- a/DataMgr/src/DataManagger.h +++ b/DataMgr/src/DataManagger.h @@ -17,6 +17,7 @@ public: ~CDataManagger(); int GetDefTabNum(); DEFAULTTABLE *GetDefauleTable(); + void SetWellFiles(QMap > &mapWellFiles); //whp change 2020.3.9 for 统一离散数据入口 //交互导入数据表 //void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName); @@ -25,7 +26,7 @@ public: //void dataInTable(const QStringList& lst ); //QStringList dataInTable(int curitemType,const QString& showWellName,const QString& wellFileName);//返回不能识别的非定式的数据文件列表 void dataInTable(int curitemType,QString& showWellName,QString& wellFileName); - // void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName); + void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName); // //曲线属性编辑 void CurvePropertyEdit(int Type,const QString& FileName,const QString& CurveName); diff --git a/DataMgr/src/DataMgr.pro b/DataMgr/src/DataMgr.pro index d838ffa..dec80f9 100644 --- a/DataMgr/src/DataMgr.pro +++ b/DataMgr/src/DataMgr.pro @@ -18,6 +18,7 @@ TEMPLATE = lib DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += _WINDOWS DEFINES += DATAMGR_LIB +DEFINES += HAVE_STRUCT_TIMESPEC # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. @@ -49,6 +50,7 @@ FORMS += \ CreateNewTableDlg.ui \ CurveComputePage.ui \ UI/AngleAdjTool.ui \ + UI/CopyObject.ui \ UI/CurveComputer.ui \ UI/CurvePropertyEdit.ui \ UI/InDefTable.ui \ @@ -71,6 +73,7 @@ HEADERS += \ AdaptionComboBox.h \ AngleAdjTool.h \ CheckHeadView.h \ + CopyObjectDlg.h \ CreateNewTableDlg.h \ CurveComputePage.h \ CurveComputerDlg.h \ @@ -99,6 +102,7 @@ SOURCES += \ AngleAdjTool.cpp \ CStringType.cpp \ CheckHeadView.cpp \ + CopyObjectDlg.cpp \ CreateNewTableDlg.cpp \ CurveComputePage.cpp \ CurveComputerDlg.cpp \ @@ -131,6 +135,12 @@ INCLUDEPATH += ../../ConvertorManager/include INCLUDEPATH += ../../OSGFramework/include INCLUDEPATH += ../../OSGDataModel/include INCLUDEPATH += ../../common +INCLUDEPATH += ../../Workflow/include +INCLUDEPATH += ../../Workflow/WFEngine/IOService/include +INCLUDEPATH += ../../Workflow/WFEngine/Module/include +INCLUDEPATH += ../../Workflow/WFCrystal/SysUtility/utils/include +INCLUDEPATH += ../../Workflow/WFEngine/ObjectModel/ObjectModel/include +INCLUDEPATH += ../../Workflow/WFEngine/ObjectModel/ObjectModelBase/include CONFIG(debug, debug|release){ LIBS += -L../../Bin -lBaseFund diff --git a/DataMgr/src/InDefTableDlg.cpp b/DataMgr/src/InDefTableDlg.cpp index 8a439f9..bd47c82 100644 --- a/DataMgr/src/InDefTableDlg.cpp +++ b/DataMgr/src/InDefTableDlg.cpp @@ -1797,10 +1797,14 @@ void CInDefTableDlg::resizeEvent(QResizeEvent *pEvent) { QDialog::resizeEvent(pEvent); - //m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); - m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents); - if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); - else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); + //m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); + int visual = m_pUI->tableWidget->horizontalHeader()->visualIndex(1); + if (visual!=-1) + { + m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents); + if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); + else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); + } if(MaxCol<10)m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::Stretch); else m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); @@ -1813,10 +1817,14 @@ void CInDefTableDlg::showEvent(QShowEvent * pEvent) // if(m_bFirstShow) { - // m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); - m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents); - if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); - else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); + // m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); + int visual = m_pUI->tableWidget->horizontalHeader()->visualIndex(1); + if (visual!=-1) + { + m_pUI->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents); + if(m_pUI->tableWidget->columnCount()<10)m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::Stretch); + else m_pUI->tableWidget->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); + } if(MaxCol<10)m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::Stretch); else m_pUI->tableWidget_1->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 0821b57..0e32ca1 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "geometryutils.h" #include "qtColorSchemeComboBox.h" diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index 2c4a824..ec93eb6 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -198,6 +198,7 @@ void QtProjectWidgets::s_loadTreeWidget(QString fileFull) itemIndex->setIcon(0, icon_wellfolder); parent->addChild(itemIndex);//添加一级子节点 //数据导入 + m_qmapWellFiles.clear(); loadIndexSysTree(itemIndex, fileFull, g_prjname); //数据分析 @@ -425,11 +426,12 @@ void QtProjectWidgets::loadWellTree(QTreeWidgetItem *parent, QString fileFull, Q return; } QString wellname=QString::fromLocal8Bit(mssage.WellName); - if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1) + m_qmapWellFiles[wellname].append(fileFull); + // if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1) { QFileInfo fileinfo; fileinfo = QFileInfo(fileFull); - wellname = fileinfo.completeBaseName(); + wellname = fileinfo.completeBaseName();//井次 } // if(wellname != parentWellname) // { @@ -684,9 +686,14 @@ void QtProjectWidgets::initWellsTreeMenu(QMenu *menu, QTreeWidget *treeWidget) connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSingleWellLogData())); menu->addAction(action_New); - action_New = new QAction("导入离散数据", treeWidget); - action_New->setIcon(QIcon(GetImagePath() + "icon/intable.png")); // 设置图标 - connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSlfTable())); + // action_New = new QAction("导入离散数据", treeWidget); + // action_New->setIcon(QIcon(GetImagePath() + "icon/intable.png")); // 设置图标 + // connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onImportSlfTable())); + // menu->addAction(action_New); + + action_New = new QAction("数据对象拷贝", treeWidget); + action_New->setIcon(QIcon(GetImagePath() + "icon/Correction.png")); // 设置图标 + connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCopyObject())); menu->addAction(action_New); // action_New = new QAction("输出数据", treeWidget); @@ -1099,7 +1106,7 @@ void QtProjectWidgets::onImportSingleWellLogData() } } - if (pMainWindow) + // if (pMainWindow) { // InterfaceWidget *pInterfaceWidget = new InterfaceWidget();//中间工作区 // pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据"); @@ -1182,6 +1189,58 @@ void QtProjectWidgets::onOutWellLogRound() moutPut=NULL; } +void QtProjectWidgets::onCopyObject() +{ +// if (NULL==magr) +// { +// return; +// } +// QStringList wellnamelist=GetSelWellRound(); +// #pragma region 判断当前选择项是“井”、Well、WellRound +// int CurItemType=-1; +// CBaseObject *pObject = GetOSGObject( this->currentItem() ); +// pai::objectmodel::PaiObject* object = pObject->GetPaiObject(); +// if(object == NULL)return; +// QString WellFileName="",WellName=""; +// if(object->GetTypeID()==GetClassID_WellsFolder()) +// { +// CurItemType=0; +// WellName=""; +// } +// else +// { +// CObjWell *pWell=dynamic_cast(object);//this->currentItem());//井级 +// if(pWell) +// { +// CurItemType=1; +// // WellFileName=pWell->GetWellFileName(); +// WellName=pWell->GetName(); +// } +// else +// { +// CObjWelllogRound *pWellRount=dynamic_cast(object);//this->currentItem()); +// if(pWellRount) +// { +// CurItemType=2; +// WellFileName=pWellRount->GetSlfFileName(); +// WellName=pWellRount->GetWell()->GetName(); +// } +// } +// } +// if(CurItemType<0)return; +// #pragma endregion 判断当前选择项是“井”、Well、WellRound +// //whp change 2020.3.9 for 统一离散数据入口 +// magr->CopyObject(CurItemType,WellName,WellFileName); + + CDataManagger* magr=new CDataManagger(); + int CurItemType=0; + QString WellFileName="",WellName=""; + int nCount = m_qmapWellFiles.count(); + magr->SetWellFiles(m_qmapWellFiles); + magr->CopyObject(CurItemType,WellName,WellFileName); + return; +} + //点击树图节点 void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index) { diff --git a/logPlus/qtprojectwidgets.h b/logPlus/qtprojectwidgets.h index 55e7efe..5fa537a 100644 --- a/logPlus/qtprojectwidgets.h +++ b/logPlus/qtprojectwidgets.h @@ -52,6 +52,7 @@ public slots: void onImportSingleWellLogData(); void onImportSlfTable(); void onOutWellLogRound(); + void onCopyObject(); //数据对象拷贝 //井次 void onWelllogInformation(); //编辑测井信息 void onDepthShift_Well(bool checked = false); //深度移动 @@ -117,5 +118,5 @@ public: void initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget); private: - + QMap > m_qmapWellFiles; };