From 7368b3d2c843b54870e2ce3ab6a763bf264c06fb Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 15 Jun 2026 10:57:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E9=81=93=E5=A4=B4=E9=AB=98=E5=BA=A6=EF=BC=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE2=E4=B8=AA=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formwell.cpp | 5 ++- logPlus/mainwindowcurve.cpp | 82 +++++++++++++++++++++++++++++++++++++ logPlus/mainwindowcurve.h | 2 + 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/logPlus/formwell.cpp b/logPlus/formwell.cpp index 6152c17..4d50caf 100644 --- a/logPlus/formwell.cpp +++ b/logPlus/formwell.cpp @@ -1357,8 +1357,9 @@ void FormWell::onSectionResized(int logicalIndex, int oldSize, int newSize) if(newSize!=0) { MainWindowCurve *parent = (MainWindowCurve *)m_parent; - parent->SetScrollBar_Geometry(); - parent->vertScrollBarChanged_Head(0); + // + parent->SetScrollBar_Geometry_ByHand(); + //parent->vertScrollBarChanged_Head(0); } } } diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 860fd9a..5ea2e64 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -355,6 +355,85 @@ void MainWindowCurve::resizeWindow() //update(); } +//手动设置2个滚动条位置 +void MainWindowCurve::SetScrollBar_Geometry_ByHand() +{ + QRect rect2 = ui->centralwidget->geometry(); + int left, top, right, bottom; + if (ui->centralwidget->layout()) + { + ui->centralwidget->layout()->getContentsMargins(&left, &top, &right, &bottom); + } + //可视区域高度 + int iScreenHeight = rect2.height()- top -bottom; + + //锁头 + if(m_fixwellsectionHeaderAc->isChecked()) + { + //获取井well前2行的高度 + //int iTableSize_Head = 100 + m_nObjLayerH; + int iTableSize_Head = 0; + getTableSize_Head(iTableSize_Head); + int iTableWellTrack_height = ui->tableWidget_2->rowHeight(0) + (5) + iTableSize_Head -1; + + QRect geoRect2 = ui->verticalScrollBar_2->geometry(); + ui->verticalScrollBar_2->setGeometry(geoRect2.x(), geoRect2.y(), geoRect2.width(), iTableWellTrack_height); + // + QRect geoRect = ui->verticalScrollBar->geometry(); + ui->verticalScrollBar->setGeometry(geoRect.x(), geoRect2.y()+iTableWellTrack_height+2, geoRect.width(), iScreenHeight-iTableWellTrack_height-2); + + //自定义滚动条(头) + int iTableSize_Head_Biggest = 0; + int iTableSize_Head1 = 0; + int iTableSize_Head2 = 0; + getTableSize_Head_Biggest(iTableSize_Head_Biggest, iTableSize_Head1, iTableSize_Head2); + m_iTableSize_Head2 = iTableSize_Head2; + m_nObjLayerH = m_iTableSize_Head2; + + ui->verticalScrollBar_2->setRange(0, iTableSize_Head_Biggest - iTableSize_Head); + ui->verticalScrollBar_2->setValue(0); + + //重置滚动条范围值setRange--------------------- + //可视区域高度 + iScreenHeight = 0; + //锁头 + if(m_fixwellsectionHeaderAc->isChecked()) + { + iScreenHeight = (double)(rect2.height()-10- top -bottom - iTableWellTrack_height)/g_dPixelPerCm * m_iScale; + } + else{ + iScreenHeight = (double)(rect2.height()-10- top -bottom - 4)/g_dPixelPerCm * m_iScale; + } + //下方滚动条高度 + int iHScrollBarHeight = 0; + if(!ui->tableWidget_2->horizontalScrollBar()->isVisible()) + { + iHScrollBarHeight = 0; + } + else + { + iHScrollBarHeight = ui->tableWidget_2->horizontalScrollBar()->height()/g_dPixelPerCm * m_iScale; + } + ui->verticalScrollBar->setRange(-m_iY2*100, -m_iY1*100 - iScreenHeight + iHScrollBarHeight); + ui->verticalScrollBar->setValue(-m_iY2*100); + + //道头部滚动条归0 + vertScrollBarChanged_Head(0); + } + else + { + ui->verticalScrollBar_2->setValue(0); + + //替换为高度0,不然居中处理失效 + QRect geoRect2 = ui->verticalScrollBar_2->geometry(); + ui->verticalScrollBar_2->setGeometry(geoRect2.x(), geoRect2.y(), geoRect2.width(), 0); + // + QRect geoRect = ui->verticalScrollBar->geometry(); + ui->verticalScrollBar->setGeometry(geoRect.x(), geoRect2.y(), geoRect.width(), iScreenHeight); + //ui->verticalScrollBar->setGeometry(geoRect.x(), geoRect2.y(), geoRect.width(), geoRect.height()+geoRect2.height()); + } +} + //2个滚动条位置 void MainWindowCurve::SetScrollBar_Geometry() { @@ -3755,6 +3834,8 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName, m_PreviewPrintAc->setChecked(true); //切换回锁头模式 m_fixwellsectionHeaderAc->setChecked(true); + //锁头 + s_showHeadTable(); //全部显示道头,方便抓拍道头 ShowTableHead_All(); @@ -4477,6 +4558,7 @@ void MainWindowCurve::s_showHeadTable() { //恢复原始数据,不然容易造成道头过大 m_iTableSize_Head2 = 104; + m_nObjLayerH = m_iTableSize_Head2; //显示道头/对象头 ShowTableHead(); diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index f10a696..2cc3a36 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -146,6 +146,8 @@ public: void SetNo(); //2个滚动条位置 void SetScrollBar_Geometry(); + //手动设置2个滚动条位置 + void SetScrollBar_Geometry_ByHand(); public: //展示所有井 From 9d510e384a23775b49d05b9cd8160296c294a9dd Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Mon, 15 Jun 2026 12:56:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E4=BA=95=E5=8A=9F=E8=83=BD=E3=80=81=E6=B7=BB=E5=8A=A0=E4=BA=95?= =?UTF-8?q?=E6=AC=A1=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WellLogModule/src/PELibraryModule.cpp | 4 +- logPlus/mainwindow.cpp | 63 ++++++++++++++++++++++----- logPlus/qtprojectwidgets.cpp | 31 ++++++++++++- logPlus/qtprojectwidgets.h | 1 + 4 files changed, 85 insertions(+), 14 deletions(-) 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();