From 76261bcea0c61dcdfe3e1d24bc36a7fe8c6e28c8 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Fri, 20 Mar 2026 18:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E7=AE=A1=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=AE=8C=E6=88=9018=E4=B8=AA=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 6 + logPlus/PropertyWidget.cpp | 140 +++++++ logPlus/PropertyWidget.h | 4 + logPlus/TransparentDraggableFac.cpp | 8 +- logPlus/TransparentDraggableFac.h | 2 +- logPlus/TransparentDraggableGeoLith.cpp | 5 +- logPlus/TransparentDraggableGujing.cpp | 13 +- logPlus/TransparentDraggableGujing.h | 2 +- logPlus/TransparentDraggableJiegutext.cpp | 8 +- logPlus/TransparentDraggableJiegutext.h | 2 +- logPlus/TransparentDraggableLayer.cpp | 13 +- logPlus/TransparentDraggableLayer.h | 2 +- logPlus/TransparentDraggableLine.cpp | 8 +- logPlus/TransparentDraggableLine.h | 2 +- logPlus/TransparentDraggableMFac.cpp | 8 +- logPlus/TransparentDraggableMFac.h | 2 +- logPlus/TransparentDraggablePhase.cpp | 8 +- logPlus/TransparentDraggablePhase.h | 2 +- logPlus/TransparentDraggableRect.cpp | 11 +- logPlus/TransparentDraggableRect.h | 2 +- logPlus/TransparentDraggableResult.cpp | 21 +- logPlus/TransparentDraggableSwallCore.cpp | 29 +- logPlus/TransparentDraggableSwallCore.h | 2 +- logPlus/formdraw.cpp | 211 +++++++++- logPlus/forminfo.cpp | 13 + logPlus/forminfo.h | 10 + logPlus/formtrack.cpp | 65 ++- logPlus/qmycustomplot.cpp | 450 ++++++++++++++++----- logPlus/qmycustomplot.h | 51 ++- logPlus/transparentdraggableGuan.cpp | 121 ++++-- logPlus/transparentdraggableGuan.h | 13 +- logPlus/transparentdraggableRightList.cpp | 8 +- logPlus/transparentdraggableRightList.h | 2 +- logPlus/transparentdraggableSelectRect.cpp | 8 +- logPlus/transparentdraggableSelectRect.h | 2 +- logPlus/transparentdraggableimage.cpp | 23 +- logPlus/transparentdraggableimage.h | 4 +- 37 files changed, 1032 insertions(+), 249 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index dae8a73..68f10e3 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -227,6 +227,12 @@ signals: //改变沉积相属性,是否显示 void sig_changeFacShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + //改变套管组件属性,是否显示 + void sig_changeGuanShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + + //改变套管组件属性,直径 + void sig_changeGuanD(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, double newD); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 98fd723..3989a7e 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1282,6 +1282,94 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_formInfo->m_vmax = newRightScale; emit CallManage::getInstance()->sig_ChangeRightScale(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, newRightScale); } + else if("绘制结构" == m_propertyData[pProperty] || + "绘制管柱" == m_propertyData[pProperty] || + "绘制工具" == m_propertyData[pProperty] || + "标注工具" == m_propertyData[pProperty] || + "绘制接箍" == m_propertyData[pProperty]) + { + bool bShow = variant.value(); + if(m_propertyData[pProperty] == "绘制结构") + { + m_formInfo->m_bDrawStruct_Tubing = bShow; + } + else if(m_propertyData[pProperty] == "绘制管柱") + { + m_formInfo->m_bDrawTubing_Tubing = bShow; + } + else if(m_propertyData[pProperty] == "绘制工具") + { + m_formInfo->m_bDrawTools_Tubing = bShow; + } + else if(m_propertyData[pProperty] == "标注工具") + { + m_formInfo->m_bDrawSPTool_Tubing = bShow; + } + else if(m_propertyData[pProperty] == "绘制接箍") + { + m_formInfo->m_bDrawCCL_Tubing = bShow; + } + //改变套管组件属性,是否显示 + emit CallManage::getInstance()->sig_changeGuanShow(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_propertyData[pProperty], bShow); + } + else if("油管外径" == m_propertyData[pProperty]|| + "套管内径" == m_propertyData[pProperty] || + "套管外径" == m_propertyData[pProperty]) + { + double newD = variant.value(); + if(m_propertyData[pProperty] == "油管外径") + { + m_formInfo->m_Oguan_Tubing = newD; + } + else if(m_propertyData[pProperty] == "套管内径") + { + m_formInfo->m_inD_Tubing = newD; + } + else if(m_propertyData[pProperty] == "套管外径") + { + m_formInfo->m_OutD_Tubing = newD; + } + + //改变套管组件属性,直径 + emit CallManage::getInstance()->sig_changeGuanD(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_propertyData[pProperty], newD); + } + } + else if (m_strCurrentProperty == TubingItem_Property) + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + + //套管组件item + if("标注" == m_propertyData[pProperty]) + { + QString newDec = variant.value(); + + } + else if("深度(m)" == m_propertyData[pProperty]) + { + //qDebug() << "深度(m)->改变"; + if(m_tdGuan) + { + double depth = variant.value(); + m_tdGuan->setRange(-depth-m_tdGuan->mH/2.0, -depth+m_tdGuan->mH/2.0); + //保存 + m_tdGuan->mPlot->SaveToSLF_Tubing(); + } + } + else if("组件类型" == m_propertyData[pProperty]) + { + //qDebug() << "组件类型->改变"; + if(m_tdGuan) + { + QString newResult = variant.value(); + m_tdGuan->setResult(newResult); + // + QCPRange currentRange = m_tdGuan->getRange(); + m_tdGuan->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGuan->mPlot->SaveToSLF_Tubing(); + } + } } else if (m_strCurrentProperty == Depth_Property) // 深度 { @@ -3253,6 +3341,8 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo) _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); _CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("对象", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); + _CreateVariantPropertyItem("对象", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); _CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font); _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); @@ -3260,9 +3350,59 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo) _CreateVariantPropertyItem("显示设置", "左刻度", formInfo->m_vmin, QVariant::Double); _CreateVariantPropertyItem("显示设置", "右刻度", formInfo->m_vmax, QVariant::Double); + _CreateVariantPropertyItem("绘制方式", "绘制结构", formInfo->m_bDrawStruct_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制管柱", formInfo->m_bDrawTubing_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制工具", formInfo->m_bDrawTools_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "标注工具", formInfo->m_bDrawSPTool_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制接箍", formInfo->m_bDrawCCL_Tubing, QVariant::Bool); + + _CreateVariantPropertyItem("绘制方式", "油管外径", formInfo->m_Oguan_Tubing, QVariant::Double); + _CreateVariantPropertyItem("绘制方式", "套管内径", formInfo->m_inD_Tubing, QVariant::Double); + _CreateVariantPropertyItem("绘制方式", "套管外径", formInfo->m_OutD_Tubing, QVariant::Double); + m_strCurrentProperty = Tubing_Property; } +void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, double lower, double upper, QString strResult) +{ + //初始化,清空 + InitCurrentViewInfo(); + FormInfo* formInfo = tdGuan->mPlot->m_formTrack->getFormInfoByParameters(tdGuan->mPlot->m_strUuid, tdGuan->mPlot->m_strWellName, + tdGuan->mPlot->m_strTrackName, tdGuan->mPlot->m_strLineName); + if (formInfo != NULL) + { + m_formInfo = formInfo; + + m_strUuid = formInfo->m_strUuid; + m_strTrackUuid = formInfo->m_strTrackUuid; + // + m_strSlfName = formInfo->m_strSlfName; + m_strWellName = formInfo->m_strWellName; + m_strTrackName = formInfo->m_strTrackName; + m_strLineName = formInfo->m_strLineName; + + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + _CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("对象", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); + _CreateVariantPropertyItem("对象", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); + _CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); + + _CreateVariantPropertyItem("显示设置", "显示单位", formInfo->m_strUnit, QVariant::String); + _CreateVariantPropertyItem("显示设置", "左刻度", formInfo->m_vmin, QVariant::Double); + _CreateVariantPropertyItem("显示设置", "右刻度", formInfo->m_vmax, QVariant::Double); + + } + + //当前属性类型 + m_strCurrentProperty = TubingItem_Property; + m_tdGuan = tdGuan; + + // + _CreateVariantPropertyItem("当前项", "深度(m)", -(upper+lower)/2.0, QVariant::Double); + _CreateVariantPropertyItem("当前项", "组件类型", strResult, VariantManager::filePathTypeId()); +} + void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal) { if ("主刻度线长度" == strProperty) diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index c89a028..a8bc662 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -27,6 +27,7 @@ #include "TransparentDraggableRect.h" #include "TransparentDraggableLayer.h" #include "TransparentDraggableJiegutext.h" +#include "transparentdraggableGuan.h" #include "TransparentGroupResult.h" @@ -137,6 +138,7 @@ public: bool m_bSelfChange=false; TransparentGroupResult* m_tdJieshi; + // TransparentDraggableGujing* m_tdGujing; TransparentDraggableImage* m_tdImage; TransparentDraggableSwallCore* m_tdSwallCore; @@ -144,6 +146,7 @@ public: TransparentDraggableRect* m_tdText; TransparentDraggableLayer* m_tdLayer; TransparentDraggableJiegutext* m_tdJiegutext; + TransparentDraggableGuan* m_tdGuan; public: QWidget* GetPropertyWidget(); @@ -215,6 +218,7 @@ public: //套管组件 void initTubingProperty(FormInfo *formInfo); + void initTubingItemProperty(TransparentDraggableGuan* tdGuan, double lower, double upper, QString strResult); void ChangFillProperty();//填充属性改变 void ChangHeadItemProperty();//图头项改变 diff --git a/logPlus/TransparentDraggableFac.cpp b/logPlus/TransparentDraggableFac.cpp index d960481..71e6f2d 100644 --- a/logPlus/TransparentDraggableFac.cpp +++ b/logPlus/TransparentDraggableFac.cpp @@ -35,7 +35,7 @@ void TransparentDraggableFac::setTitle(QString strTitle) } // 设置矩形范围 -void TransparentDraggableFac::setRange(double left_Low, double right_Hight) +void TransparentDraggableFac::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -48,7 +48,11 @@ void TransparentDraggableFac::setRange(double left_Low, double right_Hight) mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), 7*(lY1 + lY2)/8.0); // 设置文本在矩形中心位置 updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableFac.h b/logPlus/TransparentDraggableFac.h index 5b617c3..c434108 100644 --- a/logPlus/TransparentDraggableFac.h +++ b/logPlus/TransparentDraggableFac.h @@ -24,7 +24,7 @@ public: void setTitle(QString strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggableGeoLith.cpp b/logPlus/TransparentDraggableGeoLith.cpp index 48f5693..4c605b8 100644 --- a/logPlus/TransparentDraggableGeoLith.cpp +++ b/logPlus/TransparentDraggableGeoLith.cpp @@ -397,7 +397,7 @@ void TransparentDraggableGeoLith::drawOil(double left_Low, double right_Hight, d } // 设置矩形范围 -void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight, bool bRefresh) +void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -461,7 +461,8 @@ void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight, updateHandles(); - if(bRefresh) + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) { mPlot->replot(); } diff --git a/logPlus/TransparentDraggableGujing.cpp b/logPlus/TransparentDraggableGujing.cpp index 0a7f2eb..279d6db 100644 --- a/logPlus/TransparentDraggableGujing.cpp +++ b/logPlus/TransparentDraggableGujing.cpp @@ -171,7 +171,7 @@ void TransparentDraggableGujing::drawResult(double left_Low, double right_Hight, } // 设置矩形范围 -void TransparentDraggableGujing::setRange(double left_Low, double right_Hight) +void TransparentDraggableGujing::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -185,17 +185,16 @@ void TransparentDraggableGujing::setRange(double left_Low, double right_Hight) mPixmap->bottomRight->setCoords(left_Low, lY2); drawResult(left_Low, right_Hight, lY1, lY2); - //mItemTitle->position->setCoords(0.5, 0.5); // 设置父锚点,定位点 - //mItemTitle->position->setParentAnchor(mRect->bottom); mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); - updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableGujing.h b/logPlus/TransparentDraggableGujing.h index f36e018..0870a0e 100644 --- a/logPlus/TransparentDraggableGujing.h +++ b/logPlus/TransparentDraggableGujing.h @@ -35,7 +35,7 @@ public: void drawResult(double left_Low, double right_Hight, double lY1, double lY2); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggableJiegutext.cpp b/logPlus/TransparentDraggableJiegutext.cpp index e7a9698..1c6fb60 100644 --- a/logPlus/TransparentDraggableJiegutext.cpp +++ b/logPlus/TransparentDraggableJiegutext.cpp @@ -64,7 +64,7 @@ void TransparentDraggableJiegutext::setTitle(QStringList strTitle) } // 设置矩形范围 -void TransparentDraggableJiegutext::setRange(double left_Low, double right_Hight) +void TransparentDraggableJiegutext::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -89,7 +89,11 @@ void TransparentDraggableJiegutext::setRange(double left_Low, double right_Hight } updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableJiegutext.h b/logPlus/TransparentDraggableJiegutext.h index a6a7a67..dc007ae 100644 --- a/logPlus/TransparentDraggableJiegutext.h +++ b/logPlus/TransparentDraggableJiegutext.h @@ -25,7 +25,7 @@ public: void setTitle(QStringList strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggableLayer.cpp b/logPlus/TransparentDraggableLayer.cpp index 9e40456..3e43e43 100644 --- a/logPlus/TransparentDraggableLayer.cpp +++ b/logPlus/TransparentDraggableLayer.cpp @@ -37,7 +37,7 @@ void TransparentDraggableLayer::setTitle(QString strTitle) } // 设置矩形范围 -void TransparentDraggableLayer::setRange(double left_Low, double right_Hight) +void TransparentDraggableLayer::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -48,18 +48,17 @@ void TransparentDraggableLayer::setRange(double left_Low, double right_Hight) //位置与rect不一样,否则图像反转 drawLith(left_Low, right_Hight, lY1, lY2); -// mPixmap->topLeft->setCoords(right_Hight, lY1); -// mPixmap->bottomRight->setCoords(left_Low, lY2); float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15; mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); - updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableLayer.h b/logPlus/TransparentDraggableLayer.h index 1dc291c..28451c7 100644 --- a/logPlus/TransparentDraggableLayer.h +++ b/logPlus/TransparentDraggableLayer.h @@ -24,7 +24,7 @@ public: void setTitle(QString strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggableLine.cpp b/logPlus/TransparentDraggableLine.cpp index a4ccd77..0870393 100644 --- a/logPlus/TransparentDraggableLine.cpp +++ b/logPlus/TransparentDraggableLine.cpp @@ -32,7 +32,7 @@ void TransparentDraggableLine::setTitle(QString strTitle) } // 设置矩形范围 -void TransparentDraggableLine::setRange(double left_Low, double right_Hight) +void TransparentDraggableLine::setRange(double left_Low, double right_Hight, bool bReplot) { m_left_Low = left_Low; m_right_Hight = right_Hight; @@ -54,7 +54,11 @@ void TransparentDraggableLine::setRange(double left_Low, double right_Hight) qcpItemLine->end->setCoords(right_Hight, lY2);//圆心位置 //updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableLine.h b/logPlus/TransparentDraggableLine.h index 9743cdb..3eb41fc 100644 --- a/logPlus/TransparentDraggableLine.h +++ b/logPlus/TransparentDraggableLine.h @@ -24,7 +24,7 @@ public: void setTitle(QString strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 void getRange(); diff --git a/logPlus/TransparentDraggableMFac.cpp b/logPlus/TransparentDraggableMFac.cpp index 0dfd49b..250d66e 100644 --- a/logPlus/TransparentDraggableMFac.cpp +++ b/logPlus/TransparentDraggableMFac.cpp @@ -50,7 +50,7 @@ void TransparentDraggableMFac::setTitle(QString strTitle) } // 设置矩形范围 -void TransparentDraggableMFac::setRange(double left_Low, double right_Hight) +void TransparentDraggableMFac::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -101,7 +101,11 @@ void TransparentDraggableMFac::setRange(double left_Low, double right_Hight) } updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableMFac.h b/logPlus/TransparentDraggableMFac.h index 5c02473..e6d98cd 100644 --- a/logPlus/TransparentDraggableMFac.h +++ b/logPlus/TransparentDraggableMFac.h @@ -24,7 +24,7 @@ public: void setTitle(QString strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggablePhase.cpp b/logPlus/TransparentDraggablePhase.cpp index 4d6c460..7d114a4 100644 --- a/logPlus/TransparentDraggablePhase.cpp +++ b/logPlus/TransparentDraggablePhase.cpp @@ -35,7 +35,7 @@ void TransparentDraggablePhase::setTitle(QString strTitle) } // 设置矩形范围 -void TransparentDraggablePhase::setRange(double left_Low, double right_Hight) +void TransparentDraggablePhase::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -69,7 +69,11 @@ void TransparentDraggablePhase::setRange(double left_Low, double right_Hight) } updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggablePhase.h b/logPlus/TransparentDraggablePhase.h index 375e7cb..004e118 100644 --- a/logPlus/TransparentDraggablePhase.h +++ b/logPlus/TransparentDraggablePhase.h @@ -23,7 +23,7 @@ public: void setTitle(QString strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggableRect.cpp b/logPlus/TransparentDraggableRect.cpp index 674ee2c..9a6a185 100644 --- a/logPlus/TransparentDraggableRect.cpp +++ b/logPlus/TransparentDraggableRect.cpp @@ -37,7 +37,7 @@ void TransparentDraggableRect::setTitle(QString strTitle) } // 设置矩形范围 -void TransparentDraggableRect::setRange(double left_Low, double right_Hight) +void TransparentDraggableRect::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -54,11 +54,12 @@ void TransparentDraggableRect::setRange(double left_Low, double right_Hight) mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); - updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableRect.h b/logPlus/TransparentDraggableRect.h index 1e1493b..b9f7bdd 100644 --- a/logPlus/TransparentDraggableRect.h +++ b/logPlus/TransparentDraggableRect.h @@ -23,7 +23,7 @@ public: void setTitle(QString strTitle); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/TransparentDraggableResult.cpp b/logPlus/TransparentDraggableResult.cpp index 196fb93..d157b58 100644 --- a/logPlus/TransparentDraggableResult.cpp +++ b/logPlus/TransparentDraggableResult.cpp @@ -173,33 +173,14 @@ void TransparentDraggableResult::setRange(double left_Low, double right_Hight, b mRect->topLeft->setCoords(left_Low, lY1); mRect->bottomRight->setCoords(right_Hight, mPlot->yAxis->range().upper); - //位置与rect不一样,否则图像反转 -// double dbCenterX = (right_Hight+left_Low)/2.0; //right_Hight; // -// double dbCenterY = (lY1+lY2)/2.0; //lY2; // -// double x1 = mPlot->xAxis->coordToPixel(dbCenterX); -// double y1 = mPlot->yAxis->coordToPixel(dbCenterY); -// mPixmap->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x1), mPlot->yAxis->pixelToCoord(y1)); -// mPixmap->topLeft->setCoords(right_Hight, lY2); -// mPixmap->bottomRight->setCoords(left_Low, lY1); + //位置与rect不一样,否则图像反转 mPixmap->topLeft->setCoords(right_Hight, lY1); mPixmap->bottomRight->setCoords(left_Low, lY2); drawResult(left_Low, right_Hight, lY1, lY2); -// mPixmap->topLeft->setCoords(right_Hight, lY1); -// mPixmap->bottomRight->setCoords(left_Low, lY1); - - //mItemTitle->position->setCoords(0.5, 0.5); - // 设置父锚点,定位点 - //mItemTitle->position->setParentAnchor(mRect->bottom); - //mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, - // (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 - mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, lY2 + lY2/2); - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); - updateHandles(); //后面统一刷新上方和下方rect if(bupdate) diff --git a/logPlus/TransparentDraggableSwallCore.cpp b/logPlus/TransparentDraggableSwallCore.cpp index 23de729..a782e25 100644 --- a/logPlus/TransparentDraggableSwallCore.cpp +++ b/logPlus/TransparentDraggableSwallCore.cpp @@ -267,7 +267,7 @@ void TransparentDraggableSwallCore::drawOil(double left_Low, double right_Hight, // 设置矩形范围 -void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight) +void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -277,27 +277,12 @@ void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight mRect->topLeft->setCoords(left_Low, lY1+(m_fLeftSpace+m_fTriangleLen)); mRect->bottomRight->setCoords(right_Hight, lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen); -// //位置与rect不一样,否则图像反转 -// mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4); -// mPixmap_Color->bottomRight->setCoords(left_Low, lY2); - // - //mPixmap_Lith->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4); - //mPixmap_Lith->bottomRight->setCoords(left_Low, lY2); drawLith(left_Low, right_Hight, lY1, lY2); - //位置与rect不一样,否则图像反转 - //mPixmap_Oil->topLeft->setCoords(right_Hight, lY1); - //mPixmap_Oil->bottomRight->setCoords(left_Low, lY1+(lY2-lY1)/4); - drawOil(left_Low, right_Hight, lY1, lY2); + drawOil(left_Low, right_Hight, lY1, lY2); - //mItemTitle->position->setCoords(0.5, 0.5); - // 设置父锚点,定位点 - //mItemTitle->position->setParentAnchor(mRect->bottom); - mItemTitle->position->setCoords(mRect->bottomRight->coords().x(), //(mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, - lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+20); //(mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 - - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); + mItemTitle->position->setCoords(mRect->bottomRight->coords().x(), + lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+20); //三角形2边 m_qcpItemLine1->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace); @@ -310,7 +295,11 @@ void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight m_qcpItemLine3->end->setCoords((left_Low+right_Hight)/2, lY1+(m_fLeftSpace+m_fTriangleLen)); updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/TransparentDraggableSwallCore.h b/logPlus/TransparentDraggableSwallCore.h index 1d64dbf..d328837 100644 --- a/logPlus/TransparentDraggableSwallCore.h +++ b/logPlus/TransparentDraggableSwallCore.h @@ -39,7 +39,7 @@ public: void drawOil(double left_Low, double right_Hight, double lY1, double lY2); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 23d498b..d6ea22d 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -777,6 +777,7 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) QString strSlfName = ""; QString strWellName = ""; QString strLineName = ""; + QString strUnit = "";//单位 QString strAliasName = "";//显示名称 QFont curveNameFont("微软雅黑", 10); // 名称字体 QColor lineColor = QColor(0, 0, 0);//颜色 @@ -823,6 +824,14 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) //qDebug() << "strAliasName:" << strAliasName; } } + if (lineObjInfo.contains("Unit")) + { + QJsonValue value = lineObjInfo.value("Unit"); + if (value.isString()) { + strUnit = value.toString(); + //qDebug() << "strUnit:" << strUnit; + } + } //字体 if (lineObjInfo.contains("curveNameFont")) { @@ -837,8 +846,98 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) { lineColor.setNamedColor(lineObjInfo.value("lineColor").toString()); } + //垂向绘制 + bool bVerticaDrawing = false; + if (lineObjInfo.contains("VerticaDrawing")) + { + QJsonValue value = lineObjInfo.value("VerticaDrawing"); + if (value.isBool()) { + bVerticaDrawing = value.toBool(); + } + } + // 旋转角度 + int nRotationAngle = 0; + if (lineObjInfo.contains("RotationAngle")) + { + QJsonValue value = lineObjInfo.value("RotationAngle"); + if (value.isDouble()) { + nRotationAngle = value.toInt(); + } + } + //套管組件 + bool bDrawStruct_Tubing = true; //绘制结构 + bool bDrawTubing_Tubing = true; //绘制管柱 + bool bDrawTools_Tubing = true; //绘制工具 + bool bDrawSPTool_Tubing = true; //标注工具 + bool bDrawCCL_Tubing = false; //绘制接箍 + float Oguan_Tubing = 63.5; //油管外径 + float inD_Tubing = 121.36; //套管内径 + float OutD_Tubing = 139.7; //套管外径 + if (lineObjInfo.contains("DrawStruct")) + { + QJsonValue value = lineObjInfo.value("DrawStruct"); + if (value.isBool()) { + bDrawStruct_Tubing = value.toBool(); + } + } + // + if (lineObjInfo.contains("DrawTubing")) + { + QJsonValue value = lineObjInfo.value("DrawTubing"); + if (value.isBool()) { + bDrawTubing_Tubing = value.toBool(); + } + } + // + if (lineObjInfo.contains("DrawTools")) + { + QJsonValue value = lineObjInfo.value("DrawTools"); + if (value.isBool()) { + bDrawTools_Tubing = value.toBool(); + } + } + // + if (lineObjInfo.contains("DrawSPTool")) + { + QJsonValue value = lineObjInfo.value("DrawSPTool"); + if (value.isBool()) { + bDrawSPTool_Tubing = value.toBool(); + } + } + // + if (lineObjInfo.contains("DrawCCL")) + { + QJsonValue value = lineObjInfo.value("DrawCCL"); + if (value.isBool()) { + bDrawCCL_Tubing = value.toBool(); + } + } + //---- + if (lineObjInfo.contains("Oguan")) + { + QJsonValue value = lineObjInfo.value("Oguan"); + if (value.isDouble()) { + Oguan_Tubing = value.toDouble(); + } + } + // + if (lineObjInfo.contains("inD")) + { + QJsonValue value = lineObjInfo.value("inD"); + if (value.isDouble()) { + inD_Tubing = value.toDouble(); + } + } + // + if (lineObjInfo.contains("OutD")) + { + QJsonValue value = lineObjInfo.value("OutD"); + if (value.isDouble()) { + OutD_Tubing = value.toDouble(); + } + } QString folderPath = GetLogdataPath(); folderPath = folderPath + g_prjname; @@ -850,7 +949,63 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) listOtherProperty.append(strAliasName);//别名 listOtherProperty.append(lineColor.name());//名称颜色 listOtherProperty.append(curveNameFont.toString());//名称字体 + listOtherProperty.append(strUnit);//单位 + if(bVerticaDrawing)//垂向绘制 + { + listOtherProperty.append("VerticaDrawing"); + } + else{ + listOtherProperty.append("0"); + } + // + listOtherProperty.append(QString::number(nRotationAngle));//旋转角度 + + // + if(bDrawStruct_Tubing) + { + listOtherProperty.append("DrawStruct"); + } + else{ + listOtherProperty.append("0"); + } + // + if(bDrawTubing_Tubing) + { + listOtherProperty.append("DrawTubing"); + } + else{ + listOtherProperty.append("0"); + } + // + if(bDrawTools_Tubing) + { + listOtherProperty.append("DrawTools"); + } + else{ + listOtherProperty.append("0"); + } + // + if(bDrawSPTool_Tubing) + { + listOtherProperty.append("DrawSPTool"); + } + else{ + listOtherProperty.append("0"); + } + // + if(bDrawCCL_Tubing) + { + listOtherProperty.append("DrawCCL"); + } + else{ + listOtherProperty.append("0"); + } + + // + listOtherProperty.append(QString::number(Oguan_Tubing));//油管外径 + listOtherProperty.append(QString::number(inD_Tubing));//套管内径 + listOtherProperty.append(QString::number(OutD_Tubing));//套管外径 //套管組件 this->s_addTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); // } @@ -2985,9 +3140,59 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st //------------------- int iMyWidth = curv->m_OutD_Tubing; //暂时按照套管外径 //curv->axisRect(0)->width(); - if(listOtherProperty.size()>=6) + if(listOtherProperty.size()>=14) { - iMyWidth = listOtherProperty[5].toDouble(); + // + if(listOtherProperty[6]=="DrawStruct") + { + curv->m_bDrawStruct_Tubing = true; + } + else + { + curv->m_bDrawStruct_Tubing = false; + } + // + if(listOtherProperty[7]=="DrawTubing") + { + curv->m_bDrawTubing_Tubing = true; + } + else + { + curv->m_bDrawTubing_Tubing = false; + } + // + if(listOtherProperty[8]=="DrawTools") + { + curv->m_bDrawTools_Tubing = true; + } + else + { + curv->m_bDrawTools_Tubing = false; + } + // + if(listOtherProperty[9]=="DrawSPTool") + { + curv->m_bDrawSPTool_Tubing = true; + } + else + { + curv->m_bDrawSPTool_Tubing = false; + } + // + if(listOtherProperty[10]=="DrawCCL") + { + curv->m_bDrawCCL_Tubing = true; + } + else + { + curv->m_bDrawCCL_Tubing = false; + } + // + curv->m_Oguan_Tubing = listOtherProperty[11].toDouble(); + curv->m_inD_Tubing = listOtherProperty[12].toDouble(); + curv->m_OutD_Tubing = listOtherProperty[13].toDouble(); + // + iMyWidth = listOtherProperty[13].toDouble(); } m_LeftVal = 0; @@ -3038,7 +3243,7 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st } QString strUnit = "mm"; - if(listOtherProperty.size()>=6) + if(listOtherProperty.size()>=14) { strUnit = listOtherProperty[3]; } diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 4763b11..f8bc4f0 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -184,6 +184,19 @@ QJsonObject FormInfo::makeJson() else if (m_strType == "TubingstringObject") { //套管组件 + //垂向绘制 + rootObj["VerticaDrawing"] = m_bVerticaDrawing; + rootObj["RotationAngle"] = m_nRotationAngle; + // + rootObj["DrawStruct"] = m_bDrawStruct_Tubing; + rootObj["DrawTubing"] = m_bDrawTubing_Tubing; + rootObj["DrawTools"] = m_bDrawTools_Tubing; + rootObj["DrawSPTool"] = m_bDrawSPTool_Tubing; + rootObj["DrawCCL"] = m_bDrawCCL_Tubing; + // + rootObj["Oguan"] = m_Oguan_Tubing; + rootObj["inD"] = m_inD_Tubing; + rootObj["OutD"] = m_OutD_Tubing; //item属性写入slf文件,不需要此次记录 return rootObj; diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 95e73b6..4bd0dda 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -182,6 +182,16 @@ public: bool m_bDrawPhase = true; // 绘制亚相 bool m_bDrawMFacName = true; // 微相名称 + //套管组件 + bool m_bDrawStruct_Tubing = true; //绘制结构 + bool m_bDrawTubing_Tubing = true; //绘制管柱 + bool m_bDrawTools_Tubing = true; //绘制工具 + bool m_bDrawSPTool_Tubing = true; //标注工具 + bool m_bDrawCCL_Tubing = false; //绘制接箍 + float m_Oguan_Tubing = 63.5; //油管外径 + float m_inD_Tubing = 121.36; //套管内径 + float m_OutD_Tubing = 139.7; //套管外径 + //tvd //斜井三图一表(井斜数据表参数) QString m_Title_table; diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 0d5f191..e8e8ce4 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -1104,11 +1104,74 @@ void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QStri formInfo->setFrontColor(QColor(0,0,0)); formInfo->setBackColor(QColor(255,255,255)); // - if(listOtherProperty.size()>=3) + if(listOtherProperty.size()>=6) { QFont curveNameFont("微软雅黑", 10); // 名称字体 curveNameFont.fromString(listOtherProperty[2]); formInfo->m_curveNameFont = curveNameFont; + // + if(listOtherProperty[4]=="VerticaDrawing") + { + formInfo->m_bVerticaDrawing = true; + } + else + { + formInfo->m_bVerticaDrawing = false; + } + // + formInfo->m_nRotationAngle = listOtherProperty[4].toInt(); + } + if(listOtherProperty.size()>=14) + { + // + if(listOtherProperty[6]=="DrawStruct") + { + formInfo->m_bDrawStruct_Tubing = true; + } + else + { + formInfo->m_bDrawStruct_Tubing = false; + } + // + if(listOtherProperty[7]=="DrawTubing") + { + formInfo->m_bDrawTubing_Tubing = true; + } + else + { + formInfo->m_bDrawTubing_Tubing = false; + } + // + if(listOtherProperty[8]=="DrawTools") + { + formInfo->m_bDrawTools_Tubing = true; + } + else + { + formInfo->m_bDrawTools_Tubing = false; + } + // + if(listOtherProperty[9]=="DrawSPTool") + { + formInfo->m_bDrawSPTool_Tubing = true; + } + else + { + formInfo->m_bDrawSPTool_Tubing = false; + } + // + if(listOtherProperty[10]=="DrawCCL") + { + formInfo->m_bDrawCCL_Tubing = true; + } + else + { + formInfo->m_bDrawCCL_Tubing = false; + } + // + formInfo->m_Oguan_Tubing = listOtherProperty[11].toDouble(); + formInfo->m_inD_Tubing = listOtherProperty[12].toDouble(); + formInfo->m_OutD_Tubing = listOtherProperty[13].toDouble(); } //设置高度 ui->tableWidget->setRowHeight(row, 100); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 95be37a..28826e9 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -149,6 +149,10 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeGeoLithShow(QString, QString, QString, QString, QString, QString, bool)), this, SLOT(s_changeGeoLithShow(QString, QString, QString, QString, QString, QString, bool))); //改变沉积相属性,是否显示 connect(CallManage::getInstance(), SIGNAL(sig_changeFacShow(QString, QString, QString, QString, QString, QString, bool)), this, SLOT(s_changeFacShow(QString, QString, QString, QString, QString, QString, bool))); + //改变套管组件属性,是否显示 + connect(CallManage::getInstance(), SIGNAL(sig_changeGuanShow(QString, QString, QString, QString, QString, QString, bool)), this, SLOT(s_changeGuanShow(QString, QString, QString, QString, QString, QString, bool))); + //改变套管组件属性,直径 + connect(CallManage::getInstance(), SIGNAL(sig_changeGuanD(QString, QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGuanD(QString, QString, QString, QString, QString, QString, double))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW) @@ -958,6 +962,32 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) } } } + //沉积相 + QObjectList objList_MFac = m_mapDraggable_MFac.values(); + for( int i = 0; i< objList_MFac.size(); i++) + { + TransparentDraggableMFac* tdMFac = qobject_cast(objList_MFac.at(i)); + if (tdMFac) + { + if (tdMFac->getCursor() > nmaxCursor) + { + nmaxCursor = tdMFac->getCursor(); + } + } + } + //套管组件 + QObjectList objList_Guan = m_mapDraggable_Guan.values(); + for( int i = 0; i< objList_Guan.size(); i++) + { + TransparentDraggableGuan* tdGuan = qobject_cast(objList_Guan.at(i)); + if (tdGuan) + { + if (tdGuan->getCursor() > nmaxCursor) + { + nmaxCursor = tdGuan->getCursor(); + } + } + } if (nmaxCursor == 2) { @@ -1588,7 +1618,7 @@ void QMyCustomPlot::onEditLayer() { QColor bkColor(255,255,255); //添加地质分层 - this->addLayerToPlot(left_Low, right_Hight, "", bkColor); + this->addLayerToPlot(left_Low, right_Hight, "", true, bkColor); //保存 this->SaveToSLF_Layer(); @@ -2886,8 +2916,10 @@ void QMyCustomPlot::moveItems_SWallCore() pDraggableRect->m_fLeftSpace += dleft*g_dPixelPerCm; //刷新 QCPRange tmpRange = pDraggableRect->getRange(); - pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); } + //统一刷新 + replot(); //保存 this->SaveToSLF_SwallCore(); @@ -3373,11 +3405,11 @@ bool QMyCustomPlot::LoadFromSLF_GeoLith(QString strSlfName, QString strLineName) } //不单独刷新 - bool bRefresh = true; + bool bRefresh = false;//true; this->addGeoLithToPlot(-m_Result->EDEP, -m_Result->SDEP, Lith, Oil, Color, bRefresh); } //最后统一刷新 - //widget->replot(); + this->replot(); logio->CloseTable(iIndex); delete m_Result; @@ -3521,8 +3553,10 @@ bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineNam if(width<=0) width=1; // - addSwallCoreToPlot(-m_Result.Depth, LithologyImage, OilGasImage, ColorImage, Sideleft, width, m_Result.CoreColor); + addSwallCoreToPlot(-m_Result.Depth, LithologyImage, OilGasImage, ColorImage, Sideleft, width, m_Result.CoreColor, false); } + //统一刷新 + this->replot(); logio->CloseTable(iIndex); } delete logio; @@ -3936,8 +3970,10 @@ bool QMyCustomPlot::LoadFromSLF_Gujing(QString strSlfName, QString strLineName) result=QDir::toNativeSeparators(svg); //显示固井 - addGujingToPlot(-EDEP, -SDEP, result); + addGujingToPlot(-EDEP, -SDEP, result, false); } + //统一刷新 + this->replot(); logio->CloseTable(iIndex); delete m_Result; } @@ -4602,7 +4638,7 @@ void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QSt m_mapDraggable_Line[strUuid] = dragRect; } -void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) +void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4612,14 +4648,14 @@ void QMyCustomPlot::addTextToPlot(double left_Low, double right_Hight, const QSt // 可选:设置颜色 dragRect->setColor(crColor); // 半透明白色 // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); //最小宽度 dragRect->setMinWidth(0.1); m_mapDraggable_Rect[strUuid] = dragRect; } -void QMyCustomPlot::addLayerToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) +void QMyCustomPlot::addLayerToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4629,7 +4665,7 @@ void QMyCustomPlot::addLayerToPlot(double left_Low, double right_Hight, const QS // 可选:设置颜色 dragRect->setColor(crColor); // 半透明白色 // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); //最小宽度 dragRect->setMinWidth(0.1); @@ -4685,7 +4721,7 @@ void QMyCustomPlot::addResultToPlot(double left_Low, double right_Hight, QStrin m_mapDraggable_Result[strUuid] = dragRect; } -void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor) +void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor, bool bRefresh) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4703,7 +4739,7 @@ void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QSt double x1 = this->xAxis->coordToPixel(Depth); // double Depth2 = this->xAxis->pixelToCoord(x1-h); - dragRect->setRange(Depth, Depth2); + dragRect->setRange(Depth, Depth2, bRefresh); // 可选:设置颜色 dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色255, 100, 100, 80 //最小宽度 @@ -4741,7 +4777,7 @@ void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const //this->replot(); } -void QMyCustomPlot::addGujingToPlot(double left_Low, double right_Hight, const QString strResult) +void QMyCustomPlot::addGujingToPlot(double left_Low, double right_Hight, const QString strResult, bool bRefresh) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4751,7 +4787,7 @@ void QMyCustomPlot::addGujingToPlot(double left_Low, double right_Hight, const Q //图片,提前设值,后面setRange改变 dragRect->setResult(strResult); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色 //最小宽度 @@ -4763,7 +4799,7 @@ void QMyCustomPlot::addGujingToPlot(double left_Low, double right_Hight, const Q } //气测/FMT/射孔/文本 -void QMyCustomPlot::addJiegutextToPlot(double left_Low, double right_Hight, const QStringList strText, const QStringList strList_coredat, QColor crColor) +void QMyCustomPlot::addJiegutextToPlot(double left_Low, double right_Hight, const QStringList strText, const QStringList strList_coredat, bool bRefresh, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4771,7 +4807,7 @@ void QMyCustomPlot::addJiegutextToPlot(double left_Low, double right_Hight, cons // 在初始化代码中 TransparentDraggableJiegutext *dragRect = new TransparentDraggableJiegutext(this, strUuid, 1.0, strText); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 dragRect->setColor(crColor); // 半透明白色 //最小宽度 @@ -4782,7 +4818,7 @@ void QMyCustomPlot::addJiegutextToPlot(double left_Low, double right_Hight, cons } //沉积相-微相 -void QMyCustomPlot::addMFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) +void QMyCustomPlot::addMFacToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4790,7 +4826,7 @@ void QMyCustomPlot::addMFacToPlot(double left_Low, double right_Hight, const QSt // 在初始化代码中 TransparentDraggableMFac *dragRect = new TransparentDraggableMFac(this, strUuid); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 dragRect->setColor(crColor); // 半透明白色 //最小宽度 @@ -4801,7 +4837,7 @@ void QMyCustomPlot::addMFacToPlot(double left_Low, double right_Hight, const QSt } //沉积相-亚相 -void QMyCustomPlot::addPhaseToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) +void QMyCustomPlot::addPhaseToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4809,7 +4845,7 @@ void QMyCustomPlot::addPhaseToPlot(double left_Low, double right_Hight, const QS // 在初始化代码中 TransparentDraggablePhase *dragRect = new TransparentDraggablePhase(this, strUuid); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 dragRect->setColor(crColor); // 半透明白色 //最小宽度 @@ -4820,7 +4856,7 @@ void QMyCustomPlot::addPhaseToPlot(double left_Low, double right_Hight, const QS } //沉积相-相 -void QMyCustomPlot::addFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) +void QMyCustomPlot::addFacToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4828,7 +4864,7 @@ void QMyCustomPlot::addFacToPlot(double left_Low, double right_Hight, const QStr // 在初始化代码中 TransparentDraggableFac *dragRect = new TransparentDraggableFac(this, strUuid); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 dragRect->setColor(crColor); // 半透明白色 //最小宽度 @@ -4839,7 +4875,7 @@ void QMyCustomPlot::addFacToPlot(double left_Low, double right_Hight, const QStr } //套管 -void QMyCustomPlot::addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in) +void QMyCustomPlot::addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in, bool bRefresh) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -4851,9 +4887,9 @@ void QMyCustomPlot::addGuanToPlot(double left_Low, double right_Hight, const QSt //图片,提前设值,后面setRange改变 dragRect->setResult(imagePath); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 - dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色 + dragRect->setColor(QColor(255, 255, 255, 0)); // 透明 //最小宽度 dragRect->setMinWidth(0.1); //dragRect->setTitle(strText); @@ -6272,9 +6308,10 @@ void QMyCustomPlot::s_changeFacShow(QString strUuid, QString strSlfName, QString it++; //刷新 QCPRange tmpRange = pDraggableRect->getRange(); - pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); - //pDraggableRect->setTitle(pDraggableRect->mstrTitle); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); } + //统一刷新 + replot(); } } else if(propertyData == "绘制亚相") @@ -6291,9 +6328,10 @@ void QMyCustomPlot::s_changeFacShow(QString strUuid, QString strSlfName, QString it++; //刷新 QCPRange tmpRange = pDraggableRect->getRange(); - pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); - //pDraggableRect->setTitle(pDraggableRect->mstrTitle); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); } + //统一刷新 + replot(); } } else if(propertyData == "微相名称") @@ -6309,9 +6347,10 @@ void QMyCustomPlot::s_changeFacShow(QString strUuid, QString strSlfName, QString it++; //刷新 QCPRange tmpRange = pDraggableRect->getRange(); - pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); - //pDraggableRect->setTitle(pDraggableRect->mstrTitle); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); } + //统一刷新 + replot(); } } @@ -6319,6 +6358,262 @@ void QMyCustomPlot::s_changeFacShow(QString strUuid, QString strSlfName, QString //不清空属性窗口 } +//绘制结构 +void QMyCustomPlot::DrawStruct() +{ + //先删除 + if(mRect_Tubing) + { + removeItem(mRect_Tubing); + mRect_Tubing = nullptr; + } + if(mRect2_Tubing) + { + removeItem(mRect2_Tubing); + mRect2_Tubing = nullptr; + } + if(m_bDrawStruct_Tubing) + { + //绘制套管 + float upper = this->xAxis->range().upper; + float lower = this->xAxis->range().lower; + double lY1 = this->yAxis->range().lower; + double lY2 = this->yAxis->range().upper; + // 创建矩形 + mRect_Tubing = new QCPItemRect(this); + mRect_Tubing->setLayer("overlay"); // 确保在最上层 + mRect_Tubing->setBrush(QBrush(QColor(0, 0, 0, 255))); + mRect_Tubing->setPen(QPen(QColor(0, 0, 0, 255))); + mRect_Tubing->topLeft->setCoords(lower, lY1 + (lY2-lY1-m_OutD_Tubing)/2.0); + mRect_Tubing->bottomRight->setCoords(upper, lY1 + (lY2-lY1-m_inD_Tubing)/2.0); + + // 创建矩形 + mRect2_Tubing = new QCPItemRect(this); + mRect2_Tubing->setLayer("overlay"); // 确保在最上层 + mRect2_Tubing->setBrush(QBrush(QColor(0, 0, 0, 255))); + mRect2_Tubing->setPen(QPen(QColor(0, 0, 0, 255))); + mRect2_Tubing->topLeft->setCoords(lower, lY2 - (lY2-lY1-m_OutD_Tubing)/2.0); + mRect2_Tubing->bottomRight->setCoords(upper, lY2 - (lY2-lY1-m_inD_Tubing)/2.0); + } +} + +//绘制管柱 +void QMyCustomPlot::DrawTubing() +{ + //先删除 + if(mPixmap_Tubing) + { + removeItem(mPixmap_Tubing); + mPixmap_Tubing = nullptr; + } + if(m_bDrawTubing_Tubing) + { + QString shotimgfile=GetSymbolDir()+"\\管柱组件\\管柱.png"; + + double lY1 = this->yAxis->range().lower;//+10 + double lY2 = this->yAxis->range().upper; + // + + mPixmap_Tubing = new QCPItemPixmap(this); + //mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片 + mPixmap_Tubing->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 + mPixmap_Tubing->setLayer("grid"); // 确保在最上层overlay + // + float upper = this->xAxis->range().upper; + mPixmap_Tubing->topLeft->setCoords(upper, lY1 + (lY2-lY1-m_Oguan_Tubing)/2.0); + mPixmap_Tubing->bottomRight->setCoords(-m_depth_Tubing, lY2 - (lY2-lY1-m_Oguan_Tubing)/2.0); + mPixmap_Tubing->setPixmap(QPixmap(shotimgfile)); // 设置图片 + } +} + +//改变沉积相属性,是否显示 +void QMyCustomPlot::s_changeGuanShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow) +{ + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + + if(propertyData == "绘制结构") + { + m_bDrawStruct_Tubing = bShow; + //绘制结构 + DrawStruct(); + //刷新 + replot(); + } + else if(propertyData == "绘制管柱") + { + m_bDrawTubing_Tubing = bShow; + + //绘制管柱 + DrawTubing(); + //刷新 + replot(); + } + else if(propertyData == "绘制工具") + { + m_bDrawTools_Tubing = bShow; + { + // + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); + } + //统一刷新 + replot(); + } + } + else if(propertyData == "标注工具") + { + m_bDrawSPTool_Tubing = bShow; + { + // + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); + } + //统一刷新 + replot(); + } + } + else if(propertyData == "绘制接箍") + { + m_bDrawCCL_Tubing = bShow; + { + // + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + if(m_bDrawCCL_Tubing) + { + pDraggableRect->mIn = m_inD_Tubing+1; + } + else + { + pDraggableRect->mIn = m_Oguan_Tubing+1; + } + + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); + } + //统一刷新 + replot(); + } + } + + + //不清空属性窗口 +} + +//改变沉积相属性,是否显示 +void QMyCustomPlot::s_changeGuanD(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, double newD) +{ + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + + if(propertyData == "油管外径") + { + m_Oguan_Tubing = newD; + //绘制管柱 + DrawTubing(); + // + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + if(m_bDrawCCL_Tubing) + { + pDraggableRect->mIn = m_inD_Tubing+1; + } + else + { + pDraggableRect->mIn = m_Oguan_Tubing+1; + } + + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); + } + //刷新 + replot(); + } + else if(propertyData == "套管内径") + { + m_inD_Tubing = newD; + //绘制结构 + DrawStruct(); + // + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + if(m_bDrawCCL_Tubing) + { + pDraggableRect->mIn = m_inD_Tubing+1; + } + else + { + pDraggableRect->mIn = m_Oguan_Tubing+1; + } + + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); + } + //刷新 + replot(); + } + else if(propertyData == "套管外径") + { + m_OutD_Tubing = newD; + //绘制结构 + DrawStruct(); + //刷新 + replot(); + } + + //不清空属性窗口 +} + bool QMyCustomPlot::LoadFromSLF_Layer(QString strSlfName, QString strLineName) { LAYER_DATA m_Result; @@ -6363,8 +6658,11 @@ bool QMyCustomPlot::LoadFromSLF_Layer(QString strSlfName, QString strLineName) QColor bkColor = rgbList.at(j%ColorNum); //地质分层 - this->addLayerToPlot(-edep, -sdep, QString::fromLocal8Bit(buf), bkColor); + this->addLayerToPlot(-edep, -sdep, QString::fromLocal8Bit(buf), false, bkColor); } + //统一刷新 + this->replot(); + logio->CloseTable(iIndex); } delete logio; @@ -6429,8 +6727,11 @@ bool QMyCustomPlot::LoadFromSLF_Text(QString strSlfName, QString strLineName) // wordfont.setPointSize(10); //插入文本 - this->addTextToPlot(-m_Result->EndDepth, -m_Result->StartDepth, QString::fromLocal8Bit(m_Result->Words)); + this->addTextToPlot(-m_Result->EndDepth, -m_Result->StartDepth, QString::fromLocal8Bit(m_Result->Words), false); } + //统一刷新 + this->replot(); + logio->CloseTable(iIndex); delete buf; } @@ -6715,8 +7016,10 @@ bool QMyCustomPlot::LoadFromSLF_Jiegutext(QString strSlfName, QString csCurve, Q } // - this->addJiegutextToPlot(-bottom, -top, CoreValues, coredat); + this->addJiegutextToPlot(-bottom, -top, CoreValues, coredat, false); } + //统一刷新 + this->replot(); logio->CloseTable(iIndex); delete m_pResult; } @@ -7778,7 +8081,7 @@ void QMyCustomPlot::ReadData_Fac(QString strSlfName, QString csCurve, bool bAdd) if(bAdd) { //微相 - this->addMFacToPlot(-frac.edep, -frac.sdep, QString::fromLocal8Bit(frac.mFac)); + this->addMFacToPlot(-frac.edep, -frac.sdep, QString::fromLocal8Bit(frac.mFac), false); } } mrw.CloseTable(iIndex); @@ -7850,12 +8153,12 @@ void QMyCustomPlot::DrawFac(int iType) if (iType==1) { //相 - this->addFacToPlot(-bottom, -top, str1); + this->addFacToPlot(-bottom, -top, str1, false); } else { //亚相 - this->addPhaseToPlot(-bottom, -top, str1); + this->addPhaseToPlot(-bottom, -top, str1, false); } //添加最后1个不同的item @@ -7866,12 +8169,12 @@ void QMyCustomPlot::DrawFac(int iType) if (iType==1) { //相 - this->addFacToPlot(-bottom, -top, str1); + this->addFacToPlot(-bottom, -top, str1, false); } else { //亚相 - this->addPhaseToPlot(-bottom, -top, str1); + this->addPhaseToPlot(-bottom, -top, str1, false); } } else @@ -7881,12 +8184,12 @@ void QMyCustomPlot::DrawFac(int iType) if (iType==1) { //相 - this->addFacToPlot(-bottom, -top, str1); + this->addFacToPlot(-bottom, -top, str1, false); } else { //亚相 - this->addPhaseToPlot(-bottom, -top, str1); + this->addPhaseToPlot(-bottom, -top, str1, false); } } } @@ -7900,12 +8203,12 @@ void QMyCustomPlot::DrawFac(int iType) if (iType==1) { //相 - this->addFacToPlot(-bottom, -top, str1); + this->addFacToPlot(-bottom, -top, str1, false); } else { //亚相 - this->addPhaseToPlot(-bottom, -top, str1); + this->addPhaseToPlot(-bottom, -top, str1, false); } top = pObj.sdep; str1=str2; @@ -7962,6 +8265,7 @@ bool QMyCustomPlot::LoadFromSLF_Fac(QString strSlfName, QString csCurve, bool bA DrawFac(1);//相 DrawFac(2);//亚相 + //统一刷新 replot(); return true; } @@ -8264,59 +8568,16 @@ bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve) Number == zoneOrder_Tubing.value("剌叭口").toInt()) { bDrawGuanzhu = true;//画管柱 + m_depth_Tubing = depth;//管柱深度 - QString shotimgfile=GetSymbolDir()+"\\管柱组件\\管柱.png"; - //QImage shotimg(shotimgfile); - //pPainter->drawImage(rect,shotimg); - - double lY1 = this->yAxis->range().lower;//+10 - double lY2 = this->yAxis->range().upper; - QCPItemPixmap *mPixmap; - mPixmap = new QCPItemPixmap(this); - //mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片 - mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 - mPixmap->setLayer("overlay"); // 确保在最上层 - // - float upper = this->xAxis->range().upper; - mPixmap->topLeft->setCoords(upper, lY1 + (lY2-lY1-m_Oguan_Tubing)/2.0); - mPixmap->bottomRight->setCoords(-depth, lY2 - (lY2-lY1-m_Oguan_Tubing)/2.0); - mPixmap->setPixmap(QPixmap(shotimgfile)); // 设置图片 + //绘制管柱 + DrawTubing(); } } } - //先删除 - if(mRect_Tubing) - { - removeItem(mRect_Tubing); - mRect_Tubing = nullptr; - } - if(mRect2_Tubing) - { - removeItem(mRect2_Tubing); - mRect2_Tubing = nullptr; - } - //绘制套管 - float upper = this->xAxis->range().upper; - float lower = this->xAxis->range().lower; - double lY1 = this->yAxis->range().lower; - double lY2 = this->yAxis->range().upper; - // 创建矩形 - mRect_Tubing = new QCPItemRect(this); - mRect_Tubing->setLayer("overlay"); // 确保在最上层 - mRect_Tubing->setBrush(QBrush(QColor(0, 0, 0, 255))); - mRect_Tubing->setPen(QPen(QColor(0, 0, 0, 255))); - mRect_Tubing->topLeft->setCoords(lower, lY1 + (lY2-lY1-m_OutD_Tubing)/2.0); - mRect_Tubing->bottomRight->setCoords(upper, lY1 + (lY2-lY1-m_Oind_Tubing)/2.0); - - // 创建矩形 - mRect2_Tubing = new QCPItemRect(this); - mRect2_Tubing->setLayer("overlay"); // 确保在最上层 - mRect2_Tubing->setBrush(QBrush(QColor(0, 0, 0, 255))); - mRect2_Tubing->setPen(QPen(QColor(0, 0, 0, 255))); - mRect2_Tubing->topLeft->setCoords(lower, lY2 - (lY2-lY1-m_OutD_Tubing)/2.0); - mRect2_Tubing->bottomRight->setCoords(upper, lY2 - (lY2-lY1-m_Oind_Tubing)/2.0); - + //绘制结构 + DrawStruct(); // logio->CloseTable(iIndex); delete m_pResult; @@ -8329,6 +8590,9 @@ bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve) // drawOne_Tubing(result); } + //统一刷新 + this->replot(); + return true; } @@ -8364,7 +8628,7 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result) } else { - in=m_Oguan_Tubing+1; + in=m_inD_Tubing+1; } QString name; @@ -8383,7 +8647,7 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result) float lower = this->xAxis->coordToPixel(-depth)+h/2.0; float newUpper = this->xAxis->pixelToCoord(upper); float newLower = this->xAxis->pixelToCoord(lower); - this->addGuanToPlot(newLower, newUpper, cclimgfile, in); + this->addGuanToPlot(newLower, newUpper, cclimgfile, in, false); } bool QMyCustomPlot::SaveToSLF_Tubing() diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 248f7aa..98462ea 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -271,21 +271,30 @@ public: void SaveToSLF_Fac(); //套管組件 + bool m_bDrawStruct_Tubing = true; //绘制结构 + bool m_bDrawTubing_Tubing = true; //绘制管柱 + bool m_bDrawTools_Tubing = true; //绘制工具 + bool m_bDrawSPTool_Tubing = true; //标注工具 + bool m_bDrawCCL_Tubing = false; //绘制接箍 + float m_Oguan_Tubing = 63.5; //油管外径 + float m_inD_Tubing = 121.36; //套管内径 + float m_OutD_Tubing = 139.7; //套管外径 + // QMap zoneOrder_Tubing; - float m_Oguan_Tubing = 63.5;//油管外径 - float m_Oind_Tubing = 121.36;//套管内径 - float m_OutD_Tubing = 139.7; //套管外径 - bool m_bDrawCCL_Tubing = false; QString cclimgpath_Tubing=""; QList m_pResultList_Tubing; QString m_strAddTubing=""; - QCPItemRect *mRect_Tubing=nullptr; - QCPItemRect *mRect2_Tubing=nullptr; + QCPItemRect *mRect_Tubing=nullptr; //套管左侧图像 + QCPItemRect *mRect2_Tubing=nullptr; //套管右侧图像 + QCPItemPixmap *mPixmap_Tubing=nullptr; //管柱图像 + double m_depth_Tubing = 0; //管柱深度 bool LoadFromSLF_Tubing(QString strSlfName, QString csCurve); void drawOne_Tubing(Slf_JIEGUPOS result); bool SaveToSLF_Tubing(); - - + //绘制结构 + void DrawStruct(); + //绘制管柱 + void DrawTubing(); public slots: void slot_time(); @@ -304,10 +313,10 @@ public: double newLeftScale, double newRightScale, QString strScaleType, QColor &newlineColor, double width, Qt::PenStyle lineStyle); //文字结论 - void addTextToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); + void addTextToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80)); //地质分层 - void addLayerToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); + void addLayerToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80)); //解释结论 TransparentGroupResult* addResultGroup(double left_Low, double right_Hight, QString &strUuid, QString strText = ""); @@ -317,22 +326,22 @@ public: void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor, bool bRefresh=true); //井壁取心 - void addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor); + void addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor, bool bRefresh=true); //固井结论 - void addGujingToPlot(double left_Low, double right_Hight, const QString strResult); + void addGujingToPlot(double left_Low, double right_Hight, const QString strResult, bool bRefresh=true); //气测/FMT/射孔/文本 - void addJiegutextToPlot(double left_Low, double right_Hight, const QStringList strText, const QStringList strList_coredat, QColor crColor=QColor(255, 255, 255, 80)); + void addJiegutextToPlot(double left_Low, double right_Hight, const QStringList strText, const QStringList strList_coredat, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80)); //沉积相 - void addMFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); - void addPhaseToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); - void addFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); + void addMFacToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80)); + void addPhaseToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80)); + void addFacToPlot(double left_Low, double right_Hight, const QString strText, bool bRefresh=true, QColor crColor=QColor(255, 255, 255, 80)); //套管组件 - void addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in); - + void addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in, bool bRefresh=true); + // void addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); //框选并编辑曲线 @@ -522,6 +531,12 @@ public slots: //改变沉积相属性,是否显示 void s_changeFacShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + //改变套管组件属性,是否显示 + void s_changeGuanShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + + //改变套管组件属性,直径 + void s_changeGuanD(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, double newD); + public: //蝌蚪图重绘网格线 bool mKedou = false; diff --git a/logPlus/transparentdraggableGuan.cpp b/logPlus/transparentdraggableGuan.cpp index ac0ac08..cadba8d 100644 --- a/logPlus/transparentdraggableGuan.cpp +++ b/logPlus/transparentdraggableGuan.cpp @@ -90,11 +90,22 @@ void TransparentDraggableGuan::setOin(float in) // //mPlot->replot(); //} -//设置解释结论 +//设置套管组件 void TransparentDraggableGuan::setResult(QString filePath) { m_Result = filePath; mPixmap->setPixmap(QPixmap(filePath)); // 设置图片 + // + // + QString name,itemName; + this->m_Result.replace("\\","/"); + int l=this->m_Result.lastIndexOf("/"); + if(l>-1) name=this->m_Result.mid(l+1); + l=name.indexOf("."); + name=name.left(l); + itemName=name; + mstrTitle = itemName; + mItemTitle->setText(mstrTitle); } void TransparentDraggableGuan::drawResult(double left_Low, double right_Hight, double lY1, double lY2) @@ -176,31 +187,61 @@ void TransparentDraggableGuan::drawResult(double left_Low, double right_Hight, d } // 设置矩形范围 -void TransparentDraggableGuan::setRange(double left_Low, double right_Hight) +void TransparentDraggableGuan::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; + //套管组件高度 + mH = right_Hight-left_Low; + double lY1 = mPlot->yAxis->range().lower;//+10 double lY2 = mPlot->yAxis->range().upper; + mRect->topLeft->setCoords(left_Low, lY1 + (lY2-lY1-mIn)/2.0); mRect->bottomRight->setCoords(right_Hight, lY2 - (lY2-lY1-mIn)/2.0); + //绘制工具 + if(mPlot->m_bDrawTools_Tubing) + { + //位置与rect不一样,否则图像反转 + mPixmap->topLeft->setCoords(right_Hight, lY1 + (lY2-lY1-mIn)/2.0); + mPixmap->bottomRight->setCoords(left_Low, lY2 - (lY2-lY1-mIn)/2.0); + } + else + { + //位置与rect不一样,否则图像反转 + mPixmap->topLeft->setCoords(0, 0); + mPixmap->bottomRight->setCoords(0, 0); + } - //位置与rect不一样,否则图像反转 - mPixmap->topLeft->setCoords(right_Hight, lY1 + (lY2-lY1-mIn)/2.0); - mPixmap->bottomRight->setCoords(left_Low, lY2 - (lY2-lY1-mIn)/2.0); - //drawResult(left_Low, right_Hight, lY1, lY2); + //标注工具 + if(mPlot->m_bDrawSPTool_Tubing) + { + mItemTitle->setText(mstrTitle); + } + else + { + mItemTitle->setText(""); + } - //mItemTitle->position->setCoords(0.5, 0.5); - // 设置父锚点,定位点 - //mItemTitle->position->setParentAnchor(mRect->bottom); -// mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, -// (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + // + mstrTitle2 = QString::number(-(right_Hight+left_Low)/2.0); + mItemTitle2->setText(mstrTitle2); - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); + // + float fSpace = (lY2 - lY1)/(float)5; + float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15; + mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + 3*fSpace); // 设置文本在矩形中心位置 + // + mItemTitle2->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + 4*fSpace + 0.5*fSpace); // 设置文本在矩形中心位置 updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 @@ -233,7 +274,8 @@ void TransparentDraggableGuan::deleteRect() // mPlot->removeItem(mLeftHandle); // mPlot->removeItem(mRightHandle); mPlot->removeItem(mPixmap); -// mPlot->removeItem(mItemTitle); + mPlot->removeItem(mItemTitle); + mPlot->removeItem(mItemTitle2); //mPlot->replot(); this->deleteLater(); @@ -287,8 +329,8 @@ void TransparentDraggableGuan::initRect() // 创建透明矩形 mRect = new QCPItemRect(mPlot); mRect->setLayer("overlay"); // 确保在最上层 - mRect->setBrush(QBrush(QColor(255, 255, 255, 50))); // 半透明蓝色 - mRect->setPen(QPen(QColor(70, 70, 255, 200))); + mRect->setBrush(QBrush(QColor(255, 255, 255, 0))); // 透明 + mRect->setPen(QPen(QColor(70, 70, 255, 0)));// 透明 // // 创建左右边界控制点 // mLeftHandle = new QCPItemRect(mPlot); @@ -315,16 +357,29 @@ void TransparentDraggableGuan::initRect() mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 mPixmap->setLayer("overlay"); // 确保在最上层 -// mItemTitle = new QCPItemText(mPlot); -// mItemTitle->setText(mstrTitle); -// //mItemTitle->setBrush(QBrush(Qt::red)); -// mItemTitle->setFont(QFont("Arial", 12, QFont::Bold)); -// mItemTitle->setColor(Qt::black); -// mItemTitle->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter); -// mItemTitle->position->setType(QCPItemPosition::ptPlotCoords); -// //mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio); -// mItemTitle->position->setCoords(0.5, 0); -// mItemTitle->setLayer("overlay"); + mItemTitle = new QCPItemText(mPlot); + mItemTitle->setText(mstrTitle); + //mItemTitle->setBrush(QBrush(Qt::red)); + mItemTitle->setFont(QFont("Arial", 12, QFont::Bold)); + mItemTitle->setColor(Qt::black); + mItemTitle->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter); + mItemTitle->position->setType(QCPItemPosition::ptPlotCoords); + //mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio); + mItemTitle->position->setCoords(0.5, 0); + mItemTitle->setLayer("overlay"); + mItemTitle->setRotation(90);//竖直文字 + // + mItemTitle2 = new QCPItemText(mPlot); + mItemTitle2->setText(mstrTitle2); + //mItemTitle2->setBrush(QBrush(Qt::red)); + mItemTitle2->setFont(QFont("Arial", 12, QFont::Bold)); + mItemTitle2->setColor(Qt::black); + mItemTitle2->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter); + mItemTitle2->position->setType(QCPItemPosition::ptPlotCoords); + //mItemTitle2->position->setType(QCPItemPosition::ptAxisRectRatio); + mItemTitle2->position->setCoords(0.5, 0); + mItemTitle2->setLayer("overlay"); + mItemTitle2->setRotation(90);//竖直文字 } void TransparentDraggableGuan::updateHandles() @@ -379,9 +434,9 @@ void TransparentDraggableGuan::onMousePress(QMouseEvent *event) //event->accept(); -// double low = mRect->topLeft->coords().x(); -// double hight = mRect->bottomRight->coords().x(); -// PropertyService()->initTubingItemProperty(this, low, hight, m_Result); + double low = mRect->topLeft->coords().x(); + double hight = mRect->bottomRight->coords().x(); + PropertyService()->initTubingItemProperty(this, low, hight, m_Result); QMenu menu(nullptr); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &TransparentDraggableGuan::onDelRect); @@ -557,9 +612,9 @@ void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event) event->accept(); //属性 { -// double low = mRect->topLeft->coords().x(); -// double hight = mRect->bottomRight->coords().x(); -// PropertyService()->initGujingItemProperty(this, low, hight, m_Result); + double low = mRect->topLeft->coords().x(); + double hight = mRect->bottomRight->coords().x(); + PropertyService()->initTubingItemProperty(this, low, hight, m_Result); if(m_bChange) { //保存 diff --git a/logPlus/transparentdraggableGuan.h b/logPlus/transparentdraggableGuan.h index f0b0d55..1e38ab4 100644 --- a/logPlus/transparentdraggableGuan.h +++ b/logPlus/transparentdraggableGuan.h @@ -37,7 +37,7 @@ public: void drawResult(double left_Low, double right_Hight, double lY1, double lY2); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); @@ -70,8 +70,10 @@ public: // QCPItemRect *mRightHandle; QCPItemPixmap *mPixmap; -// QCPItemText *mItemTitle; -// QString mstrTitle=""; + QCPItemText *mItemTitle; + QString mstrTitle=""; + QCPItemText *mItemTitle2; + QString mstrTitle2=""; QString m_strUuid = ""; QString m_Result; @@ -83,7 +85,10 @@ public: // 添加最小宽度成员变量 double mMinWidth; - float mIn=123; + //套管组件外径 + float mIn = 123; + //套管组件高度 + double mH = 0; //鼠标形状 bool m_bArrow = false; diff --git a/logPlus/transparentdraggableRightList.cpp b/logPlus/transparentdraggableRightList.cpp index 236d453..d145fac 100644 --- a/logPlus/transparentdraggableRightList.cpp +++ b/logPlus/transparentdraggableRightList.cpp @@ -103,7 +103,7 @@ void TransparentDraggableRightList::setRightList(QList new_DepthList, QL } // 设置矩形范围 -void TransparentDraggableRightList::setRange(double left_Low, double right_Hight) +void TransparentDraggableRightList::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -118,7 +118,11 @@ void TransparentDraggableRightList::setRange(double left_Low, double right_Hight double delta = (right_Hight - left_Low) / (double)(m_left_Low_Number-m_right_Hight_Number-1); updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/transparentdraggableRightList.h b/logPlus/transparentdraggableRightList.h index 467a87c..e3f6c79 100644 --- a/logPlus/transparentdraggableRightList.h +++ b/logPlus/transparentdraggableRightList.h @@ -33,7 +33,7 @@ public: void setRightList(QList new_DepthList, QList new_ValueList); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/transparentdraggableSelectRect.cpp b/logPlus/transparentdraggableSelectRect.cpp index d8a61a3..6bc1271 100644 --- a/logPlus/transparentdraggableSelectRect.cpp +++ b/logPlus/transparentdraggableSelectRect.cpp @@ -106,7 +106,7 @@ void TransparentDraggableSelectRect::setNumber(int left_Low_Number, int right_Hi } // 设置矩形范围 -void TransparentDraggableSelectRect::setRange(double left_Low, double right_Hight) +void TransparentDraggableSelectRect::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -130,7 +130,11 @@ void TransparentDraggableSelectRect::setRange(double left_Low, double right_High } updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/transparentdraggableSelectRect.h b/logPlus/transparentdraggableSelectRect.h index 94f9e09..19366f7 100644 --- a/logPlus/transparentdraggableSelectRect.h +++ b/logPlus/transparentdraggableSelectRect.h @@ -33,7 +33,7 @@ public: void setNumber(int left_Low_Number, int right_Hight_Number); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // 获取当前范围 QCPRange getRange(); diff --git a/logPlus/transparentdraggableimage.cpp b/logPlus/transparentdraggableimage.cpp index 23a6a1b..1985c6e 100644 --- a/logPlus/transparentdraggableimage.cpp +++ b/logPlus/transparentdraggableimage.cpp @@ -171,7 +171,7 @@ void TransparentDraggableImage::drawResult(double left_Low, double right_Hight, } // 设置矩形范围 -void TransparentDraggableImage::setRange(double left_Low, double right_Hight) +void TransparentDraggableImage::setRange(double left_Low, double right_Hight, bool bReplot) { if(left_Low >= right_Hight) return; @@ -190,14 +190,9 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight) mPixmap->bottomRight->setCoords(left_Low, lY2); drawResult(left_Low, right_Hight, lY1, lY2); - //mItemTitle->position->setCoords(0.5, 0.5); - // 设置父锚点,定位点 - //mItemTitle->position->setParentAnchor(mRect->bottom); mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); if(m_BorderColor == nullptr){ this->m_BorderColor = QColor(0, 0, 0, 200); // 边框颜色 @@ -206,12 +201,17 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight) } // 应用边框样式到主矩形 mRect->setPen(QPen(m_BorderColor, m_BorderWidth, m_BorderStyle)); + updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 设置矩形范围 -void TransparentDraggableImage::setRange(double left_Low, double right_Hight,double leftPercentage, double widthPercentage, int flag) +void TransparentDraggableImage::setRange(double left_Low, double right_Hight,double leftPercentage, double widthPercentage, int flag, bool bReplot) { if(left_Low >= right_Hight) return; // qDebug() << "left_Low" << left_Low << @@ -252,8 +252,13 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight,dou (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 mRect->setPen(QPen(m_BorderColor, m_BorderWidth, m_BorderStyle)); + updateHandles(); - mPlot->replot(); + //刷新,针对批量修改不在此处刷新,后面统一刷新 + if(bReplot) + { + mPlot->replot(); + } } // 获取当前范围 diff --git a/logPlus/transparentdraggableimage.h b/logPlus/transparentdraggableimage.h index e08daba..b25c043 100644 --- a/logPlus/transparentdraggableimage.h +++ b/logPlus/transparentdraggableimage.h @@ -37,9 +37,9 @@ public: void drawResult(double left_Low, double right_Hight, double lY1, double lY2); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bReplot=true); // flag=0边距修改 1宽度修改 - void setRange(double left_Low, double right_Hight,double left, double width, int flag = 0); + void setRange(double left_Low, double right_Hight,double left, double width, int flag = 0, bool bReplot=true); // 获取当前范围 QCPRange getRange(); QString getMResult();