From f66adb2c725431209af572e95f2e98bb67c84be2 Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Fri, 8 May 2026 15:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=97=E6=B3=95=E6=B7=BB=E5=8A=A0=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=8F=9C=E5=8D=95=E9=80=89=E6=8B=A9=E4=BA=95=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ModuleConsole/include/LogModuleParamers.h | 1 + ModuleConsole/include/PaiModuleToolBarView.h | 9 ++++- ModuleConsole/src/LogModuleParamers.cpp | 2 + ModuleConsole/src/PaiModuleToolBarView.cpp | 40 +++++++++++++++++++- ModuleConsole/src/ParameterEditorModel.cpp | 14 ++++++- ModuleConsole/src/WorkflowSceneManager.cpp | 7 +++- logPlus/mainwindowsplitter.cpp | 1 + logPlus/mainwindowsplitter.h | 5 --- logPlus/qtprojectwidgets.cpp | 2 + logPlus/qtprojectwidgets.h | 1 + 10 files changed, 72 insertions(+), 10 deletions(-) diff --git a/ModuleConsole/include/LogModuleParamers.h b/ModuleConsole/include/LogModuleParamers.h index 96b8ec0..b059444 100644 --- a/ModuleConsole/include/LogModuleParamers.h +++ b/ModuleConsole/include/LogModuleParamers.h @@ -114,6 +114,7 @@ public: PaiPushButton *m_pbtnRun; QString m_CurrentSLFFileName; QToolBar *m_toolBar_plugin = NULL; + QMap m_mapAllSlfFile;// 保存全部Slf文件 }; /** diff --git a/ModuleConsole/include/PaiModuleToolBarView.h b/ModuleConsole/include/PaiModuleToolBarView.h index 1823976..f2480e6 100644 --- a/ModuleConsole/include/PaiModuleToolBarView.h +++ b/ModuleConsole/include/PaiModuleToolBarView.h @@ -9,8 +9,9 @@ #define PAI_FRAME_WORKFLOWVIEW_PAIMODULETOOLBARVIEW_H #include +#include #include "PaiToolBarView.h" - +class PaiComAction; namespace pai { class CPaiModuleTree; @@ -29,7 +30,13 @@ namespace pai virtual ~CPaiModuleToolBarView(); CPaiModuleTree* GetModuleTree(){return m_pModuleTree;} + void setAllSlfFile(QMap mapAllSlfFile, QString CurrentSLFFileName); + QString getCurrentSLFFileName(); + public slots: + void oncurrentIndexChanged(int index); private: + QMap m_mapAllSlfFile;// 保存全部Slf文件 + PaiComAction * m_pComWellSlfFile; CPaiModuleTree* m_pModuleTree; }; } diff --git a/ModuleConsole/src/LogModuleParamers.cpp b/ModuleConsole/src/LogModuleParamers.cpp index a6f5bed..f3a94b6 100644 --- a/ModuleConsole/src/LogModuleParamers.cpp +++ b/ModuleConsole/src/LogModuleParamers.cpp @@ -393,6 +393,7 @@ CParameterEditor * CModuleParamers::CreatParamControlWidget() ///处理模块 QSplitter * m_pSplitter=new QSplitter(Qt::Orientation::Vertical); m_ModuleToolBarView = new CPaiModuleToolBarView(NULL); + m_ModuleToolBarView->setAllSlfFile(m_mapAllSlfFile, m_CurrentSLFFileName); m_pSplitter->addWidget(m_ModuleToolBarView); m_PWorkflowWidget = new WorkflowWidget(pModuleConsole->m_pWorkflowDataModel); WorkflowSceneManager *pWorkflowScene = new WorkflowSceneManager(0,0,800,750,m_PWorkflowWidget); @@ -943,6 +944,7 @@ void CModuleParamers::OnSetParameterOK(int stpar) QString CModuleParamers::GetCurrentSLFFileName() { + m_CurrentSLFFileName = m_ModuleToolBarView->getCurrentSLFFileName(); return m_CurrentSLFFileName; // CModuleConsole *pModuleConsole=m_pModuleConsole; // if(!pModuleConsole) return ""; diff --git a/ModuleConsole/src/PaiModuleToolBarView.cpp b/ModuleConsole/src/PaiModuleToolBarView.cpp index 6df0033..765537b 100644 --- a/ModuleConsole/src/PaiModuleToolBarView.cpp +++ b/ModuleConsole/src/PaiModuleToolBarView.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "PaiWidgetAction.h" #include "PaiModuleToolBarView.h" #include "PaiModuleTree.h" @@ -67,7 +68,9 @@ CPaiModuleToolBarView::CPaiModuleToolBarView(QWidget *parent):PaiToolBarView(par //添加查询控件 PaiSearchLineEdit* pSearchModuleLEdit = new PaiSearchLineEdit; styleToolBar->addWidget(pSearchModuleLEdit); - styleToolBar->addAction(new PaiComAction()); + m_pComWellSlfFile = new PaiComAction(); + styleToolBar->addAction(m_pComWellSlfFile); + this->AddToolBar(styleToolBar, PaiToolBarView::SMALL_TOOLBAR); // 因需等待搜索结果,再响应returnPressed信号把搜索的结果放入工作流视图, @@ -80,9 +83,44 @@ CPaiModuleToolBarView::CPaiModuleToolBarView(QWidget *parent):PaiToolBarView(par connect(pSearchModuleLEdit,SIGNAL(EditingStoped(const QString&)),m_pModuleTree,SLOT(Filter(const QString&))); connect(pSearchModuleLEdit,SIGNAL(returnPressed()), m_pModuleTree, SLOT(RequireDeliverSelectedModules())); + connect(m_pComWellSlfFile->GetDefaultWidget(),SIGNAL(currentIndexChanged(int)),this,SLOT(oncurrentIndexChanged(int))); +} +void CPaiModuleToolBarView::setAllSlfFile(QMap mapAllSlfFile,QString CurrentSLFFileName) +{ + m_mapAllSlfFile = mapAllSlfFile; + + PaiComboBox* pComboBox = dynamic_cast(m_pComWellSlfFile->GetDefaultWidget()); + if (pComboBox) + { + pComboBox->clear(); + QList listShowSlfName = mapAllSlfFile.keys(); + int iSel = 0; + for (int i = 0; iaddItem(listShowSlfName.at(i)); + QString strSLFFileName = mapAllSlfFile[listShowSlfName.at(i)]; + if (CurrentSLFFileName == strSLFFileName) + iSel = i; + } + if (iSel>0) + pComboBox->setCurrentIndex(iSel); + } +} + +QString CPaiModuleToolBarView::getCurrentSLFFileName() +{ + PaiComboBox* pComboBox = dynamic_cast(m_pComWellSlfFile->GetDefaultWidget()); + if (pComboBox && m_mapAllSlfFile.size()>0) + { + return m_mapAllSlfFile[pComboBox->currentText()]; + } + return ""; } CPaiModuleToolBarView::~CPaiModuleToolBarView() { // TODO Auto-generated destructor stub } +void CPaiModuleToolBarView::oncurrentIndexChanged(int index) +{ +} diff --git a/ModuleConsole/src/ParameterEditorModel.cpp b/ModuleConsole/src/ParameterEditorModel.cpp index 1a8ed83..8b6c0d9 100644 --- a/ModuleConsole/src/ParameterEditorModel.cpp +++ b/ModuleConsole/src/ParameterEditorModel.cpp @@ -125,9 +125,21 @@ QModelIndex ParameterEditorModel::parent(const QModelIndex & index) const if (NULL != pChildItem) { ParameterProperty *pParentItem = dynamic_cast (pChildItem->GetParent()); + char szTemp[128]; + sprintf(szTemp,"%16X",this ); + QString qstrTemp = szTemp; + + char szTemp2[128]; + sprintf(szTemp2,"%16X",pParentItem ); + QString qstrTemp2 = szTemp2; + + if (qstrTemp.contains("DDDDDDD") || qstrTemp2.contains("DDDDDDD"))// 有时候指针错误崩溃 + { + // QMessageBox::information(NULL,"aa","aa"); + return QModelIndex(); + } if (pParentItem) { - if (pParentItem->IsRoot()) { return QModelIndex(); diff --git a/ModuleConsole/src/WorkflowSceneManager.cpp b/ModuleConsole/src/WorkflowSceneManager.cpp index 58fb1bf..47b7e5d 100644 --- a/ModuleConsole/src/WorkflowSceneManager.cpp +++ b/ModuleConsole/src/WorkflowSceneManager.cpp @@ -1337,8 +1337,11 @@ void WorkflowSceneManager::slotAddModule(const QString& moduleName) CModuleParamers *pModuleParamers = pModuleConsole->g_mModuleParamers; PELibraryModule* amodule=amodule2; - // amodule->SetSlfFileName("D:/jiayl0909/logPlus/build/Logdata/JPH-307.slf"); - amodule->SetSlfFileName(pModuleParamers->m_CurrentSLFFileName); + // amodule->SetSlfFileName("Logdata/JPH-307.slf"); + QFileInfo fileinfo; + fileinfo = QFileInfo(pModuleParamers->GetCurrentSLFFileName()); + amodule3->GetMetaData()->SetName(amodule3->GetMetaData()->GetName() + "(" + fileinfo.completeBaseName().toStdString() + ")" ); + amodule->SetSlfFileName(pModuleParamers->GetCurrentSLFFileName()); amodule->InitModule(m_pParameterEditor); diff --git a/logPlus/mainwindowsplitter.cpp b/logPlus/mainwindowsplitter.cpp index 105074e..ef77e45 100644 --- a/logPlus/mainwindowsplitter.cpp +++ b/logPlus/mainwindowsplitter.cpp @@ -29,6 +29,7 @@ void MainWindowSplitter::setSplitterWidget(QtProjectWidgets *pWidgets) pModuleConsole->m_pWorkflowDataModel = new CWellLogWorkflowDataModel(); pDialog->m_CurrentSLFFileName = pWidgets->m_strSlfName; pDialog->m_toolBar_plugin = m_PluginToolBar; + pDialog->m_mapAllSlfFile = pWidgets->m_mapAllSlfFile; pDialog->CreatParamControlWidget(); //QString subStr = strSlfName; diff --git a/logPlus/mainwindowsplitter.h b/logPlus/mainwindowsplitter.h index 658cbe5..d86ded4 100644 --- a/logPlus/mainwindowsplitter.h +++ b/logPlus/mainwindowsplitter.h @@ -19,7 +19,6 @@ class MainWindowSplitter : public QMainWindow public: explicit MainWindowSplitter(QWidget *parent = nullptr); ~MainWindowSplitter(); - void setSplitterWidget(QtProjectWidgets *pWidgets); void setModuleOpenOrClose(); @@ -35,11 +34,7 @@ private: public slots: public: - QtProjectWidgets *m_leftWidgets = NULL; //左侧工程区 - - - }; #endif // MainWindowSplitter_H diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index 67fb0f9..aac6c85 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -245,6 +245,7 @@ void QtProjectWidgets::s_loadTreeWidget(QString fileFull) parent->addChild(itemIndex);//添加一级子节点 //数据导入 m_qmapWellFiles.clear(); + m_mapAllSlfFile.clear(); loadIndexSysTree(itemIndex, fileFull, g_prjname); //数据分析 @@ -493,6 +494,7 @@ void QtProjectWidgets::loadWellTree(QTreeWidgetItem *parent, QString fileFull, Q fileinfo = QFileInfo(fileFull); wellname = fileinfo.completeBaseName();//井次 } + m_mapAllSlfFile[wellname] = fileFull; // if(wellname != parentWellname) // { // //井次名称不一致 diff --git a/logPlus/qtprojectwidgets.h b/logPlus/qtprojectwidgets.h index dec9c58..9ec0ec1 100644 --- a/logPlus/qtprojectwidgets.h +++ b/logPlus/qtprojectwidgets.h @@ -128,6 +128,7 @@ public: QString m_strCutSlfName; QMap> m_mapShowObject;// 显示Slf文件里对象名 QMap> m_mapCopyObject;// 复制Slf文件里对象名 + QMap m_mapAllSlfFile;// 保存全部Slf文件 CDataManagger *magr;// int m_ReFlag;