From 2c70f61b6f7c70c33e49d68361dd8a55ed8fe953 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Tue, 2 Jun 2026 14:22:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E4=BA=95=EF=BC=8C=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=9D=A1=E8=BF=BD=E5=8A=A0=E2=80=9C=E4=BA=95=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E2=80=9D=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/mainwindowcurve.cpp | 34 ++++++++++++++++++++++++++++++++++ logPlus/mainwindowcurve.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 034a19a..42f862a 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -655,6 +655,7 @@ void MainWindowCurve::initMainToolBar() QIcon zoominIcon(::GetImagePath()+"icon/zoomin.png"); QIcon zoomoutIcon(::GetImagePath()+"icon/zoomout.png"); QIcon wellTopAlignIcon(::GetImagePath()+"WellInterp/井顶对齐.png"); + QIcon wellsSpaceIcon(::GetImagePath()+"WellInterp/井间距离.png"); //Main工具栏 m_selectWellAc = new QAction(selectWellIcon, "设置井", this); @@ -674,6 +675,7 @@ void MainWindowCurve::initMainToolBar() m_autorollAc = new QAction(autorollIcon, "图像自滚", this); m_PreviewPrintAc = new QAction(blackIcon, "预览图", this); m_wellTopAlignAc = new QAction(wellTopAlignIcon, "井顶对齐", this); + m_wellsSpaceAc = new QAction(wellsSpaceIcon, "井间距", this); m_ModuleOpenAc = new QAction(ModuleOpenIcon, "处理方法", this); ui->mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); //此种方式为文字显示在图标右侧 @@ -700,6 +702,7 @@ void MainWindowCurve::initMainToolBar() ui->mainToolBar->addSeparator(); // ui->mainToolBar->addAction(m_wellTopAlignAc); //井顶对齐 + ui->mainToolBar->addAction(m_wellsSpaceAc); //井间距 ui->mainToolBar->addAction(m_ModuleOpenAc); //处理方法 // 设置为可选中 @@ -732,6 +735,7 @@ void MainWindowCurve::initMainToolBar() connect(m_autorollAc, &QAction::triggered, this, &MainWindowCurve::s_Autoroll); connect(m_PreviewPrintAc, &QAction::triggered, this, &MainWindowCurve::s_PreviewPrint); connect(m_wellTopAlignAc, &QAction::triggered, this, &MainWindowCurve::s_wellTopAlign); + connect(m_wellsSpaceAc, &QAction::triggered, this, &MainWindowCurve::s_wellsSpace); connect(m_ModuleOpenAc, &QAction::triggered, this, &MainWindowCurve::s_ModuleOpen); connect(CallManage::getInstance(), SIGNAL(sig_SaveAsPicture()), this, SLOT(s_SaveAsPicture())); @@ -3128,6 +3132,36 @@ void MainWindowCurve::s_wellTopAlign() } } +//井间距 +void MainWindowCurve::s_wellsSpace() +{ + bool ok=0; + QString Formtiom=QInputDialog::getText(NULL,"井位间距设置","井位等间距(mm)",QLineEdit::Normal,"",&ok); + if(!ok) return; + if(Formtiom.toFloat()) + { + float dSpace=Formtiom.toFloat();//mm + + int iNewWidth = static_cast(dSpace/10.0 * g_dPixelPerCm); + //设置列宽 + int columnCount = ui->tableWidget_2->columnCount();//总列数 + for(int i=0; itableWidget_2->setColumnWidth(i, iNewWidth); + } + } +} + //预览图 void MainWindowCurve::s_PreviewPrint() { diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index b62892b..5ef8716 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -249,6 +249,7 @@ public: QAction* m_autorollAc = nullptr; //图像自滚 QAction* m_PreviewPrintAc = nullptr; //预览图 QAction* m_wellTopAlignAc = nullptr; //井顶对齐 + QAction* m_wellsSpaceAc = nullptr; //井间距 QAction* m_ModuleOpenAc = nullptr; //处理方法 public slots: @@ -342,6 +343,7 @@ public slots: void s_Autoroll(); //图像自滚 void s_PreviewPrint(); //预览图 void s_wellTopAlign(); //井顶对齐 + void s_wellsSpace(); //井间距 void s_ModuleOpen(); //处理算法 // void _slotExport(QPrinter &printer, int IsBmp, QString pngName, QString strTmpName);