From 462ae53ea6bc52f8826481e83a8dfee5de66d903 Mon Sep 17 00:00:00 2001 From: "DESKTOP-450PEFP\\mainc" Date: Fri, 17 Apr 2026 09:49:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E5=90=8D=E7=A7=B0=EF=BC=8C?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=EF=BC=8C=E5=88=BB=E5=BA=A6=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E6=9B=B2=E7=BA=BF=E5=8D=95=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E8=BF=9E=E7=BB=AD=E6=8A=98=E8=BF=94=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 37 ++++++- logPlus/forminfo.cpp | 11 +- logPlus/forminfo.h | 2 + logPlus/logplus.vcxproj | 59 ++++++++++- logPlus/logplus.vcxproj.filters | 180 ++++++++++++++++++++++++++++++++ logPlus/qmycustomplot.cpp | 101 +++++++++++++++++- logPlus/qmycustomplot.h | 8 ++ 7 files changed, 388 insertions(+), 10 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 3897a48..e9ddff1 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1946,8 +1946,36 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } else if(m_strCurrentProperty == Curve_Property) { + bool bhv = false; + bool bDraw = false; + QStringList slist; + slist << "曲线名称" << "曲线单位" << "曲线刻度" << "单比例连续折返"; + for (int i = 0; i < slist.length(); i++) + { + if (slist.at(i) == m_propertyData[pProperty]) + { + bhv = true; + bDraw = m_formInfo->setInfoProperty(m_propertyData[pProperty], variant); + break; + } + } + if (bhv) + { + if (bDraw) + { + QVariantList listCond; + listCond << m_strUuid; + listCond << m_strSlfName; + listCond << m_strWellName; + listCond << m_strTrackName; + listCond << m_strLineName; + listCond << m_propertyData[pProperty]; + listCond << variant; + emit CallManage::getInstance()->sig_changeDrawProperty(listCond); + } + } //曲线--------------------------- - if("选择井曲线" == m_propertyData[pProperty]) + else if("选择井曲线" == m_propertyData[pProperty]) { QString sFilePath = variant.value(); if(sFilePath.indexOf("@")>-1) @@ -2854,6 +2882,13 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt _CreateVariantPropertyItem("曲线线型", "线宽", formInfo->m_dWidth, QVariant::Double, 1, 20); _CreateVariantPropertyItem("曲线线型", "颜色", formInfo->m_lineColor, QVariant::Color); _CreateEnumPropertyItem("曲线线型", "线型", (int)formInfo->m_lineStyle, listStyle); + + _CreateVariantPropertyItem("字体", "曲线名称", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线单位", formInfo->m_curveUnitFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "曲线刻度", formInfo->m_curveScaleFont, QVariant::Font); + + _CreateVariantPropertyItem("显示设置", "单比例连续折返", formInfo->m_bConBackAndForth, QVariant::Bool); + //绘制方式 _CreateVariantPropertyItem("绘制方式", "曲线", formInfo->m_bDrawLine, QVariant::Bool); _CreateVariantPropertyItem("绘制方式", "绘制对称曲线", formInfo->m_bDrawSymmetry, QVariant::Bool); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index d8743e1..1e574eb 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -1015,7 +1015,7 @@ void FormInfo::paintEvent(QPaintEvent* event) else { QFont oldFont = painter.font(); - painter.setFont(this->m_strAliasNameFont); + painter.setFont(this->m_curveNameFont); painter.drawText(rt, Qt::AlignCenter, text); painter.setFont(oldFont); } @@ -1041,7 +1041,7 @@ void FormInfo::paintEvent(QPaintEvent* event) || m_strType=="curveObject") { QFont oldFont = painter.font(); - painter.setFont(m_strUnitFont); + painter.setFont(m_curveUnitFont); painter.drawText(rect.left()+10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, m_strUnit); painter.setFont(oldFont); // 显示刻度 @@ -1787,7 +1787,12 @@ bool FormInfo::setInfoProperty(QString strProName, QVariant val) { bDraw = true; this->m_fLayerRotate = val.toFloat(); - } + } + else if ("单比例连续折返" == strProName) + { + bDraw = true; + this->m_bConBackAndForth = val.toBool(); + } this->update(); return bDraw; diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 797d6dc..4d55e5b 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -114,6 +114,8 @@ public: QFont m_curveUnitFont; // 曲线单位字体 QFont m_curveScaleFont; // 曲线刻度字体 + bool m_bConBackAndForth = false; // 单比例连续折返 + //绘制方式 bool m_bDrawLine = true; // 曲线 bool m_bDrawGan = false; // 杆状 diff --git a/logPlus/logplus.vcxproj b/logPlus/logplus.vcxproj index c5aa8b2..3703413 100644 --- a/logPlus/logplus.vcxproj +++ b/logPlus/logplus.vcxproj @@ -26,6 +26,21 @@ + + + + + + + + + + + + + + + @@ -95,6 +110,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -244,7 +301,7 @@ - ../include;../CallPlugin;./;./3rd_qcustomplot;./3rd_qcustomplot/v2_1;../EditPlotHeader/include;../Slfio/include;../CallManage;../common;../WellLogUI/include;../qtpropertybrowser;../BaseFun/include;../ConvertorManager/include;../OSGDataModel/include;../OSGFramework/include;../DataOutput/include;../DataMgr/include;../DrawBase/include;../ModuleConsole/include;../WellLogModule/include;../Workflow/include;../Workflow/WFCrystal/Crystal/include;../Workflow/WFCrystal/Plugin/include;../Workflow/WFCrystal/SysUtility/utils/include;../Workflow/WFEngine/IOService/include;../Workflow/WFEngine/Module/include;../Workflow/WFEngine/Component/WorkflowWidget/include;../Workflow/WFEngine/ObjectModel/ObjectModel/include;../Workflow/WFEngine/WorkflowEngine/include;../Workflow/WFEngine/ObjectModel/ObjectModelBase/include;../Workflow/WFWidget/include%(AdditionalIncludeDirectories);$(Qt_INCLUDEPATH_) + ./3rd_tiff/zlib/src;./3rd_tiff/libtiff/libtiff;../include;../CallPlugin;./;./3rd_qcustomplot;./3rd_qcustomplot/v2_1;../EditPlotHeader/include;../Slfio/include;../CallManage;../common;../WellLogUI/include;../qtpropertybrowser;../BaseFun/include;../ConvertorManager/include;../OSGDataModel/include;../OSGFramework/include;../DataOutput/include;../DataMgr/include;../DrawBase/include;../ModuleConsole/include;../WellLogModule/include;../Workflow/include;../Workflow/WFCrystal/Crystal/include;../Workflow/WFCrystal/Plugin/include;../Workflow/WFCrystal/SysUtility/utils/include;../Workflow/WFEngine/IOService/include;../Workflow/WFEngine/Module/include;../Workflow/WFEngine/Component/WorkflowWidget/include;../Workflow/WFEngine/ObjectModel/ObjectModel/include;../Workflow/WFEngine/WorkflowEngine/include;../Workflow/WFEngine/ObjectModel/ObjectModelBase/include;../Workflow/WFWidget/include%(AdditionalIncludeDirectories);$(Qt_INCLUDEPATH_) ..\Bin;%(AdditionalLibraryDirectories) diff --git a/logPlus/logplus.vcxproj.filters b/logPlus/logplus.vcxproj.filters index 4142fa6..f900ac0 100644 --- a/logPlus/logplus.vcxproj.filters +++ b/logPlus/logplus.vcxproj.filters @@ -33,6 +33,15 @@ {90fce5ea-3cd6-47d8-9400-aea11137b079} + + {83e7d996-9d64-4c97-9a1d-679b221493f2} + + + {3a0733d0-ef1d-4a06-90e4-0d55b22b0eca} + + + {5bbd34dd-c287-4e85-981c-56630b53f011} + @@ -77,6 +86,51 @@ Header Files + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + @@ -492,6 +546,132 @@ Source Files + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\libtiff + + + libtiff\port + + + libtiff\port + + + libtiff\port + diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 81b304c..0958b29 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -589,6 +589,11 @@ void QMyCustomPlot::initWave2(QString strSlfName, QString strWaveName) delete[]value; } +void QMyCustomPlot::initCurve(QString strSlfName, QString strLineName) +{ + +} + void QMyCustomPlot::initColorTable() { this->setSchemeIndex(m_nSchemeIndex, m_nColorNum); @@ -4946,6 +4951,11 @@ void QMyCustomPlot::s_ReloadPlot(QString strUuid, QString strSlfName, QString st m_x.append(x); m_y.append(y); + m_showX.clear(); + m_showX = m_x; + m_showY.clear(); + m_showY = m_y; + graph(0)->data()->clear(); graph(0)->setData(m_x, m_y); replot(QCustomPlot::rpQueuedReplot); //刷新曲线 @@ -5058,6 +5068,10 @@ void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist) { this->setShowProperty(varVal, 5); } + else if ("单比例连续折返" == strProperty) + { + this->updateCurveConBackAndForth(); + } this->replot(); } } @@ -5689,6 +5703,8 @@ void QMyCustomPlot::s_ChangeLeftScale(QString strUuid, QString strSlfName, QStri double lower = m_iX1 - rg * m_nLeftCross; double upper = m_iX2 + rg * m_nRightCross; yAxis->setRange(lower, upper); + + updateCurveConBackAndForth(true); // replot(); } @@ -5720,6 +5736,8 @@ void QMyCustomPlot::s_ChangeRightScale(QString strUuid, QString strSlfName, QStr double lower = m_iX1 - rg * m_nLeftCross; double upper = m_iX2 + rg * m_nRightCross; yAxis->setRange(lower, upper); + + updateCurveConBackAndForth(true); // replot(); } @@ -6755,6 +6773,8 @@ void QMyCustomPlot::addRandomGraph(QVector x, QVector y, QString m_x.append(x); m_y.append(y); + m_showX.append(x); + m_showY.append(y); QCPGraph *graph=addGraph(); if(strLineName=="") @@ -6877,17 +6897,17 @@ void QMyCustomPlot::addRandomGraph(QVector x, QVector y, QString void QMyCustomPlot::slot_time() { - if(m_iCurNum >= m_x.size()) + if(m_iCurNum >= m_showX.size()) { //处理完成 return; } // - if(m_x.size() <= m_iCurNum+m_iSplitNum) + if(m_showX.size() <= m_iCurNum+m_iSplitNum) { - graph()->addData(m_x.mid(m_iCurNum), m_y.mid(m_iCurNum)); - m_iCurNum = m_x.size(); + graph()->addData(m_showX.mid(m_iCurNum), m_showY.mid(m_iCurNum)); + m_iCurNum = m_showX.size(); //处理完成,绘制对称曲线 if(m_bDrawSymmetry) @@ -6908,7 +6928,7 @@ void QMyCustomPlot::slot_time() } else { - graph()->addData(m_x.mid(m_iCurNum, m_iSplitNum), m_y.mid(m_iCurNum, m_iSplitNum)); + graph()->addData(m_showX.mid(m_iCurNum, m_iSplitNum), m_showY.mid(m_iCurNum, m_iSplitNum)); m_iCurNum = m_iCurNum + m_iSplitNum; //replot(); QTimer::singleShot(100, this, SLOT(slot_time())); @@ -10210,6 +10230,77 @@ void QMyCustomPlot::setColGridVisible(bool bvis) } } +void QMyCustomPlot::updateCurveConBackAndForth(bool bkd) +{ + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + + if (bkd) + { + if (!pInfo->m_bConBackAndForth) + return; + } + + int nzflag = 0; + m_showX.clear(); + m_showY.clear(); + for (int i = 0; i < m_y.size(); i++) + { + m_showX.append(m_x.at(i)); + double dy = m_y.at(i); + if (pInfo->m_bConBackAndForth) + { + if (dy > pInfo->m_vmax) + { + if (nzflag == 0) + { + m_showX.append(m_x.at(i - 1)); + m_showX.append(m_x.at(i - 1)); + m_showY.append(pInfo->m_vmax); + m_showY.append(pInfo->m_vmin); + nzflag = 1; + } + dy = pInfo->m_vmin + (dy - pInfo->m_vmax); + } + else + { + if (nzflag == 1) + { + m_showX.append(m_x.at(i - 1)); + m_showX.append(m_x.at(i - 1)); + m_showY.append(pInfo->m_vmin); + m_showY.append(pInfo->m_vmax); + nzflag = 0; + } + } + } + m_showY.append(dy); + } + + QCPGraph *graph = this->graph(0);// addGraph(); + if (!graph) + return; + + if (m_showX.size() < m_iSplitNum) + { + graph->setData(m_showX, m_showY); + replot(); + //replot(QCustomPlot::rpRefreshHint);// 仅刷新可见部分,跳过轴计算等 + } + else + { + graph->setData(m_showX.mid(0, m_iSplitNum), m_showY.mid(0, m_iSplitNum)); + replot(); + + m_iCurNum = m_iSplitNum; + QTimer::singleShot(100, this, SLOT(slot_time())); + } + +} + //道宽改变后,避免井壁取心等组件变形,需要重新刷新 void QMyCustomPlot::resetPosition() { diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index dc7a23c..aa55d1f 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -65,6 +65,8 @@ public: void initWave(QString strSlfName, QString strWaveName); // 绘图类型-波形 void initWave2(QString strSlfName, QString strWaveName); + // 曲线绘制 + void initCurve(QString strSlfName, QString strLineName); void initColorTable(); void setSchemeIndex(int nidx, int colorNum); @@ -102,6 +104,10 @@ public: void setRowGridVisible(bool bvis); void setColGridVisible(bool bvis); + + // 单比例连续折返 + void updateCurveConBackAndForth(bool bkd = false); + protected: @@ -194,6 +200,8 @@ public: float m_fResultEndDepth = 0.0f; QVector m_x; QVector m_y; + QVector m_showX; + QVector m_showY; int m_iCurNum=0; //分段刷新 int m_iSplitNum=2000; //2000000; //2000;