diff --git a/WellLogModule/src/PELibraryModule.cpp b/WellLogModule/src/PELibraryModule.cpp index d87b935..1159dfa 100644 --- a/WellLogModule/src/PELibraryModule.cpp +++ b/WellLogModule/src/PELibraryModule.cpp @@ -1039,7 +1039,7 @@ UINT PELibraryModule::ProcessDLL1(LPVOID pPram,float sdep,float edep)//只用公 if(Hd->Dep>Hd->EndDep) break; //mDP.SetDepth(Hd->Dep); } - QString slf=m_pMemRdWt->GetWellName().GetString(); + QString slf=GBKToUTF8(m_pMemRdWt->GetWellName().GetString()); QStringList Names; int Noo=m_pMemRdWt->GetOutCurveCount(); for(int i=0;iGetWellName().GetString()); + QString slf=GBKToUTF8(m_pMemRdWt->GetWellName().GetString()); QStringList Names; Names.clear(); int Noo=m_pMemRdWt->GetOutCurveCount(); diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index 9739612..9c72121 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -845,13 +845,35 @@ void MainWindow::s_ShowTDT(QString strSlfName, QString strName) { if(m_centerWidgets) { - WellLogTableDialogNew* pDialog = new WellLogTableDialogNew(); - pDialog->setName(strSlfName, strName, TDT_OBJECT); + WellLogTableDialogNew* pDialog = nullptr; + for (int nIndex = m_pWellLogTableDialogNew.size() - 1; nIndex >= 0; nIndex--) + { + QPointer pDlg = m_pWellLogTableDialogNew[nIndex]; + if (pDlg.isNull()) + { + m_pWellLogTableDialogNew.removeAt(nIndex); + continue; + } + bool equ = pDlg->isEqual(strSlfName, strName, TDT_OBJECT); + if (equ) + { + pDialog = pDlg; + break; + } + } + if (!pDialog) + { + QPointer pTmp = new WellLogTableDialogNew(); + pTmp->setName(strSlfName, strName, TDT_OBJECT); + m_pWellLogTableDialogNew.append(pTmp); + pDialog = pTmp; + } + QString wellname;QString path; GetWellNameAndPath(strSlfName, wellname, path); m_centerWidgets->addTab(pDialog, wellname + ":" + strName); - int iCount = m_centerWidgets->count(); - m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1); +// int iCount = m_centerWidgets->count(); +// m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1); } } @@ -860,17 +882,39 @@ void MainWindow::s_ShowTable(QString strSlfName, QString strName) { if(m_centerWidgets) { - WellLogTableDialogNew* pDialog = new WellLogTableDialogNew(); - pDialog->setName(strSlfName, strName, TABLEE_OBJECT); + WellLogTableDialogNew* pDialog = nullptr; + for (int nIndex = m_pWellLogTableDialogNew.size() - 1; nIndex >= 0; nIndex--) + { + QPointer pDlg = m_pWellLogTableDialogNew[nIndex]; + if (pDlg.isNull()) + { + m_pWellLogTableDialogNew.removeAt(nIndex); + continue; + } + bool equ = pDlg->isEqual(strSlfName, strName, TABLEE_OBJECT); + if (equ) + { + pDialog = pDlg; + break; + } + } + if (!pDialog) + { + QPointer pTmp = new WellLogTableDialogNew(); + pTmp->setName(strSlfName, strName, TABLEE_OBJECT); + m_pWellLogTableDialogNew.append(pTmp); + pDialog = pTmp; + } + QString wellname;QString path; GetWellNameAndPath(strSlfName, wellname, path); m_centerWidgets->addTab(pDialog, wellname + ":" + strName); - int iCount = m_centerWidgets->count(); - m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1); +// int iCount = m_centerWidgets->count(); +// m_centerWidgets->m_pTabBar->setCurrentIndex(iCount-1); } } -//表格数据查看 +//波列数据查看 void MainWindow::s_ShowWave(QString strSlfName, QString strName) { if(m_centerWidgets) @@ -890,7 +934,6 @@ void MainWindow::s_ShowWave(QString strSlfName, QString strName) pDialog = pDlg; break; } - } if (!pDialog) { diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index 88a6c0e..798eb72 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -834,6 +834,11 @@ 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() + "well.png")); // 设置图标 + connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onAddWell())); + 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())); @@ -1134,6 +1139,11 @@ void QtProjectWidgets::initSlfNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget) connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onUnitConvert())); menu->addAction(action_New); + action_New = new QAction("输出数据", treeWidget); + action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标 + connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound())); + menu->addAction(action_New); + QAction* action_Delete = new QAction("删除", treeWidget); action_Delete->setIcon(QIcon(GetImagePath() + "icon/Delete.png")); // 设置图标":/image/u174.png" connect(action_Delete, SIGNAL(triggered()), this, SLOT(onDeleteObject())); @@ -2484,6 +2494,24 @@ void QtProjectWidgets::onImportSingleWellLogData() ImportSingleWellLogData(false); } +void QtProjectWidgets::onAddWell() +{ + CObjWell *pWell = new CObjWell(); + CWellDialog *wd = new CWellDialog(); + pWell->SetPrjname(g_prjname); + wd->m_DialogType=1; + wd->Init(pWell); + if(wd->exec()==QDialog::Accepted) { + QString strProjectFolder = GetProjectFolder(); + QString strProjectFile = strProjectFolder + g_prjname; + strProjectFile += ".wwl"; + s_OpenProject(strProjectFile); + return /*pWell*/; + } + else delete pWell; + return /*NULL*/; +} + void QtProjectWidgets::onImportSingleWellLogDataToolBar() { ImportSingleWellLogData(true); @@ -3073,8 +3101,7 @@ void QtProjectWidgets::s_Notice_AddObject(QString strName, QString strSlfName, Q int wellItemCount = wellItem->childCount(); // 获取井次数量 for (int k = 0; k < wellItemCount; ++k) { - QString slf = wellItem->child(k)->data(0, Qt::UserRole + 1).toString(); - if (strSlfName == slf) + if (strSlfName == wellItem->child(k)->data(0, Qt::UserRole+1).toString()) { wellCurItem = wellItem->child(k); break; diff --git a/logPlus/qtprojectwidgets.h b/logPlus/qtprojectwidgets.h index 1ef26eb..db47e53 100644 --- a/logPlus/qtprojectwidgets.h +++ b/logPlus/qtprojectwidgets.h @@ -75,6 +75,7 @@ public slots: void onEditWelllogRound(); void onImportFolder(); //按目录导入测井数据 void onImportSingleWellLogData(); //数据导入 + void onAddWell(); //新建井 void onImportSingleWellLogDataToolBar(); //数据导入(工具栏) void onImportSlfTable(); void onOutWellLogRound();