From 0e9fdeab6ea61c84ff67d24b73af46d2d0bea220 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Thu, 21 May 2026 14:01:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=91=E7=99=BD=E5=9B=BE=EF=BC=8C=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=85=B1=E4=BA=AB=E5=86=85=E5=AD=98=E6=8E=A7=E5=88=B6?= =?UTF-8?q?svg=E5=9B=BE=E5=BD=A2=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/customtabwidget.cpp | 12 ++++++++ logPlus/mainwindowcurve.cpp | 58 +++++++++++++++++++++++++++++++++++++ logPlus/mainwindowcurve.h | 19 ++++++++++++ logPlus/qmycustomplot.cpp | 35 +++++++++++++--------- 4 files changed, 110 insertions(+), 14 deletions(-) diff --git a/logPlus/customtabwidget.cpp b/logPlus/customtabwidget.cpp index aa11a1e..7f6c67b 100644 --- a/logPlus/customtabwidget.cpp +++ b/logPlus/customtabwidget.cpp @@ -15,6 +15,7 @@ #include #include "customtabbar.h" #include "PropertyWidget.h" +#include "mainwindowsplitter.h" CustomTabWidget::CustomTabWidget(QWidget *parent) : QWidget(parent) @@ -141,6 +142,17 @@ void CustomTabWidget::setCurrentIndex(int index) //属性清空 PropertyService()->InitCurrentViewInfo(); + + QWidget *selectWidget = tabWidget(index); + if (selectWidget == NULL) + return; + + QString objectName = selectWidget->objectName(); + if(objectName == "MainWindowSplitter") + { + MainWindowSplitter *tmpWindow = (MainWindowSplitter*)selectWidget; + tmpWindow->getMainWindowCurve()->SetNo(); + } } void CustomTabWidget::setAutoDelete(bool bAuto) diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index fcc8f76..2bb28db 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -207,10 +207,51 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) : // m_propertyWidget->setWindowTitle("属性编辑器"); // m_propertyWidget->setParent(this); // addDockWidget( Qt::TopDockWidgetArea, m_propertyWidget); + + //黑白图,针对共享内存,使用老版本代码,需要以下定义 + mNo=rand(); + zoomRatio=1.0; + zoomXRatio=1.0; + zoomYRatio=1.0; + m_isColorPrint=1; + m_isPrint=false; + m_isBMP=0; + // + m_SharedMemory.setKey("SharedName"); + m_SharedMemory.attach(); + if(!m_SharedMemory.isAttached()) { + m_SharedMemory.create(sizeof(int)); + m_SharedMemory.attach(); + } + int *isNo=(int*)m_SharedMemory.data(); + *isNo=mNo; + QString cs=QString::number(*isNo)+"isScaleAndColor"; + m_isScale.setKey(cs); + m_isScale.create(5*sizeof(float)); + m_isScale.attach(); + float *isScale=(float*)m_isScale.data(); + isScale[0]=zoomXRatio*zoomRatio; + isScale[1]=zoomYRatio*zoomRatio; + isScale[2]=m_isColorPrint; + isScale[3]=m_isPrint; + isScale[4]=m_isBMP; + } +void MainWindowCurve::SetNo() +{ + if(m_SharedMemory.isAttached()) { + int *isNo=(int*)m_SharedMemory.data(); + *isNo=mNo; + } +} MainWindowCurve::~MainWindowCurve() { + if(m_SharedMemory.isAttached()){ + int *isNo=(int*)m_SharedMemory.data(); + m_SharedMemory.detach(); + } + if(m_isScale.isAttached()) m_isScale.detach(); delete ui; } @@ -2630,6 +2671,19 @@ void MainWindowCurve::s_Save() } } +bool MainWindowCurve::GetIsColorPrint() +{ + return m_isColorPrint; +} + +void MainWindowCurve::SetIsColorPrint(bool iscolorprint) +{ + m_isColorPrint=iscolorprint; + if(!m_isScale.isAttached()) return; + float *isScale=(float*)m_isScale.data(); + isScale[2]=m_isColorPrint; +} + //黑白图 void MainWindowCurve::s_Black() { @@ -2639,6 +2693,10 @@ void MainWindowCurve::s_Black() { bBlack = true; } + // + SetNo();//切换共享内存编号到当前页面 + SetIsColorPrint(!bBlack); + emit CallManage::getInstance()->sig_changeBlack(m_strUuid, bBlack); } diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 2646427..33b6f33 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -58,6 +58,7 @@ public slots: //自定义滚动条 void vertScrollBarChanged(int value); + public: MainWindowSplitter* m_pParentWin = NULL; @@ -95,6 +96,24 @@ public: int m_iCurPage = 1;//当前页 //图像自滚定时器 QTimer *m_clockTimer = nullptr; + +public: + //黑白图,针对共享内存,使用老版本代码,需要以下定义 + //整图放大缩小比例 + double zoomRatio; + double zoomXRatio; + double zoomYRatio; + QSharedMemory m_isScale; + QSharedMemory m_SharedMemory; + int mNo; + bool m_isColorPrint; + bool m_isPrint; + bool m_isBMP; + + void SetIsColorPrint(bool iscolorprint); + bool GetIsColorPrint(); + void SetNo(); + public: //展示所有井 void DisplayWells(QJsonArray wellsArray); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index bed4a72..000fd9f 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1921,7 +1921,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_SWallCore); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_SWallCore); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_SWallCore); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_SWallCore); menu.exec(event->globalPos()); } else if (m_strLineName == "GEO_LITH") @@ -1938,7 +1938,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_GeoLith); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_GeoLith); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_GeoLith); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_GeoLith); menu.exec(event->globalPos()); } else if (m_strLineName == "WORDS_RELUST") @@ -1955,7 +1955,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Text); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Text); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Text); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Text); menu.exec(event->globalPos()); } else if (m_strLineName == "LAYER_DATA") @@ -1972,7 +1972,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Layer); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Layer); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Layer); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Layer); menu.exec(event->globalPos()); } else if (m_strLineName == "RESULT") // 解释结论 @@ -1991,7 +1991,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &QMyCustomPlot::DeleteItemGroup); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Layer); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Layer); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Layer); menu.addAction(QIcon(::GetImagePath() + "icon/SetZone.png"), "更新层号", this, &QMyCustomPlot::updateGroupZone); menu.addAction(QIcon(::GetImagePath() + "icon/Split.png"), "分割为层内层", this, &QMyCustomPlot::segmentationInnerLayer); @@ -2021,7 +2021,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "设置深度移动量", this, &QMyCustomPlot::setImageDepth); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "删除选中对象", this, &QMyCustomPlot::deleteItemsImage); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::refreshItemsImage); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::refreshItemsImage); } menu.exec(event->globalPos()); } @@ -2033,7 +2033,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::pasteCorePhysics); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::deleteCorePhysics); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::refreshCorePhysics); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::refreshCorePhysics); menu.exec(event->globalPos()); } @@ -2055,7 +2055,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Jiegutext); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Jiegutext); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Jiegutext); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Jiegutext); menu.exec(event->globalPos()); } else if (m_strType == "gujingObject") @@ -2072,7 +2072,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Gujing); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Gujing); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "development.png"), "合并结论", this, &QMyCustomPlot::MegResult_Gujing); menu.exec(event->globalPos()); } @@ -2105,7 +2105,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Tubing); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Tubing); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Tubing); + menu.addAction(QIcon(::GetImagePath() + "icon/load.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Tubing); menu.exec(event->globalPos()); } @@ -14247,8 +14247,6 @@ void QMyCustomPlot::s_changeBlack(QString strUuid, bool bBlack) QPen pen = graph->pen(); pen.setColor(QColor(0,0,0)); graph->setPen(pen); - // - replot(); } } else { @@ -14260,8 +14258,17 @@ void QMyCustomPlot::s_changeBlack(QString strUuid, bool bBlack) QPen pen = graph->pen(); pen.setColor(pInfo->m_lineColor); graph->setPen(pen); - // - replot(); } } + //固井结论 + resetPosition_Gujing(); + //井壁取心 + resetPosition_SwallCore(); + //录井剖面 + resetPosition_GeoLith(); + //地质层位 + resetPosition_Layer(); + + // + replot(); }