From 0935980d8c2704c80b34dab57be52f2f96459693 Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Wed, 25 Mar 2026 11:04:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B2=A9=E5=BF=83=E5=88=86=E6=9E=90=20?= =?UTF-8?q?=E8=AF=BB=E5=8F=96slf=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formdraw.cpp | 2 +- logPlus/qmycustomplot.cpp | 30 +++++++++++++++++++++++++----- logPlus/qmycustomplot.h | 6 ++---- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 309a18f..dd9cb58 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -6609,7 +6609,7 @@ void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QStrin y.append(CoreValue); // 已经加载了slf文件内容 显示界面上 - widget->addCorePhysicsToPlot(Order, depth, CorrDepth, CoreValue); +// widget->addCorePhysicsToPlot(Order, depth, CorrDepth, CoreValue); } logio->CloseTable(iIndex); delete m_pResult; diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 45a2741..390595e 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1918,7 +1918,31 @@ void QMyCustomPlot::deleteItemsImage(){} void QMyCustomPlot::refreshItemsImage(){} // 增加 -void QMyCustomPlot::addCorePhysics(int Order, double Depth, double CorrDepth, double CoreValue) +void QMyCustomPlot::addCorePhysics() +{ + double right_Hight = xAxis->pixelToCoord(m_event->pos().y());//x轴展示深度 + double left_Low = right_Hight; + QtCommonClass *qtCommon = new QtCommonClass(this); + QString strUuid = qtCommon->getUUid(); + + TransparentDraggableCorePhysics *dragRect = new TransparentDraggableCorePhysics(this, strUuid); + // 设置初始范围 + dragRect->setRange(left_Low, right_Hight); + + + + + // 可选:设置颜色 + // dragRect->setColor(crColor); // 半透明白色 + //最小宽度 + // dragRect->setMinWidth(0.1); + // dragRect->setTitle(strText); + m_mapDraggable_CorePhysics[strUuid] = dragRect; + + this->saveToSLFCorePhysics(); +} + +void QMyCustomPlot::addCorePhysicsWithParam(int Order, double Depth, double CorrDepth, double CoreValue) { double right_Hight = xAxis->pixelToCoord(m_event->pos().y());//x轴展示深度 double left_Low = right_Hight; @@ -4238,10 +4262,6 @@ void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QS m_mapDraggable_Image[strUuid] = dragRect; } -// 岩心分析 -void addCorePhysicsToPlot(int Order, double Depth, double CorrDepth, double CoreValue) -{} - void QMyCustomPlot::addSelectRectToPlot(double left_Low, double right_Hight, int left_Low_Number, int right_Hight_Number) { //qDebug() << "QMyCustomPlot addSelectRectToPlot"; diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 351ad38..7e8613b 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -323,9 +323,6 @@ public: // left_Low底, right_Hight高 imagePath图片 left左边距 width宽 mBorderColor边框颜色、 mBorderStyle边框样式 mBorderWidth边框宽 void addImageToPlot(double left_Low, double right_Hight, const QString imagePath, double left, double width, QColor mBorderColor, Qt::PenStyle mBorderStyle, int mBorderWidth); - // 岩心分析 - void addCorePhysicsToPlot(int Order, double Depth, double CorrDepth, double CoreValue); - //曲线 void addRandomGraph(QVector x, QVector y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit, double newLeftScale, double newRightScale, QString strScaleType, QColor &newlineColor, double width, Qt::PenStyle lineStyle); @@ -452,7 +449,8 @@ public slots: void refreshItemsImage(); //刷新数据 //右键--编辑岩心分析 - void addCorePhysics(int Order = 0, double Depth = 0.0, double CorrDepth = 0.0, double CoreValue = 0.0); // 增加 + void addCorePhysics(); // 增加 + void addCorePhysicsWithParam(int Order = 0, double Depth = 0.0, double CorrDepth = 0.0, double CoreValue = 0.0); void pasteCorePhysics(); //从剪切板文本数据粘贴 void deleteCorePhysics(); //全部清空 void refreshCorePhysics(); //刷新数据