From e65b5681d9b1d166cd8c0fe1ad350f2d66343d9e Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 18 Mar 2026 10:17:11 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=B2=89=E7=A7=AF=E7=9B=B8=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=AE=B0=E5=BD=95=E5=88=B0json=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 3 + logPlus/PropertyWidget.cpp | 26 ++++++ logPlus/TransparentDraggableFac.cpp | 14 --- logPlus/TransparentDraggableMFac.cpp | 64 +++++++++---- logPlus/TransparentDraggablePhase.cpp | 41 +++++---- logPlus/formdraw.cpp | 84 +++++++++++++++++ logPlus/forminfo.cpp | 4 +- logPlus/forminfo.h | 5 ++ logPlus/formtrack.cpp | 30 +++++++ logPlus/qmycustomplot.cpp | 124 +++++++++++++++++++++++--- logPlus/qmycustomplot.h | 7 ++ 11 files changed, 344 insertions(+), 58 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 19fa70d..ca62f92 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -217,6 +217,9 @@ signals: //是否显示 void sig_changeGeoLithShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + //改变沉积相属性,是否显示 + void sig_changeFacShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index dd67ad1..7a7b4ba 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1184,6 +1184,28 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { //先处理通用属性 CommonPropertyChanged(pProperty, variant); + + if("绘制相" == m_propertyData[pProperty] || + "绘制亚相" == m_propertyData[pProperty] || + "微相名称" == m_propertyData[pProperty]) + { + bool bShow = variant.value(); + if(m_propertyData[pProperty] == "绘制相") + { + m_formInfo->m_bDrawFac = bShow; + } + else if(m_propertyData[pProperty] == "绘制亚相") + { + m_formInfo->m_bDrawPhase = bShow; + } + else if(m_propertyData[pProperty] == "微相名称") + { + m_formInfo->m_bDrawMFacName = bShow; + } + + //改变沉积相属性,是否显示 + emit CallManage::getInstance()->sig_changeFacShow(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_propertyData[pProperty], bShow); + } } if("深度比例尺" == m_propertyData[pProperty]) @@ -2949,6 +2971,10 @@ void PropertyWidget::initFacProperty(FormInfo *formInfo) _CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String); _CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font); _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); + //显示 + _CreateVariantPropertyItem("数据", "绘制相", formInfo->m_bDrawFac, QVariant::Bool); + _CreateVariantPropertyItem("数据", "绘制亚相", formInfo->m_bDrawPhase, QVariant::Bool); + _CreateVariantPropertyItem("数据", "微相名称", formInfo->m_bDrawMFacName, QVariant::Bool); m_strCurrentProperty = Fac_Property; } diff --git a/logPlus/TransparentDraggableFac.cpp b/logPlus/TransparentDraggableFac.cpp index 353bb53..d4d4eb4 100644 --- a/logPlus/TransparentDraggableFac.cpp +++ b/logPlus/TransparentDraggableFac.cpp @@ -44,23 +44,9 @@ void TransparentDraggableFac::setRange(double left_Low, double right_Hight) mRect->topLeft->setCoords(left_Low, 3*(lY1+lY2)/4.0); mRect->bottomRight->setCoords(right_Hight, lY2); - //位置与rect不一样,否则图像反转 -// mPixmap->topLeft->setCoords(right_Hight, lY1); -// mPixmap->bottomRight->setCoords(left_Low, (lY1+lY2)/2.0); - - //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); // 设置文本在矩形中心位置 - float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15; mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), 7*(lY1 + lY2)/8.0); // 设置文本在矩形中心位置 - - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); - updateHandles(); mPlot->replot(); } diff --git a/logPlus/TransparentDraggableMFac.cpp b/logPlus/TransparentDraggableMFac.cpp index 44ba2f7..999fae9 100644 --- a/logPlus/TransparentDraggableMFac.cpp +++ b/logPlus/TransparentDraggableMFac.cpp @@ -37,7 +37,15 @@ void TransparentDraggableMFac::setMinWidth(double minWidth) void TransparentDraggableMFac::setTitle(QString strTitle) { mstrTitle = strTitle; - mItemTitle->setText(mstrTitle); + //mItemTitle->setText(mstrTitle); + // + if(mPlot->m_bDrawMFacName)// 微相名称 + { + mItemTitle->setText(mstrTitle); + } + else{ + mItemTitle->setText(""); + } //mPlot->replot(); } @@ -49,24 +57,48 @@ void TransparentDraggableMFac::setRange(double left_Low, double right_Hight) double lY1 = mPlot->yAxis->range().lower;//+10 double lY2 = mPlot->yAxis->range().upper; mRect->topLeft->setCoords(left_Low, lY1); - mRect->bottomRight->setCoords(right_Hight, (lY1+lY2)/2.0); + if(mPlot->m_bDrawFac && mPlot->m_bDrawPhase) + { + //画2条竖线 + mRect->bottomRight->setCoords(right_Hight, (lY1+lY2)/2.0); + } + else if(mPlot->m_bDrawFac || mPlot->m_bDrawPhase) + { + //画1条竖线 + mRect->bottomRight->setCoords(right_Hight, 3*(lY1+lY2)/4.0); + } + else + { + mRect->bottomRight->setCoords(right_Hight, lY2); + } - //位置与rect不一样,否则图像反转 -// mPixmap->topLeft->setCoords(right_Hight, lY1); -// mPixmap->bottomRight->setCoords(left_Low, (lY1+lY2)/2.0); - - //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); // 设置文本在矩形中心位置 + // + if(mPlot->m_bDrawMFacName)// 微相名称 + { + mItemTitle->setText(mstrTitle); + } + else{ + mItemTitle->setText(""); + } float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15; - mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), - (lY1 + lY2)/4.0); // 设置文本在矩形中心位置 - - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); + if(mPlot->m_bDrawFac && mPlot->m_bDrawPhase) + { + //画2条竖线 + mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + (lY1 + lY2)/4.0); // 设置文本在矩形中心位置 + } + else if(mPlot->m_bDrawFac || mPlot->m_bDrawPhase) + { + //画1条竖线 + mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + 3*(lY1 + lY2)/8.0); // 设置文本在矩形中心位置 + } + else + { + mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + (lY1 + lY2)/2.0); // 设置文本在矩形中心位置 + } updateHandles(); mPlot->replot(); diff --git a/logPlus/TransparentDraggablePhase.cpp b/logPlus/TransparentDraggablePhase.cpp index eb7fb9a..8d1d9a6 100644 --- a/logPlus/TransparentDraggablePhase.cpp +++ b/logPlus/TransparentDraggablePhase.cpp @@ -41,25 +41,32 @@ void TransparentDraggablePhase::setRange(double left_Low, double right_Hight) double lY1 = mPlot->yAxis->range().lower;//+10 double lY2 = mPlot->yAxis->range().upper; - mRect->topLeft->setCoords(left_Low, (lY1+lY2)/2.0); - mRect->bottomRight->setCoords(right_Hight, 3*(lY1+lY2)/4.0); - - //位置与rect不一样,否则图像反转 -// mPixmap->topLeft->setCoords(right_Hight, lY1); -// mPixmap->bottomRight->setCoords(left_Low, (lY1+lY2)/2.0); - - //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); // 设置文本在矩形中心位置 + if(mPlot->m_bDrawFac) + { + //绘制相 + mRect->topLeft->setCoords(left_Low, (lY1+lY2)/2.0); + mRect->bottomRight->setCoords(right_Hight, 3*(lY1+lY2)/4.0); + } + else + { + //不绘制相 + mRect->topLeft->setCoords(left_Low, 3*(lY1+lY2)/4.0); + mRect->bottomRight->setCoords(right_Hight, lY2); + } float flNewPos = mPlot->xAxis->coordToPixel((left_Low + right_Hight)/2.0) - 15; - mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), - 5*(lY1 + lY2)/8.0); // 设置文本在矩形中心位置 - - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); + if(mPlot->m_bDrawFac) + { + //绘制相 + mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + 5*(lY1 + lY2)/8.0); // 设置文本在矩形中心位置 + } + else + { + //不绘制相 + mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(flNewPos), + 7*(lY1 + lY2)/8.0); // 设置文本在矩形中心位置 + } updateHandles(); mPlot->replot(); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 8cf9b19..60ee674 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -470,6 +470,7 @@ void FormDraw::DisplayTable_One(QJsonObject lineObjInfo) } } + QString folderPath = GetLogdataPath(); folderPath = folderPath + g_prjname; strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; @@ -540,6 +541,7 @@ void FormDraw::DisplayTable_One(QJsonObject lineObjInfo) else{ listOtherProperty.append("0"); } + //结论 this->addTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, listOtherProperty); } @@ -694,6 +696,32 @@ void FormDraw::DisplayFac_One(QJsonObject lineObjInfo) lineColor.setNamedColor(lineObjInfo.value("lineColor").toString()); } + //沉积相 + bool bDrawFac = true; // 绘制相 + bool bDrawPhase = true; // 绘制亚相 + bool bDrawMFacName = true; // 微相名称 + if (lineObjInfo.contains("DrawFac")) + { + QJsonValue value = lineObjInfo.value("DrawFac"); + if (value.isBool()) { + bDrawFac = value.toBool(); + } + } + if (lineObjInfo.contains("DrawPhase")) + { + QJsonValue value = lineObjInfo.value("DrawPhase"); + if (value.isBool()) { + bDrawPhase = value.toBool(); + } + } + if (lineObjInfo.contains("DrawMFacName")) + { + QJsonValue value = lineObjInfo.value("DrawMFacName"); + if (value.isBool()) { + bDrawMFacName = value.toBool(); + } + } + QString folderPath = GetLogdataPath(); folderPath = folderPath + g_prjname; strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; @@ -704,6 +732,31 @@ void FormDraw::DisplayFac_One(QJsonObject lineObjInfo) listOtherProperty.append(strAliasName);//别名 listOtherProperty.append(lineColor.name());//名称颜色 listOtherProperty.append(curveNameFont.toString());//名称字体 + + //沉积相 + if(bDrawFac) + { + listOtherProperty.append("DrawFac"); + } + else{ + listOtherProperty.append("0"); + } + // + if(bDrawPhase) + { + listOtherProperty.append("DrawPhase"); + } + else{ + listOtherProperty.append("0"); + } + // + if(bDrawMFacName) + { + listOtherProperty.append("DrawMFacName"); + } + else{ + listOtherProperty.append("0"); + } //沉积相 this->s_addLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); // } @@ -2649,6 +2702,37 @@ void FormDraw::s_addLogface(QString strUuid, QString strSlfName, QString strWell curv->xAxis = yAxis; curv->yAxis = xAxis; + if(listOtherProperty.size()>=6) + { + // + if(listOtherProperty[3]=="DrawFac") + { + curv->m_bDrawFac = true; + } + else + { + curv->m_bDrawFac = false; + } + // + if(listOtherProperty[4]=="DrawPhase") + { + curv->m_bDrawPhase = true; + } + else + { + curv->m_bDrawPhase = false; + } + // + if(listOtherProperty[5]=="DrawMFacName") + { + curv->m_bDrawMFacName = true; + } + else + { + curv->m_bDrawMFacName = false; + } + } + //沉积相 //QString strWaveName = "LITHA"; curv->LoadFromSLF_Fac(strSlfName, strLineName); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 69a91a5..66bbc89 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -171,7 +171,9 @@ QJsonObject FormInfo::makeJson() else if (m_strType == "LogfaceObject") { //沉积相 - + rootObj["DrawFac"] = m_bDrawFac; + rootObj["DrawPhase"] = m_bDrawPhase; + rootObj["DrawMFacName"] = m_bDrawMFacName; //item属性写入slf文件,不需要此次记录 return rootObj; } diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 6b41bc2..9665fa0 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -181,6 +181,11 @@ public: //气测/FMT/射孔/文本 QStringList m_FieldNameList; + //沉积相 + bool m_bDrawFac = true; // 绘制相 + bool m_bDrawPhase = true; // 绘制亚相 + bool m_bDrawMFacName = true; // 微相名称 + public: void setLineWidth(double dWidth); double getLineWidth(); diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index a34367f..2a678cb 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -1005,6 +1005,36 @@ void FormTrack::s_addLogface(QString strSlfName, QString strWellName, QString st curveNameFont.fromString(listOtherProperty[2]); formInfo->m_curveNameFont = curveNameFont; } + if(listOtherProperty.size()>=6) + { + // + if(listOtherProperty[3]=="DrawFac") + { + formInfo->m_bDrawFac = true; + } + else + { + formInfo->m_bDrawFac = false; + } + // + if(listOtherProperty[4]=="DrawPhase") + { + formInfo->m_bDrawPhase = true; + } + else + { + formInfo->m_bDrawPhase = false; + } + // + if(listOtherProperty[5]=="DrawMFacName") + { + formInfo->m_bDrawMFacName = true; + } + else + { + formInfo->m_bDrawMFacName = false; + } + } //设置高度 ui->tableWidget->setRowHeight(row, 100); //单元格委托 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 1d707e0..693bcf2 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -139,6 +139,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeGeoLithLine(QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGeoLithLine(QString, QString, QString, QString, QString, double))); //是否显示 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))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW) @@ -6088,6 +6090,83 @@ void QMyCustomPlot::s_changeGeoLithShow(QString strUuid, QString strSlfName, QSt //不清空属性窗口 } +//改变沉积相属性,是否显示 +void QMyCustomPlot::s_changeFacShow(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_bDrawFac = bShow; + RefreshItems_Fac(false); //刷新数据 + { + //微相 + TransparentDraggableMFac *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_MFac.begin(); + while( it != m_mapDraggable_MFac.end() ) + { + pDraggableRect = (TransparentDraggableMFac*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); + //pDraggableRect->setTitle(pDraggableRect->mstrTitle); + } + } + } + else if(propertyData == "绘制亚相") + { + m_bDrawPhase = bShow; + RefreshItems_Fac(false); //刷新数据 + { + //微相 + TransparentDraggableMFac *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_MFac.begin(); + while( it != m_mapDraggable_MFac.end() ) + { + pDraggableRect = (TransparentDraggableMFac*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); + //pDraggableRect->setTitle(pDraggableRect->mstrTitle); + } + } + } + else if(propertyData == "微相名称") + { + m_bDrawMFacName = bShow; + { + //微相 + TransparentDraggableMFac *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_MFac.begin(); + while( it != m_mapDraggable_MFac.end() ) + { + pDraggableRect = (TransparentDraggableMFac*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper); + //pDraggableRect->setTitle(pDraggableRect->mstrTitle); + } + } + } + + + //不清空属性窗口 +} + bool QMyCustomPlot::LoadFromSLF_Layer(QString strSlfName, QString strLineName) { LAYER_DATA m_Result; @@ -7554,6 +7633,21 @@ void QMyCustomPlot::ReadData_Fac(QString strSlfName, QString csCurve, bool bAdd) void QMyCustomPlot::DrawFac(int iType) { + //判读是否绘制 相/亚相 + if(m_bDrawFac && iType==1) + { + //相 + } + else if(m_bDrawPhase && iType==2) + { + //亚相 + } + else + { + return; + } + + int j; float dep1,dep2; float top,bottom; @@ -7683,16 +7777,26 @@ bool QMyCustomPlot::LoadFromSLF_Fac(QString strSlfName, QString csCurve, bool bA removeItem(m_qcpItemLine2); } - //画2条竖线 int iMyWidth = this->axisRect(0)->width(); - m_qcpItemLine = new QCPItemStraightLine(this); - m_qcpItemLine->point1->setCoords(-1, iMyWidth/2);//位置 - m_qcpItemLine->point2->setCoords(-2, iMyWidth/2);//位置 - //qcpItemLine->setPen(pPenStraightLine); + if(m_bDrawFac && m_bDrawPhase) + { + //画2条竖线 + m_qcpItemLine = new QCPItemStraightLine(this); + m_qcpItemLine->point1->setCoords(-1, iMyWidth/2);//位置 + m_qcpItemLine->point2->setCoords(-2, iMyWidth/2);//位置 + //qcpItemLine->setPen(pPenStraightLine); - m_qcpItemLine2 = new QCPItemStraightLine(this); - m_qcpItemLine2->point1->setCoords(-1, 3*iMyWidth/4);//位置 - m_qcpItemLine2->point2->setCoords(-2, 3*iMyWidth/4);//位置 + m_qcpItemLine2 = new QCPItemStraightLine(this); + m_qcpItemLine2->point1->setCoords(-1, 3*iMyWidth/4);//位置 + m_qcpItemLine2->point2->setCoords(-2, 3*iMyWidth/4);//位置 + } + else if(m_bDrawFac || m_bDrawPhase) + { + //画1条竖线 + m_qcpItemLine2 = new QCPItemStraightLine(this); + m_qcpItemLine2->point1->setCoords(-1, 3*iMyWidth/4);//位置 + m_qcpItemLine2->point2->setCoords(-2, 3*iMyWidth/4);//位置 + } ReadFracDef(); @@ -7917,8 +8021,8 @@ void QMyCustomPlot::RefreshItems_Fac(bool bAdd) } //重新加载 - LoadFromSLF_Fac(m_strSlfName, m_strLineName, bAdd); + LoadFromSLF_Fac(m_strSlfName, m_strLineName, bAdd); //属性清空 - PropertyService()->InitCurrentViewInfo(); + //PropertyService()->InitCurrentViewInfo(); } diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 0cebaf8..128aee7 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -259,6 +259,10 @@ public: QList m_ObjList_Fac; QCPItemStraightLine *m_qcpItemLine=nullptr; QCPItemStraightLine *m_qcpItemLine2=nullptr; + //沉积相 + bool m_bDrawFac = true; // 绘制相 + bool m_bDrawPhase = true; // 绘制亚相 + bool m_bDrawMFacName = true; // 微相名称 void ReadFracDef(); void ReadData_Fac(QString strSlfName, QString csCurve, bool bAdd=true); void DrawFac(int iType); @@ -489,6 +493,9 @@ public slots: //是否显示 void s_changeGeoLithShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + //改变沉积相属性,是否显示 + void s_changeFacShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow); + public: //蝌蚪图重绘网格线 bool mKedou = false; From 60ccf0d0ecac52e72cbeb414b8c9069620ad6ad5 Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Wed, 18 Mar 2026 11:19:55 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9B=BE=E7=89=87=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=B7=A6=E8=BE=B9=E8=B7=9D=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 25 +++++---- logPlus/PropertyWidget.h | 2 +- logPlus/formdraw.cpp | 2 +- logPlus/forminfo.h | 6 +-- logPlus/qmycustomplot.cpp | 36 +++++++++---- logPlus/qmycustomplot.h | 3 +- logPlus/transparentdraggableimage.cpp | 73 +++++++++++++++++++++++++-- logPlus/transparentdraggableimage.h | 8 +++ 8 files changed, 124 insertions(+), 31 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 7a7b4ba..889816e 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -195,18 +195,20 @@ void PropertyWidget::changedYxzpItemProperty(QtProperty *qtProperty, const QVari { if(m_tdImage) { - QString pictureFile = qVariant.value(); - qDebug()<setLower(-lower); + QString imagePath = qVariant.toString(); + m_tdImage->setResult(imagePath); m_tdImage->mPlot->SaveToSLFImage(); + m_tdImage->setRange(m_tdImage->getRange().lower, m_tdImage->getRange().upper); } } else if("左边距%" == m_propertyData[qtProperty]) { if(m_tdImage) { -// int lower = qVariant.value(); -// m_tdImage->setLower(-lower); + // 左边距 + double yxzpLeftMargin = qVariant.toDouble(); + m_tdImage->setLeft(yxzpLeftMargin); + m_tdImage->setRange(m_tdImage->getRange().lower, m_tdImage->getRange().upper,yxzpLeftMargin, m_tdImage->getWidth()); m_tdImage->mPlot->SaveToSLFImage(); } } @@ -214,8 +216,9 @@ void PropertyWidget::changedYxzpItemProperty(QtProperty *qtProperty, const QVari { if(m_tdImage) { -// double lower = qVariant.value(); -// m_tdImage->setLower(-lower); + double yxzpLineWidth = qVariant.toDouble(); + m_tdImage->setWidth(yxzpLineWidth); + m_tdImage->setRange(m_tdImage->getRange().lower, m_tdImage->getRange().upper, m_tdImage->getLeft(), yxzpLineWidth); m_tdImage->mPlot->SaveToSLFImage(); } } @@ -2782,7 +2785,7 @@ void PropertyWidget::initImageProperty(FormInfo *formInfo) m_strCurrentProperty = Image_Property; } -void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString pictureFile) +void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString pictureFile,double left, double width) { //初始化,清空 InitCurrentViewInfo(); @@ -2814,9 +2817,9 @@ void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, d _CreateVariantPropertyItem("当前项", "绘制颜色", formInfo->m_yxzpDrawColor, QVariant::Bool); _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); - _CreateVariantPropertyItem("当前项", "图片文件", formInfo->m_yxzpPictureFile, VariantManager::filePathTypeId()); - _CreateVariantPropertyItem("当前项", "左边距%", formInfo->m_yxzpLeftMargin, QVariant::Int); - _CreateVariantPropertyItem("当前项", "宽度%", formInfo->m_yxzpWidth, QVariant::Int); + _CreateVariantPropertyItem("当前项", "图片文件", pictureFile, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "左边距%", left, QVariant::Int); + _CreateVariantPropertyItem("当前项", "宽度%", width, QVariant::Int); _CreateVariantPropertyItem("边框属性", "线宽", formInfo->m_yxzpLineWidth, QVariant::Int); _CreateVariantPropertyItem("边框属性", "颜色", formInfo->m_yxzpColor, QVariant::Color); diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 12f939a..df22198 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -177,7 +177,7 @@ public: // 岩心照片属性 void initImageProperty(FormInfo *formInfo); - void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult); + void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width); // 井壁取心属性 void initSwallCoreProperty(FormInfo *formInfo); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 60ee674..4285e9c 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -3960,7 +3960,7 @@ bool FormDraw::LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QStr filename=""; } } - widget->addImageToPlot(-m_Result->EndDepth, -m_Result->StartDepth, filename ); + widget->addImageToPlot(-m_Result->EndDepth, -m_Result->StartDepth, filename, static_cast(m_Result->Left), static_cast(m_Result->Width)); } logio->CloseTable(iIndex); delete buf; diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 9665fa0..a7a537b 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -168,11 +168,11 @@ public: // 图片文件 QString m_yxzpPictureFile; // 左边距 - QString m_yxzpLeftMargin; + double m_yxzpLeftMargin; // 宽度 - QString m_yxzpWidth; + double m_yxzpWidth; // 线宽 - QString m_yxzpLineWidth; + int m_yxzpLineWidth; // 颜色 QString m_yxzpColor; // 线型 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 693bcf2..298eb7e 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1726,8 +1726,8 @@ void QMyCustomPlot::onEditImage() imagePath = dlg.getImagePath(); } - //添加固井结论 - this->addImageToPlot(left_Low, right_Hight, imagePath); + // 添加岩心图片 + this->addImageToPlot(left_Low, right_Hight, imagePath, 0, 100); //保存 this->SaveToSLFImage(); @@ -2722,8 +2722,6 @@ bool QMyCustomPlot::SaveToSLFImage() for (QMap::Iterator iter = m_mapDraggable_Image.begin(); iter != m_mapDraggable_Image.end(); iter++) { pDraggableRect = (TransparentDraggableImage*)iter.value(); - QString aaa = pDraggableRect->getMResult(); - // QCPRange tmpRange = pDraggableRect->getRange(); float fSDepth = -tmpRange.upper; if(fSDepth == listSDepth[i])//按顺序写入 @@ -2732,16 +2730,12 @@ bool QMyCustomPlot::SaveToSLFImage() m_Result.StartDepth = -tmpRange.upper; m_Result.EndDepth = -tmpRange.lower; m_Result.Order=i+1; - // m_Result.Image = imagePath; // 拷贝字符串到数组,长度为数组长度-1(留1位存'\0'结束符) strncpy(m_Result.Image, pDraggableRect->getMResult().toLocal8Bit().constData(), sizeof(m_Result.Image) - 1); // 手动添加结束符(确保字符串合法) m_Result.Image[sizeof(m_Result.Image) - 1] = '\0'; - //m_Result.RESULT=0; - //QString innerresult=GetIntResult_Gujing(pDraggableRect->m_Result); - // if(innerresult!="") - // m_Result.RESULT=innerresult.toInt(); - // if(m_Result.RESULT<0) m_Result.RESULT=0; + m_Result.Left = static_cast(pDraggableRect->getLeft()); + m_Result.Width = static_cast(pDraggableRect->getWidth()); //写入 logio->WriteTable(iIndex,i+1,&m_Result); break; @@ -3980,6 +3974,28 @@ void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QS m_mapDraggable_Image[strUuid] = dragRect; } +void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QString imagePath, double left, double width) +{ + QtCommonClass *qtCommon = new QtCommonClass(this); + QString strUuid = qtCommon->getUUid(); + + // 在初始化代码中 + TransparentDraggableImage *dragRect = new TransparentDraggableImage(this, strUuid); + //图片,提前设值,后面setRange改变 + dragRect->setResult(imagePath); + // 设置初始范围 + dragRect->setRange(left_Low, right_Hight,left,width); + // 可选:设置颜色 + dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色 + //最小宽度 + dragRect->setMinWidth(0.1); + //dragRect->setTitle(strText); + dragRect->setLeft(left); + dragRect->setWidth(width); + + m_mapDraggable_Image[strUuid] = dragRect; +} + 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 128aee7..0d34465 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -184,7 +184,7 @@ public: QMap m_mapDraggable_GeoLith; //录井剖面 QMap m_mapDraggable_SwallCore; //井壁取心 QMap m_mapDraggable_Gujing; //固井 - QMap m_mapDraggable_Image; + QMap m_mapDraggable_Image; // 岩心照片 QMap m_mapDraggable_MFac; //微相 QMap m_mapDraggable_Phase; //亚相 QMap m_mapDraggable_Fac; //相 @@ -278,6 +278,7 @@ public: //岩心照片 void addImageToPlot(double left_Low, double right_Hight, const QString imagePath); + void addImageToPlot(double left_Low, double right_Hight, const QString imagePath, double left, double width); //曲线 void addRandomGraph(QVector x, QVector y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit, diff --git a/logPlus/transparentdraggableimage.cpp b/logPlus/transparentdraggableimage.cpp index 4dbf033..3c66306 100644 --- a/logPlus/transparentdraggableimage.cpp +++ b/logPlus/transparentdraggableimage.cpp @@ -175,8 +175,13 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight) { if(left_Low >= right_Hight) return; - double lY1 = mPlot->yAxis->range().lower;//+10 - double lY2 = mPlot->yAxis->range().upper; + double left; + double width; + left = (getLeft()/100) * mPlot->yAxis->range().upper; + width = (getWidth()/100) * mPlot->yAxis->range().upper; + + double lY1 = mPlot->yAxis->range().lower+left; + double lY2 = width+left; mRect->topLeft->setCoords(left_Low, lY1); mRect->bottomRight->setCoords(right_Hight, lY2); @@ -198,6 +203,40 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight) mPlot->replot(); } +// 设置矩形范围 +void TransparentDraggableImage::setRange(double left_Low, double right_Hight,double leftPercentage, double widthPercentage) +{ + if(left_Low >= right_Hight) return; +// qDebug() << "left_Low" << left_Low << +// "right_Hight" << right_Hight << +// "marginLeft" << left << +// "graphHeight" << width; + // 百分比转换实际距离 + double left; + double width; + left = (leftPercentage/100) * mPlot->yAxis->range().upper; + width = (widthPercentage/100) * mPlot->yAxis->range().upper; + + double lY1 = mPlot->yAxis->range().lower+left; + double lY2 = width+left; + mRect->topLeft->setCoords(left_Low, lY1); + mRect->bottomRight->setCoords(right_Hight, lY2); + + //位置与rect不一样,否则图像反转 + mPixmap->topLeft->setCoords(right_Hight, lY1); + 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); // 设置文本在矩形中心位置 + + updateHandles(); + mPlot->replot(); +} + // 获取当前范围 QCPRange TransparentDraggableImage::getRange() { @@ -343,7 +382,9 @@ void TransparentDraggableImage::onMousePress(QMouseEvent *event) // 显示属性 double low = mRect->topLeft->coords().x(); double hight = mRect->bottomRight->coords().x(); - PropertyService()->initImageItemProperty(this, low, hight, m_Result); + double left = getLeft(); + double width = getWidth(); + PropertyService()->initImageItemProperty(this, low, hight, m_Result, left, width); QMenu menu(nullptr); QAction *delAction = menu.addAction("删除框图"); @@ -497,7 +538,9 @@ void TransparentDraggableImage::onMouseRelease(QMouseEvent *event) // 显示属性 double low = mRect->topLeft->coords().x(); double hight = mRect->bottomRight->coords().x(); - PropertyService()->initImageItemProperty(this, low, hight, m_Result); + double left = getLeft(); + double width = getWidth(); + PropertyService()->initImageItemProperty(this, low, hight, m_Result, left, width); //避免二次绘制框图 @@ -616,3 +659,25 @@ void TransparentDraggableImage::setLower(double lower) setRange(newRange.lower, newRange.upper); } + +void TransparentDraggableImage::setMMinWidth(double mMinWidth) +{ + this->mMinWidth = mMinWidth; +} + +void TransparentDraggableImage::setLeft(double left) +{ + this->m_left = left; +} +double TransparentDraggableImage::getLeft() +{ + return this->m_left; +} +void TransparentDraggableImage::setWidth(double width) +{ + this->m_width = width; +} +double TransparentDraggableImage::getWidth() +{ + return this->m_width; +} diff --git a/logPlus/transparentdraggableimage.h b/logPlus/transparentdraggableimage.h index 6e1a411..bb26b5b 100644 --- a/logPlus/transparentdraggableimage.h +++ b/logPlus/transparentdraggableimage.h @@ -38,6 +38,7 @@ public: // 设置矩形范围 void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight,double left, double width); // 获取当前范围 QCPRange getRange(); QString getMResult(); @@ -50,6 +51,11 @@ public: void setUpper(double upper); void setLower(double lower); + void setMMinWidth(double mMinWidth); + void setLeft(double left); + double getLeft(); + void setWidth(double width); + double getWidth(); signals: void rangeChanged(QCPRange newRange); @@ -86,6 +92,8 @@ private: // 添加最小宽度成员变量 double mMinWidth; + // 左边距 宽度 都是百分比 + double m_left = 0, m_width = 100; }; #endif // TRANSPARENTDRAGGABLEIMAGE_H From e529fa69a0d6c275945d2e4c2f62e7ec0abfd4fe Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Wed, 18 Mar 2026 11:48:00 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=B2=A9=E5=BF=83=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/transparentdraggableimage.cpp | 13 ++++++++++++- logPlus/transparentdraggableimage.h | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/logPlus/transparentdraggableimage.cpp b/logPlus/transparentdraggableimage.cpp index 3c66306..0c82e08 100644 --- a/logPlus/transparentdraggableimage.cpp +++ b/logPlus/transparentdraggableimage.cpp @@ -204,7 +204,7 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight) } // 设置矩形范围 -void TransparentDraggableImage::setRange(double left_Low, double right_Hight,double leftPercentage, double widthPercentage) +void TransparentDraggableImage::setRange(double left_Low, double right_Hight,double leftPercentage, double widthPercentage, int flag) { if(left_Low >= right_Hight) return; // qDebug() << "left_Low" << left_Low << @@ -214,6 +214,17 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight,dou // 百分比转换实际距离 double left; double width; + // todo 现在大小判断有问题 这里只是绘图的判断 应该在上一层保存的时候做判断 +// if(flag == 0) +// { +// if(leftPercentage + widthPercentage > 100){ +// leftPercentage = 100 - widthPercentage; +// } +// } +// else if(flag == 1) +// { +// } + left = (leftPercentage/100) * mPlot->yAxis->range().upper; width = (widthPercentage/100) * mPlot->yAxis->range().upper; diff --git a/logPlus/transparentdraggableimage.h b/logPlus/transparentdraggableimage.h index bb26b5b..1fddd6d 100644 --- a/logPlus/transparentdraggableimage.h +++ b/logPlus/transparentdraggableimage.h @@ -38,7 +38,8 @@ public: // 设置矩形范围 void setRange(double left_Low, double right_Hight); - void setRange(double left_Low, double right_Hight,double left, double width); + // flag=0边距修改 1宽度修改 + void setRange(double left_Low, double right_Hight,double left, double width, int flag = 0); // 获取当前范围 QCPRange getRange(); QString getMResult(); From 722538d7782b2aa52eff0d87030896cc98b2e0d7 Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Wed, 18 Mar 2026 16:16:11 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=89=E5=9B=BE?= =?UTF-8?q?=E4=B8=80=E8=A1=A8=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 4 + logPlus/DrawTvd.cpp | 2 +- logPlus/PropertyWidget.cpp | 147 +++++++++++++++++++++- logPlus/PropertyWidget.h | 4 + logPlus/forminfo.cpp | 64 ++++++++++ logPlus/forminfo.h | 34 +++++ logPlus/formline.cpp | 251 ++++++++++++++++++++++++++++++++++++- logPlus/formline.h | 9 +- 8 files changed, 507 insertions(+), 8 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index ca62f92..f55d08b 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -127,6 +127,10 @@ signals: //绘制对称曲线 void sig_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry); + //斜井三图一表 + void sig_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, + QString strGroup, QString strProperty, QVariant variant); + //岩性填充-不填充 void sig_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); //岩性填充-填充 diff --git a/logPlus/DrawTvd.cpp b/logPlus/DrawTvd.cpp index 01015ed..b990a6d 100644 --- a/logPlus/DrawTvd.cpp +++ b/logPlus/DrawTvd.cpp @@ -689,7 +689,7 @@ void CDrawTvd::DrawTvd(QPainter* pDC,QRectF mrt) TitleFontWidth=TitleFontHeight=fm4.height()/2.0; XCenter=mrt.left()+m_Left*100.+(mrt.width()-(m_Left+m_Right)*100.)/2.; - if(0) { + if(1) { //if(m_pWellSceneManager->GetIsColorPrint()) { m_GuiJiPen=QPen(m_GuijiColor,m_GuijiWidth*(int)(fbl/2.+0.5)); m_FramePen=QPen(m_FrameColor,m_FrameWidth*(int)(fbl/2.+0.5));; diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 889816e..8f983b1 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -255,6 +255,14 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { if(m_strCurrentProperty == "") return; + if(m_strCurrentProperty == Tvd_Property) + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + ChangTvdProperty(pProperty, variant); + return; + } + if (m_strCurrentProperty == Table_Property)//解释结论 { bool bDraw = false; @@ -654,8 +662,6 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant return; } - - } } } @@ -1820,6 +1826,21 @@ void PropertyWidget::ChangHeadItemProperty() } } +void PropertyWidget::ChangTvdProperty( QtProperty *pProperty, const QVariant &variant ) +{ + + // QSet pParentProperty= pProperty->getParentItem().begin(); + QString strGroup = ""; + if (1 == pProperty->getParentItem().count()) + { + QtProperty * pParentProperty= *(pProperty->getParentItem().begin()); + strGroup = pParentProperty->propertyName(); + } + + emit CallManage::getInstance()->sig_ChangeTvdProperty(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, + strGroup,m_propertyData[pProperty], variant); +} + void PropertyWidget::ChangFillProperty() { QString newFillMode = "无填充"; @@ -2398,6 +2419,10 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //沉积相 this->initFacProperty(formInfo); } + else if(formInfo->m_strType=="SantuyibiaoObject") + { + this->initTvdProperty(formInfo); + } } void PropertyWidget::initRoseProperty(FormInfo *formInfo) @@ -2853,6 +2878,124 @@ void PropertyWidget::initGeoLithProperty(FormInfo *formInfo) m_strCurrentProperty = GeoLith_Property; } +// 斜井三图一表属性 +void PropertyWidget::initTvdProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("通常", "选择井斜数据", m_strSlfName, QVariant::String); + + _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("通常", "显示井名", formInfo->m_strWellName, QVariant::String); + + _CreateVariantPropertyItem("绘制图形对象", "靶心", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "靶心参数表", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "井斜数据表", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "俯视图", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图深度在左边", false, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(水平位移)", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(向东)", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(向北)", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(侧视角)", false, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "立体轨迹图", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "绘制标注信息", true, QVariant::Bool); + + _CreateVariantPropertyItem("边框线型", "线宽", 3, QVariant::Int); + _CreateVariantPropertyItem("边框线型", "颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("格线线型", "线宽", 3, QVariant::Int); + _CreateVariantPropertyItem("格线线型", "颜色", QColor(127, 127, 127), QVariant::Color); + _CreateVariantPropertyItem("轨迹线型", "线宽", 3, QVariant::Int); + _CreateVariantPropertyItem("轨迹线型", "颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("靶心半径线型", "线宽", 3, QVariant::Int); + _CreateVariantPropertyItem("靶心半径线型", "颜色", QColor(255, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("靶心连线线型", "线宽", 3, QVariant::Int); + _CreateVariantPropertyItem("靶心连线线型", "颜色", QColor(255, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("字体", "道头字体", QFont(), QVariant::Font); + _CreateVariantPropertyItem("字体", "道头颜色", QColor(0, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("字体", "标题字体", QFont(), QVariant::Font); + _CreateVariantPropertyItem("字体", "标题颜色", QColor(0, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("字体", "数据表字体", QFont(), QVariant::Font); + _CreateVariantPropertyItem("字体", "数据表颜色", QColor(0, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("字体", "刻度字体", QFont(), QVariant::Font); + _CreateVariantPropertyItem("字体", "刻度颜色", QColor(0, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("字体", "注释字体", QFont(), QVariant::Font); + _CreateVariantPropertyItem("字体", "注释颜色", QColor(0, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("井斜数据表参数", "标题名", "井连续井斜仪测量数据表", QVariant::String); + _CreateVariantPropertyItem("井斜数据表参数", "头记录高度(cm)", 1.6, QVariant::Double); + _CreateVariantPropertyItem("井斜数据表参数", "数据记录高度(cm)", 0.8, QVariant::Double); + + _CreateVariantPropertyItem("俯视图参数", "标题名", "井井眼俯视图", QVariant::String); + _CreateVariantPropertyItem("俯视图参数", "东西位移最小刻度", -100, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "东西位移最大刻度", 100, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "南北位移最小刻度", -100, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "南北位移最大刻度", 100, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "是否绘制闭合线", false, QVariant::Bool); + + _CreateVariantPropertyItem("侧视图参数", "标题名", "井井眼侧视图", QVariant::String); + _CreateVariantPropertyItem("侧视图参数", "高宽相同", false, QVariant::Bool); + + _CreateVariantPropertyItem("侧视图(水平位移)", "最大侧视位移(m)", 100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最小侧视位移(m)", -100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最大垂深(m)", 10000, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最小垂深(m)", 0, QVariant::Double); + + _CreateVariantPropertyItem("侧视图(向东)", "最大侧视位移(m)", 100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最小侧视位移(m)", -100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最大垂深(m)", 10000, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最小垂深(m)", 0, QVariant::Double); + + _CreateVariantPropertyItem("侧视图(侧视角)", "最大侧视位移(m)", 100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最小侧视位移(m)", -100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最大垂深(m)", 10000, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最小垂深(m)", 0, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "深度间隔(m)", 100, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "等分个数(=0按深度间隔)", 0, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "侧视角(度)", 90, QVariant::Double); + + // + _CreateVariantPropertyItem("立体轨迹图参数", "标题名", "", QVariant::String); + _CreateVariantPropertyItem("立体轨迹图参数", "最大位移(m)", 100, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "起始垂深(m)", 0, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "垂深间隔(m)", 100, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "是否绘制立体框", formInfo->m_is3DFrame, QVariant::Bool); + _CreateVariantPropertyItem("立体轨迹图参数", "俯视角(度)", 10, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "侧视角(度)", 45, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "倾斜角(度)", 0, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "竖线间隔", 5, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "俯视南北间隔数", 20, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "俯视东西间隔数", 20, QVariant::Double); + QStringList listType; + listType.append("NONE"); + listType.append("狗腿度"); + listType.append("井经"); + listType.append("成像"); + _CreateEnumPropertyItem("立体轨迹图参数", "附加属性类型", listType.indexOf("NONE"), listType); + _CreateVariantPropertyItem("立体轨迹图参数", "选择井曲线1", "", QVariant::String); + _CreateVariantPropertyItem("立体轨迹图参数", "选择井曲线2", "", QVariant::String); + _CreateVariantPropertyItem("立体轨迹图参数", "调色板参数设置",0, QVariant::Int); + _CreateVariantPropertyItem("立体轨迹图参数", "直径放大系数", 1, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "波形基值", 0, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "波形最大值", 500, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "连续填充", false, QVariant::Bool); + + _CreateVariantPropertyItem("立体闭合方位线型", "线宽", 1, QVariant::Int); + _CreateVariantPropertyItem("立体闭合方位线型", "颜色", QColor(255, 0, 0), QVariant::Color); + + _CreateVariantPropertyItem("绘图参数", "最小深度间隔(m)", 5, QVariant::Double); + + _CreateVariantPropertyItem("立体闭合方位线型", "线宽", 3, QVariant::Int); + _CreateVariantPropertyItem("立体闭合方位线型", "颜色", QColor(255, 0, 0), QVariant::Color); + + + + //当前属性类型 + m_strCurrentProperty = Tvd_Property; +} + void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor) { //初始化,清空 diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index df22198..9b99d96 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -63,6 +63,7 @@ #define JiegutextItem_Property "JiegutextItem_Property" //气测/FMT/射孔/文本item #define Fac_Property "Fac_Property" //沉积相 +#define Tvd_Property "Tvd_Property" //斜井三图一表 #pragma execution_character_set("utf-8") @@ -202,6 +203,9 @@ public: //沉积相 void initFacProperty(FormInfo *formInfo); + // 斜井三图一表属性 + void initTvdProperty(FormInfo *formInfo); + void ChangTvdProperty( QtProperty *pProperty, const QVariant &variant ); void ChangFillProperty();//填充属性改变 void ChangHeadItemProperty();//图头项改变 diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 66bbc89..d47da8e 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -63,6 +63,10 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt //绘制对称曲线 connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawSymmetry(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawSymmetry(QString, QString, QString, QString, QString, bool))); + //斜井三图一表 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)), + this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant))); + //岩性填充-不填充 connect(CallManage::getInstance(), SIGNAL(sig_ClearFillMode(QString, QString, QString, QString, QString)), this, SLOT(s_ClearFillMode(QString, QString, QString, QString, QString))); //岩性填充-填充 @@ -950,6 +954,66 @@ void FormInfo::s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString m_bDrawSymmetry = bDrawSymmetry; } +void FormInfo::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, + QString strGroup, QString strProperty, QVariant variant) +{ + if("井斜数据表参数" == strGroup) + { + if("标题名" == strProperty) + m_Title_table = variant.value(); + else if("头记录高度(cm)" == strProperty) + m_Head_Height = variant.value(); + else if("数据记录高度(cm)" == strProperty) + m_Rec_Height = variant.value(); + } + else if("立体轨迹图参数" == strGroup) + { + if("标题名" == strProperty) + m_Title_ltgj = variant.value(); + else if("最大位移(m)" == strProperty) + m_MaxWy1 = variant.value(); + else if("起始垂深(m)" == strProperty) + m_LTTTVD = variant.value(); + else if("垂深间隔(m)" == strProperty) + m_DepSpace1 = variant.value(); + else if("是否绘制立体框" == strProperty) + m_is3DFrame = variant.value(); + else if("俯视角(度)" == strProperty) + m_LttAngle_X = variant.value(); + else if("侧视角(度)" == strProperty) + m_LttAngle = variant.value(); + else if("倾斜角(度)" == strProperty) + m_LttAngle_Z = variant.value(); + else if("竖线间隔" == strProperty) + m_LTTTVD = variant.value(); + else if("俯视南北间隔数" == strProperty) + m_YD = variant.value(); + else if("俯视东西间隔数" == strProperty) + m_XD = variant.value(); + else if("附加属性类型" == strProperty) + m_IsDrawProperty = variant.value(); + else if("选择井曲线1" == strProperty) + m_CurveName1 = variant.value(); + else if("选择井曲线2" == strProperty) + m_CurveName2 = variant.value(); + else if("调色板参数设置" == strProperty) + m_ColorTableIndex = variant.value(); + else if("直径放大系数" == strProperty) + m_calscale = variant.value(); + else if("波形基值" == strProperty) + m_baseval = variant.value(); + else if("波形最大值" == strProperty) + m_maxval = variant.value(); + else if("连续填充" == strProperty) + m_isBlock = variant.value(); + } + else if("立体轨迹图参数" == strGroup) + { + if("最小深度间隔(m)" == strProperty) + m_Rlev = variant.value(); + } +} + //岩性填充-不填充 void FormInfo::s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) { diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index a7a537b..26e0af8 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -59,6 +59,10 @@ public slots: //绘制对称曲线 void s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry); + //斜井三图一表 + void s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, + QString strGroup, QString strProperty, QVariant variant); + //岩性填充-不填充 void s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); //岩性填充-填充 @@ -186,6 +190,36 @@ public: bool m_bDrawPhase = true; // 绘制亚相 bool m_bDrawMFacName = true; // 微相名称 + //tvd + //斜井三图一表(井斜数据表参数) + QString m_Title_table; + float m_Head_Height; + float m_Rec_Height; + //斜井三图一表(立体轨迹图参数) + QString m_Title_ltgj; + double m_MaxWy1; + double m_LTTTVD; + double m_DepSpace1; + double m_LttAngle; + double m_LttAngle_X; + double m_LttAngle_Z; + bool m_is3DFrame; + double m_LttxDela; + + double m_XD; + double m_YD; + int m_IsDrawProperty; + QString m_CurveName1; + QString m_CurveName2; + + int m_ColorTableIndex; + double m_calscale; + double m_baseval; + double m_maxval; + double m_Rlev; + bool m_isBlock; + //tvd + public: void setLineWidth(double dWidth); double getLineWidth(); diff --git a/logPlus/formline.cpp b/logPlus/formline.cpp index 75d6921..b000dad 100644 --- a/logPlus/formline.cpp +++ b/logPlus/formline.cpp @@ -1,6 +1,7 @@ #include "formline.h" #include "ui_formline.h" #include +#include "CallManage.h" #include "DrawTvd.h" //demo画线,暂时不用 @@ -14,6 +15,11 @@ FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QSt m_strWellName = strWellName; m_strTrackName = strTrackName; m_strLineName = strLineName; + + m_drawTvd = NULL; + //斜井三图一表 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)), + this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant))); } void FormLine::DrawTvd() @@ -42,9 +48,10 @@ void FormLine::paintEvent(QPaintEvent*) //背景透明 painter.fillRect(rect.left(), rect.top(), rect.width(), rect.height(), QColor(0, 0, 0, 0)); //QColor(67, 67, 67, 100) - CDrawTvd *drawTvd = new CDrawTvd(); - drawTvd->sFilePath = m_strSlfName; - drawTvd->DrawTvd(&painter, rect); + if (!m_drawTvd) + m_drawTvd = new CDrawTvd(); + m_drawTvd->sFilePath = m_strSlfName; + m_drawTvd->DrawTvd(&painter, rect); // QPainter painter(this); // QRect rect = this->rect(); @@ -64,3 +71,241 @@ void FormLine::paintEvent(QPaintEvent*) // painter.drawRoundRect(rectRound); } + +void FormLine::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, + QString strGroup, QString strProperty, QVariant variant) +{ + if("通常" == strGroup) + { + // if("选择井斜数据" == strProperty) + // if("显示名称" == strProperty) + if("显示井名" == strProperty) + m_drawTvd->m_AliasWellName = variant.value(); + } + if("绘制图形对象" == strGroup) + { + if("靶心" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawBX = variant.value(); + if("靶心参数表" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawBxcs = variant.value(); + if("井斜数据表" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawTable = variant.value(); + if("俯视图" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawFst = variant.value(); + if("侧视图深度在左边" == strProperty) + m_drawTvd->objViewInfo->m_DepthLeft = variant.value(); + if("侧视图(水平位移)" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawCst1 = variant.value(); + if("侧视图(向东)" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawCst2 = variant.value(); + if("侧视图(向北)" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawCst3 = variant.value(); + if("侧视图(侧视角)" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawCst = variant.value(); + if("立体轨迹图" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawLtgjt = variant.value(); + if("绘制标注信息" == strProperty) + m_drawTvd->objViewInfo->m_isDrawNote = variant.value(); + } + if("边框线型" == strGroup) + { + if("线宽" == strProperty) + m_drawTvd->m_FrameWidth = variant.value(); + else if("颜色" == strProperty) + m_drawTvd->m_FrameColor = variant.value(); + } + if("格线线型" == strGroup) + { + if("线宽" == strProperty) + m_drawTvd->m_GridWidth = variant.value(); + else if("颜色" == strProperty) + m_drawTvd->m_GridColor = variant.value(); + } + if("轨迹线型" == strGroup) + { + if("线宽" == strProperty) + m_drawTvd->m_GuijiWidth = variant.value(); + else if("颜色" == strProperty) + m_drawTvd->m_GuijiColor = variant.value(); + } + if("靶心半径线型" == strGroup) + { + if("线宽" == strProperty) + m_drawTvd->m_BxbjWidth = variant.value(); + else if("颜色" == strProperty) + m_drawTvd->m_BxbjColor = variant.value(); + } + if("靶心连线线型" == strGroup) + { + if("线宽" == strProperty) + m_drawTvd->m_BxlxWidth = variant.value(); + else if("颜色" == strProperty) + m_drawTvd->m_BxlxColor = variant.value(); + } + if("字体" == strGroup) + { + if("道头字体" == strProperty) + m_drawTvd->objViewInfo->m_HeadFont = variant.value(); + else if("道头颜色" == strProperty) + m_drawTvd->objViewInfo->m_HeadColor = variant.value(); + if("标题字体" == strProperty) + m_drawTvd->objViewInfo->m_TitleFont = variant.value(); + else if("标题颜色" == strProperty) + m_drawTvd->objViewInfo->m_TitleColor = variant.value(); + if("数据表字体" == strProperty) + m_drawTvd->objViewInfo->m_TableFont = variant.value(); + else if("数据表颜色" == strProperty) + m_drawTvd->objViewInfo->m_TableColor = variant.value(); + if("刻度字体" == strProperty) + m_drawTvd->objViewInfo->m_ScaleFont = variant.value(); + else if("刻度颜色" == strProperty) + m_drawTvd->objViewInfo->m_ScaleColor = variant.value(); + if("注释字体" == strProperty) + m_drawTvd->objViewInfo->m_NoteFont = variant.value(); + else if("注释颜色" == strProperty) + m_drawTvd->objViewInfo->m_NoteColor = variant.value(); + } + if("井斜数据表参数" == strGroup) + { + if("标题名" == strProperty) + m_drawTvd->m_Title_table = variant.value(); + else if("头记录高度(cm)" == strProperty) + m_drawTvd->objViewInfo->m_Head_Height = variant.value(); + else if("数据记录高度(cm)" == strProperty) + m_drawTvd->objViewInfo->m_Rec_Height = variant.value(); + } + else if("俯视图参数" == strGroup) + { + if("标题名" == strProperty) + m_drawTvd->objViewInfo->m_Title_fst = variant.value(); + else if("东西位移最小刻度" == strProperty) + m_drawTvd->objViewInfo->m_MinXe = variant.value(); + else if("东西位移最大刻度" == strProperty) + m_drawTvd->objViewInfo->m_MaxXe = variant.value(); + else if("南北位移最小刻度" == strProperty) + m_drawTvd->objViewInfo->m_MinYn = variant.value(); + else if("南北位移最大刻度" == strProperty) + m_drawTvd->objViewInfo->m_MaxYn = variant.value(); + else if("是否绘制闭合线" == strProperty) + m_drawTvd->objViewInfo->m_bPlotBhx = variant.value(); + } + else if("立体轨迹图参数" == strGroup) + { + if("标题名" == strProperty) + m_drawTvd->objViewInfo->m_Title_ltgj = variant.value(); + else if("最大位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxWy1 = variant.value(); + else if("起始垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_LTTTVD = variant.value(); + else if("垂深间隔(m)" == strProperty) + m_drawTvd->objViewInfo->m_DepSpace1 = variant.value(); + else if("是否绘制立体框" == strProperty) + m_drawTvd->objViewInfo->m_is3DFrame = variant.value(); + else if("俯视角(度)" == strProperty) + m_drawTvd->objViewInfo->m_LttAngle_X = variant.value(); + else if("侧视角(度)" == strProperty) + m_drawTvd->objViewInfo->m_LttAngle = variant.value(); + else if("倾斜角(度)" == strProperty) + m_drawTvd->objViewInfo->m_LttAngle_Z = variant.value(); + else if("竖线间隔" == strProperty) + m_drawTvd->objViewInfo->m_LTTTVD = variant.value(); + else if("俯视南北间隔数" == strProperty) + m_drawTvd->objViewInfo->m_YD = variant.value(); + else if("俯视东西间隔数" == strProperty) + m_drawTvd->objViewInfo->m_XD = variant.value(); + else if("附加属性类型" == strProperty) + m_drawTvd->objViewInfo->m_IsDrawProperty = variant.value(); + else if("选择井曲线1" == strProperty) + m_drawTvd->objViewInfo->m_CurveName1 = variant.value(); + else if("选择井曲线2" == strProperty) + m_drawTvd->objViewInfo->m_CurveName2 = variant.value(); + else if("调色板参数设置" == strProperty) + m_drawTvd->objViewInfo->m_ColorTableIndex = variant.value(); + else if("直径放大系数" == strProperty) + m_drawTvd->objViewInfo->m_calscale = variant.value(); + else if("波形基值" == strProperty) + m_drawTvd->objViewInfo->m_baseval = variant.value(); + else if("波形最大值" == strProperty) + m_drawTvd->objViewInfo->m_maxval = variant.value(); + else if("连续填充" == strProperty) + m_drawTvd->objViewInfo->m_isBlock = variant.value(); + } + else if("侧视图参数" == strGroup) + { + if("标题名" == strProperty) + m_drawTvd->objViewInfo->m_Title_cst = variant.value(); + else if("高宽相同" == strProperty) + m_drawTvd->objViewInfo->m_heqw = variant.value(); + } + else if("侧视图(水平位移)" == strGroup) + { + if("最大侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxWy_HOFF = variant.value(); + else if("最小侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinWy_HOFF = variant.value(); + else if("最大垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxTVD_HOFF = variant.value(); + else if("最小垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinTVD_HOFF = variant.value(); + } + else if("侧视图(向东)" == strGroup) + { + if("最大侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxWy_XE = variant.value(); + else if("最小侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinWy_XE = variant.value(); + else if("最大垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxTVD_XE = variant.value(); + else if("最小垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinTVD_XE = variant.value(); + } + else if("侧视图(向北)" == strGroup) + { + if("最大侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxWy_YN = variant.value(); + else if("最小侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinWy_YN = variant.value(); + else if("最大垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxTVD_YN = variant.value(); + else if("最小垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinTVD_YN = variant.value(); + } + else if("侧视图(侧视角)" == strGroup) + { + if("最大侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxWy = variant.value(); + else if("最小侧视位移(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinWy = variant.value(); + else if("最大垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MaxTVD = variant.value(); + else if("最小垂深(m)" == strProperty) + m_drawTvd->objViewInfo->m_MinTVD = variant.value(); + else if("深度间隔(m)" == strProperty) + m_drawTvd->objViewInfo->m_DepSpace = variant.value(); + else if("等分个数(=0按深度间隔)" == strProperty) + m_drawTvd->objViewInfo->m_DepSpaceN = variant.value(); + else if("侧视角(度)" == strProperty) + m_drawTvd->objViewInfo->m_CsAngle = variant.value(); + } + // else if("立体闭合方位线型" == strGroup) + // { + // if("线宽" == strProperty) + // m_drawTvd->objViewInfo->m_DepSpaceN = variant.value(); + // if("颜色" == strProperty) + // m_drawTvd->objViewInfo->m_Rlev = variant.value(); + // } + else if("立体轨迹图参数" == strGroup) + { + if("最小深度间隔(m)" == strProperty) + m_drawTvd->objViewInfo->m_Rlev = variant.value(); + } + // else if("立体井径线型" == strGroup) + // { + // if("线宽" == strProperty) + // m_drawTvd->objViewInfo->m_DepSpaceN = variant.value(); + // if("颜色" == strProperty) + // m_drawTvd->objViewInfo->m_Rlev = variant.value(); + // } + + update(); +} diff --git a/logPlus/formline.h b/logPlus/formline.h index 59937b0..ceb0c7e 100644 --- a/logPlus/formline.h +++ b/logPlus/formline.h @@ -2,12 +2,13 @@ #define FORMLINE_H #include +#include #pragma execution_character_set("utf-8") namespace Ui { class FormLine; } - +class CDrawTvd; class FormLine : public QWidget { Q_OBJECT @@ -28,10 +29,14 @@ public: QString m_strWellName; QString m_strTrackName; QString m_strLineName; + CDrawTvd *m_drawTvd; public: void DrawTvd(); - +public slots: + //斜井三图一表 + void s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, + QString strGroup, QString strProperty, QVariant variant); }; #endif // FORMLINE_H From 309e7c05a9d9ca9de49344395d82637fa63d385e Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 18 Mar 2026 17:55:43 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=A5=97=E7=AE=A1=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=9F=BA=E7=A1=80=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E3=80=81=E5=8F=B3=E9=94=AE=E6=96=B0=E5=BB=BA=E5=A5=97=E7=AE=A1?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E3=80=81=E4=BD=8D=E7=A7=BB=E7=AD=89=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 2 +- logPlus/ObjTubingstringResult.cpp | 178 ------------ logPlus/ObjTubingstringResult.h | 32 --- logPlus/PropertyWidget.cpp | 26 +- logPlus/PropertyWidget.h | 8 + logPlus/TransparentDraggableFac.cpp | 2 +- logPlus/TransparentDraggableGeoLith.cpp | 3 +- logPlus/TransparentDraggableGujing.cpp | 3 +- logPlus/TransparentDraggableJiegutext.cpp | 3 +- logPlus/TransparentDraggableLayer.cpp | 3 +- logPlus/TransparentDraggableLine.cpp | 3 +- logPlus/TransparentDraggableMFac.cpp | 3 +- logPlus/TransparentDraggablePhase.cpp | 2 +- logPlus/TransparentDraggableRect.cpp | 3 +- logPlus/TransparentDraggableResult.cpp | 1 + logPlus/TransparentDraggableSwallCore.cpp | 3 +- logPlus/TransparentGroupResult.cpp | 3 +- logPlus/formdraw.cpp | 110 +++++++- logPlus/formdraw.h | 5 +- logPlus/forminfo.cpp | 15 + logPlus/formtrack.cpp | 15 +- logPlus/formtrack.h | 4 +- logPlus/logPlus.pro | 2 - logPlus/mainwindowcurve.cpp | 13 +- logPlus/qmycustomplot.cpp | 310 +++++++++++++++++++++ logPlus/qmycustomplot.h | 16 ++ logPlus/transparentdraggableGuan.cpp | 123 ++++++-- logPlus/transparentdraggableGuan.h | 12 +- logPlus/transparentdraggableRightList.cpp | 3 +- logPlus/transparentdraggableSelectRect.cpp | 3 +- logPlus/transparentdraggableimage.cpp | 3 +- 31 files changed, 643 insertions(+), 269 deletions(-) delete mode 100644 logPlus/ObjTubingstringResult.cpp delete mode 100644 logPlus/ObjTubingstringResult.h diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index f55d08b..d29e994 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -83,7 +83,7 @@ signals: void sig_AddLogface(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0, QStringList listOtherProperty={}); //套管组件 - void sig_AddTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0); + void sig_AddTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0, QStringList listOtherProperty={}); //TDT void sig_AddTDT(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0); diff --git a/logPlus/ObjTubingstringResult.cpp b/logPlus/ObjTubingstringResult.cpp deleted file mode 100644 index 9d6fe5f..0000000 --- a/logPlus/ObjTubingstringResult.cpp +++ /dev/null @@ -1,178 +0,0 @@ -#include -#include "ObjTubingstringResult.h" -#include "MemRdWt.h" -#include "geometryutils.h" - -CObjTubingstringResult::CObjTubingstringResult() -{ - if(zoneOrder.size()==0) - { - zoneOrder=GetZoneOrder(QString("TubTools.ini")); - } - - cclimgpath=GetSymbolDir()+"\\管柱组件\\"; -} - -CObjTubingstringResult::~CObjTubingstringResult() -{ - m_pResultList.clear(); -} - -bool CObjTubingstringResult::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve) -{ - m_pResultList.clear(); - -// //隐藏刻度 -// widget->xAxis->setTicks(false); -// widget->yAxis->setTicks(false); -// widget->xAxis2->setTicks(false); -// widget->yAxis2->setTicks(false); - - Slf_JIEGUPOS *m_pResult=NULL; - CMemRdWt *logio=new CMemRdWt(); - if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) - { - delete logio; -// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); - return false; - } - - - int iIndex=logio->OpenTable(csCurve.toStdString().c_str()); - if(iIndex>-1) { - int count=logio->GetTableRecordCount(iIndex); - //int fieldnum=logio->GetTableFieldCount(iIndex); - int len=logio->GetTableRecordLength(iIndex); - m_pResult=(Slf_JIEGUPOS *)new char[len+1]; - char buf[200]; - logio->IsChange=true; - - bool bDrawGuanzhu = false; - for(int i=0;iReadTable(iIndex,i+1,m_pResult); - - Slf_JIEGUPOS result; - result.Depth=m_pResult->Depth; - result.Order=m_pResult->Order; - result.Number=m_pResult->Number; - m_pResultList.append(result); - - // - double depth=m_pResult->Depth; - int Order=m_pResult->Order; - int Number=m_pResult->Number; - - if(bDrawGuanzhu == false) - { - //还没有画管柱 - if(Number == zoneOrder.value("管底部").toInt()|| - Number == zoneOrder.value("油管深").toInt()|| - Number == zoneOrder.value("喇叭口").toInt()|| - Number == zoneOrder.value("剌叭口").toInt()) - { - bDrawGuanzhu = true;//画管柱 - - QString shotimgfile=GetSymbolDir()+"\\管柱组件\\管柱.png"; - //QImage shotimg(shotimgfile); - //pPainter->drawImage(rect,shotimg); - - double lY1 = widget->yAxis->range().lower;//+10 - double lY2 = widget->yAxis->range().upper; - QCPItemPixmap *mPixmap; - mPixmap = new QCPItemPixmap(widget); - //mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片 - mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 - mPixmap->setLayer("overlay"); // 确保在最上层 - // - float upper = widget->xAxis->range().upper; - mPixmap->topLeft->setCoords(upper, lY1 + (lY2-lY1-m_Oguan)/2.0); - mPixmap->bottomRight->setCoords(-depth, lY2 - (lY2-lY1-m_Oguan)/2.0); - mPixmap->setPixmap(QPixmap(shotimgfile)); // 设置图片 - } - } - } - logio->CloseTable(iIndex); - delete m_pResult; - } - delete logio; - - for(int i=0; ixAxis->coordToPixel(-depth)-h/2.0; - float lower = widget->xAxis->coordToPixel(-depth)+h/2.0; - float newUpper = widget->xAxis->pixelToCoord(upper); - float newLower = widget->xAxis->pixelToCoord(lower); - widget->addGuanToPlot(newLower, newUpper, cclimgfile, in); - -// QString cclimgfile=cclimgpath+name+".png"; -// double lY1 = widget->yAxis->range().lower;//+10 -// double lY2 = widget->yAxis->range().upper; -// QCPItemPixmap *mPixmap; -// mPixmap = new QCPItemPixmap(widget); -// mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 -// mPixmap->setLayer("overlay"); // 确保在最上层 -// // -// float upper = widget->xAxis->coordToPixel(-depth)-h/2.0; -// float lower = widget->xAxis->coordToPixel(-depth)+h/2.0; -// float newUpper = widget->xAxis->pixelToCoord(upper); -// float newLower = widget->xAxis->pixelToCoord(lower); -// mPixmap->topLeft->setCoords(newUpper, lY1 + (lY2-lY1-in)/2.0); -// mPixmap->bottomRight->setCoords(newLower, lY2 - (lY2-lY1-in)/2.0); -// mPixmap->setPixmap(QPixmap(cclimgfile)); // 设置图片 -} diff --git a/logPlus/ObjTubingstringResult.h b/logPlus/ObjTubingstringResult.h deleted file mode 100644 index eef0fce..0000000 --- a/logPlus/ObjTubingstringResult.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef OBTubingstringResultITEM_H -#define OBTubingstringResultITEM_H - -#include -#include "qmycustomplot.h" - -//套管 -class CObjTubingstringResult :public QObject -{ - Q_OBJECT -public: - CObjTubingstringResult(); - virtual ~CObjTubingstringResult(); - - -public: - bool LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve); - void drawOne(QMyCustomPlot *widget, Slf_JIEGUPOS result); - -public: - QMap zoneOrder; - float m_Oguan = 63.5; - float m_Oind = 121.36; - bool m_bDrawCCL = false; - QString cclimgpath=""; - - QList m_pResultList; -private: - -}; - -#endif diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 8f983b1..9d4ccc1 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -662,6 +662,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant return; } + + } } } @@ -1216,6 +1218,11 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant emit CallManage::getInstance()->sig_changeFacShow(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_strCurrentProperty == Tubing_Property)//套管组件 + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + } if("深度比例尺" == m_propertyData[pProperty]) { @@ -2419,10 +2426,15 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //沉积相 this->initFacProperty(formInfo); } - else if(formInfo->m_strType=="SantuyibiaoObject") + else if(formInfo->m_strType=="SantuyibiaoObject") { this->initTvdProperty(formInfo); } + else if (formInfo->m_strType == "TubingstringObject") + { + //套管组件 + this->initTubingProperty(formInfo); + } } void PropertyWidget::initRoseProperty(FormInfo *formInfo) @@ -3124,3 +3136,15 @@ void PropertyWidget::initFacProperty(FormInfo *formInfo) m_strCurrentProperty = Fac_Property; } + +//套管组件 +void PropertyWidget::initTubingProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + + _CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); + + m_strCurrentProperty = Tubing_Property; +} diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 9b99d96..f3b959a 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -63,8 +63,12 @@ #define JiegutextItem_Property "JiegutextItem_Property" //气测/FMT/射孔/文本item #define Fac_Property "Fac_Property" //沉积相 + #define Tvd_Property "Tvd_Property" //斜井三图一表 +#define Tubing_Property "Tubing_Property" //套管组件 +#define TubingItem_Property "TubingItem_Property" //套管组件item + #pragma execution_character_set("utf-8") /** @@ -206,6 +210,10 @@ public: // 斜井三图一表属性 void initTvdProperty(FormInfo *formInfo); void ChangTvdProperty( QtProperty *pProperty, const QVariant &variant ); + + //套管组件 + void initTubingProperty(FormInfo *formInfo); + void ChangFillProperty();//填充属性改变 void ChangHeadItemProperty();//图头项改变 diff --git a/logPlus/TransparentDraggableFac.cpp b/logPlus/TransparentDraggableFac.cpp index d4d4eb4..d960481 100644 --- a/logPlus/TransparentDraggableFac.cpp +++ b/logPlus/TransparentDraggableFac.cpp @@ -83,7 +83,7 @@ void TransparentDraggableFac::deleteRect() //mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // diff --git a/logPlus/TransparentDraggableGeoLith.cpp b/logPlus/TransparentDraggableGeoLith.cpp index 191ab99..48f5693 100644 --- a/logPlus/TransparentDraggableGeoLith.cpp +++ b/logPlus/TransparentDraggableGeoLith.cpp @@ -501,7 +501,7 @@ void TransparentDraggableGeoLith::deleteRect() mPlot->removeItem(mPixmap_Color); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -611,6 +611,7 @@ void TransparentDraggableGeoLith::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); //保存 mPlot->SaveToSLF_GeoLith(); //属性清空 diff --git a/logPlus/TransparentDraggableGujing.cpp b/logPlus/TransparentDraggableGujing.cpp index fac748d..0a7f2eb 100644 --- a/logPlus/TransparentDraggableGujing.cpp +++ b/logPlus/TransparentDraggableGujing.cpp @@ -230,7 +230,7 @@ void TransparentDraggableGujing::deleteRect() mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -336,6 +336,7 @@ void TransparentDraggableGujing::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); //保存 mPlot->SaveToSLF_Gujing(); //属性清空 diff --git a/logPlus/TransparentDraggableJiegutext.cpp b/logPlus/TransparentDraggableJiegutext.cpp index 3fbeea6..e7a9698 100644 --- a/logPlus/TransparentDraggableJiegutext.cpp +++ b/logPlus/TransparentDraggableJiegutext.cpp @@ -131,7 +131,7 @@ void TransparentDraggableJiegutext::deleteRect() mPlot->removeItem(pLine[i]); } - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -227,6 +227,7 @@ void TransparentDraggableJiegutext::onDelRect() { //删除框图 deleteRect(); + mPlot->replot(); //保存 mPlot->SaveToSLF_Jiegutext(); //属性清空 diff --git a/logPlus/TransparentDraggableLayer.cpp b/logPlus/TransparentDraggableLayer.cpp index 78d4d81..9e40456 100644 --- a/logPlus/TransparentDraggableLayer.cpp +++ b/logPlus/TransparentDraggableLayer.cpp @@ -207,7 +207,7 @@ void TransparentDraggableLayer::deleteRect() mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); } } @@ -279,6 +279,7 @@ void TransparentDraggableLayer::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); //保存 mPlot->SaveToSLF_Layer(); //属性清空 diff --git a/logPlus/TransparentDraggableLine.cpp b/logPlus/TransparentDraggableLine.cpp index 08d7f56..a4ccd77 100644 --- a/logPlus/TransparentDraggableLine.cpp +++ b/logPlus/TransparentDraggableLine.cpp @@ -77,7 +77,7 @@ void TransparentDraggableLine::deleteRect() mPlot->removeItem(qcpItemLine); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); } } @@ -108,6 +108,7 @@ void TransparentDraggableLine::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); } diff --git a/logPlus/TransparentDraggableMFac.cpp b/logPlus/TransparentDraggableMFac.cpp index 999fae9..0dfd49b 100644 --- a/logPlus/TransparentDraggableMFac.cpp +++ b/logPlus/TransparentDraggableMFac.cpp @@ -136,7 +136,7 @@ void TransparentDraggableMFac::deleteRect() //mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -250,6 +250,7 @@ void TransparentDraggableMFac::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + //mPlot->replot(); //保存 mPlot->SaveToSLF_Fac(); //刷新 bAdd不支持true,否则崩溃,因为发消息的item本身会被删除,无法继续后续处理 diff --git a/logPlus/TransparentDraggablePhase.cpp b/logPlus/TransparentDraggablePhase.cpp index 8d1d9a6..4d6c460 100644 --- a/logPlus/TransparentDraggablePhase.cpp +++ b/logPlus/TransparentDraggablePhase.cpp @@ -104,7 +104,7 @@ void TransparentDraggablePhase::deleteRect() //mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // diff --git a/logPlus/TransparentDraggableRect.cpp b/logPlus/TransparentDraggableRect.cpp index e796b7f..674ee2c 100644 --- a/logPlus/TransparentDraggableRect.cpp +++ b/logPlus/TransparentDraggableRect.cpp @@ -89,7 +89,7 @@ void TransparentDraggableRect::deleteRect() mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); } } @@ -161,6 +161,7 @@ void TransparentDraggableRect::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); //保存 mPlot->SaveToSLF_Text(); //属性清空 diff --git a/logPlus/TransparentDraggableResult.cpp b/logPlus/TransparentDraggableResult.cpp index 1003677..196fb93 100644 --- a/logPlus/TransparentDraggableResult.cpp +++ b/logPlus/TransparentDraggableResult.cpp @@ -413,6 +413,7 @@ void TransparentDraggableResult::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); } void TransparentDraggableResult::onMousePress(QMouseEvent *event) diff --git a/logPlus/TransparentDraggableSwallCore.cpp b/logPlus/TransparentDraggableSwallCore.cpp index 4665c34..23de729 100644 --- a/logPlus/TransparentDraggableSwallCore.cpp +++ b/logPlus/TransparentDraggableSwallCore.cpp @@ -351,7 +351,7 @@ void TransparentDraggableSwallCore::deleteRect() mPlot->removeItem(m_qcpItemLine2); mPlot->removeItem(m_qcpItemLine3); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -452,6 +452,7 @@ void TransparentDraggableSwallCore::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); //保存 mPlot->SaveToSLF_SwallCore(); //属性清空 diff --git a/logPlus/TransparentGroupResult.cpp b/logPlus/TransparentGroupResult.cpp index b286d47..96355ad 100644 --- a/logPlus/TransparentGroupResult.cpp +++ b/logPlus/TransparentGroupResult.cpp @@ -440,7 +440,7 @@ void TransparentGroupResult::deleteRect() mPlot->removeItem(mItemTitle); mPlot->removeItem(mDragLine); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); } @@ -698,6 +698,7 @@ void TransparentGroupResult::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); } void TransparentGroupResult::onMousePress(QMouseEvent *event) diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 4285e9c..05b4eec 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -10,7 +10,6 @@ #include #include "Gradient.h" #include "PickFrac.h" -#include "ObjTubingstringResult.h" #include "DrawNrad.h" #include "formline.h" @@ -94,7 +93,7 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) : connect(CallManage::getInstance(), SIGNAL(sig_AddMCals(QString, QString, QString, QString, QString, int)), this, SLOT(s_addMCals(QString, QString, QString, QString, QString,int))); //套管组件 - connect(CallManage::getInstance(), SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, int)), this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString,int))); + connect(CallManage::getInstance(), SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, int, QStringList)), this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString,int, QStringList))); //改变固井曲线名 connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString))); @@ -318,6 +317,11 @@ void FormDraw::DisplayLines(QJsonArray linesArray) //沉积相 DisplayFac_One(lineObjInfo); } + else if (strType == "TubingstringObject") + { + //套管组件 + DisplayTubing_One(lineObjInfo); + } else { DisplayType_One(lineObjInfo); @@ -762,6 +766,91 @@ void FormDraw::DisplayFac_One(QJsonObject lineObjInfo) } } +//套管組件 +void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) +{ + QString strSlfName = ""; + QString strWellName = ""; + QString strLineName = ""; + QString strAliasName = "";//显示名称 + QFont curveNameFont("微软雅黑", 10); // 名称字体 + QColor lineColor = QColor(0, 0, 0);//颜色 + + if (lineObjInfo.contains("SlfName")) + { + QJsonValue value = lineObjInfo.value("SlfName"); + if (value.isString()) { + strSlfName = value.toString(); + //qDebug() << "SlfName:" << strSlfName; + + // + QString slffilename = QString(""); + int ind = strSlfName.lastIndexOf('\\'); + int ind2 = strSlfName.lastIndexOf('/'); + if (ind2 > ind) ind = ind2; + if (ind > -1) { + slffilename = strSlfName.mid(ind + 1); + strSlfName = slffilename; + } + } + } + if (lineObjInfo.contains("WellName")) + { + QJsonValue value = lineObjInfo.value("WellName"); + if (value.isString()) { + strWellName = value.toString(); + //qDebug() << "WellName:" << strWellName; + } + } + if (lineObjInfo.contains("LineName")) + { + QJsonValue value = lineObjInfo.value("LineName"); + if (value.isString()) { + strLineName = value.toString(); + //qDebug() << "LineName:" << strLineName; + } + } + if (lineObjInfo.contains("AliasName")) + { + QJsonValue value = lineObjInfo.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + //qDebug() << "strAliasName:" << strAliasName; + } + } + //字体 + if (lineObjInfo.contains("curveNameFont")) + { + QJsonValue value = lineObjInfo.value("curveNameFont"); + if (value.isString()) { + curveNameFont.fromString(value.toString()); + //qDebug() << "strUnit:" << strUnit; + } + } + // + if (lineObjInfo.contains("lineColor")) + { + lineColor.setNamedColor(lineObjInfo.value("lineColor").toString()); + } + + + + QString folderPath = GetLogdataPath(); + folderPath = folderPath + g_prjname; + strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; + + if (strLineName != "") + { + QStringList listOtherProperty; + listOtherProperty.append(strAliasName);//别名 + listOtherProperty.append(lineColor.name());//名称颜色 + listOtherProperty.append(curveNameFont.toString());//名称字体 + + //套管組件 + this->s_addTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); // + } +} + void FormDraw::DisplayLine_One(QJsonObject lineObjInfo) { QString strSlfName = ""; @@ -2847,7 +2936,7 @@ void FormDraw::s_addMCals(QString strUuid, QString strSlfName, QString strWellNa } //套管组件 -void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW) +void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW, QStringList listOtherProperty) { //井名&道名不一致 if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) @@ -2922,9 +3011,8 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st curv->yAxis2->setTicks(false); //套管组件 - QString strWaveName = "TUBTOOLS"; - CObjTubingstringResult *objTubingstringResult = new CObjTubingstringResult(); - objTubingstringResult->LoadFromSLF(curv, strSlfName, strWaveName); + //QString strWaveName = "TUBTOOLS"; + curv->LoadFromSLF_Tubing(strSlfName, strLineName); // connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); @@ -2933,12 +3021,18 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st m_listTableName.push_back(strLineName); QString strAliasName = "套管组件"; - QString strUnit = ""; QColor newlineColor=QColor(0,0,0); + if(listOtherProperty.size()>=3) + { + strAliasName = listOtherProperty[0]; + newlineColor.setNamedColor(listOtherProperty[1]); + } + + QString strUnit = ""; double width=2; QString strScaleType = ""; //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "TubingstringObject"); + m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "TubingstringObject", listOtherProperty); } void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName, diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index 69c0a82..dd9d363 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -69,6 +69,9 @@ public: //沉积相 void DisplayFac_One(QJsonObject lineObjInfo); + //套管組件 + void DisplayTubing_One(QJsonObject lineObjInfo); + // 跨道设置 void crossTrackSetting(); @@ -263,7 +266,7 @@ public slots: void s_addMCals(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); //套管组件 - void s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); + void s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW, QStringList listOtherProperty); //TDT // void s_addTDT(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index d47da8e..e12738c 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -181,6 +181,13 @@ QJsonObject FormInfo::makeJson() //item属性写入slf文件,不需要此次记录 return rootObj; } + else if (m_strType == "TubingstringObject") + { + //套管组件 + + //item属性写入slf文件,不需要此次记录 + return rootObj; + } rootObj["Unit"] = m_strUnit; rootObj["Width"] = m_dWidth; @@ -1089,6 +1096,14 @@ void FormInfo::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteTable); menu.exec(event->globalPos()); } + else if(m_strType=="TubingstringObject") + { + //套管组件 + QMenu menu(this); + menu.addAction(QIcon(::GetImagePath() + "icon/Sheet.png"), "数据对象查看", this, &FormInfo::onShowTable); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteTable); + menu.exec(event->globalPos()); + } } //曲线数据查看 diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 2a678cb..df964fb 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -107,8 +107,8 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName) this, SLOT(s_addMCals(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString))); //套管组件 - connect(this, SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)), - this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString))); + connect(this, SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)), + this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList))); //曲线选中,置顶 connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString))); @@ -267,7 +267,7 @@ void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackNam } else if(strType=="TubingstringObject") { - emit sig_AddTubingstring(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType); + emit sig_AddTubingstring(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType, listOtherProperty); } } @@ -1078,7 +1078,7 @@ void FormTrack::s_addMCals(QString strSlfName, QString strWellName, QString strT } //套管 -void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType) +void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty) { qDebug() << "FormTrack s_addTubingstring"; @@ -1103,6 +1103,13 @@ void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QStri formInfo->setVMin(vmin); formInfo->setFrontColor(QColor(0,0,0)); formInfo->setBackColor(QColor(255,255,255)); + // + if(listOtherProperty.size()>=3) + { + QFont curveNameFont("微软雅黑", 10); // 名称字体 + curveNameFont.fromString(listOtherProperty[2]); + formInfo->m_curveNameFont = curveNameFont; + } //设置高度 ui->tableWidget->setRowHeight(row, 100); //单元格委托 diff --git a/logPlus/formtrack.h b/logPlus/formtrack.h index 8093278..3f1c6df 100644 --- a/logPlus/formtrack.h +++ b/logPlus/formtrack.h @@ -94,7 +94,7 @@ signals: void sig_AddJiegutext(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); void sig_AddLogface(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); void sig_AddMCals(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); - void sig_AddTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); + void sig_AddTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); public slots: void s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); @@ -116,7 +116,7 @@ public slots: void s_addJiegutext(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); void s_addLogface(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); void s_addMCals(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); - void s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); + void s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={}); void s_addTDT(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType); diff --git a/logPlus/logPlus.pro b/logPlus/logPlus.pro index 68a1648..890a682 100644 --- a/logPlus/logPlus.pro +++ b/logPlus/logPlus.pro @@ -39,7 +39,6 @@ SOURCES += \ Gradient.cpp \ InDefTableDlg.cpp \ InterfaceWidget.cpp \ - ObjTubingstringResult.cpp \ PickFrac.cpp \ PropertyWidget.cpp \ QCPSizeHandle.cpp \ @@ -103,7 +102,6 @@ HEADERS += \ Gradient.h \ InDefTableDlg.h \ InterfaceWidget.h \ - ObjTubingstringResult.h \ PickFrac.h \ PropertyWidget.h \ QCPSizeHandle.h \ diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index e1175a4..087fb7e 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -3273,7 +3273,18 @@ void MainWindowCurve::s_NewMCals() //套管组件 void MainWindowCurve::s_NewTubingstring() { - QStringList sret = this->getSelectWell(); +// QStringList sret = this->getSelectWell(); +// if(sret.length() <= 0) +// return; + + //选中道 + if(m_SelectTableItem.m_iTableType==2) { + //新建表格曲线 + emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "IMAGE_DATA"); + return; + } + + QStringList sret = this->getSelectWell_New(); if(sret.length() <= 0) return; diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 298eb7e..3e2174d 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -68,6 +68,13 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel xAxis2->setTickLabels(false); yAxis2->setTickLabels(false); + //套管组件 + zoneOrder_Tubing.clear(); + if(zoneOrder_Tubing.size()==0) + { + zoneOrder_Tubing=GetZoneOrder(QString("TubTools.ini")); + } + connect(this->selectionRect(), &QCPSelectionRect::accepted, this, &QMyCustomPlot::slotSelectionRectAccepted); // make bottom and left axes transfer their ranges to top and right axes: connect(xAxis, SIGNAL(rangeChanged(QCPRange)), xAxis2, SLOT(setRange(QCPRange))); @@ -1299,6 +1306,26 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) //menu.addAction(QIcon(::GetImagePath() + "icon/Layer.png"), "沉积相自动描述", this, &QMyCustomPlot::ChangeDep); menu.exec(event->globalPos()); } + else if (strType == "TubingstringObject") + { + QStringList strs=zoneOrder_Tubing.keys(); + QStringList mstrs=QString("油管接箍,套管接箍,偏配,封隔器,筛管,喇叭口,水力猫,短接,管底部,油管深").split(","); + QMenu menu(this); + QMenu *pSubMenu = menu.addMenu("特殊工具"); + //套管组件 + for(int i=0;i-1) { + menu.addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), str, this, &QMyCustomPlot::addItem_Tubing); + } + else { + pSubMenu->addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), str, this, &QMyCustomPlot::addItem_Tubing); + } + } + //menu.addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), "添加偏配", this, &QMyCustomPlot::addItem_Tubing); + menu.exec(event->globalPos()); + } } //右键--添加分段线 @@ -7824,6 +7851,29 @@ bool QMyCustomPlot::LoadFromSLF_Fac(QString strSlfName, QString csCurve, bool bA return true; } +//添加套管组件 +void QMyCustomPlot::addItem_Tubing() +{ + double right_Hight = xAxis->pixelToCoord(m_event->pos().y());//x轴展示深度 + + QAction *pAct=dynamic_cast(sender()); + if(pAct){ + QString str=pAct->text(); + str.remove("添加"); + int i=zoneOrder_Tubing[str].toInt(); + if(i>-1) { + Slf_JIEGUPOS result; + result.Depth=-right_Hight; + result.Order=0; + result.Number=i; + // + drawOne_Tubing(result); + //保存 + SaveToSLF_Tubing(); + } + } +} + //添加沉积相 void QMyCustomPlot::addItem_Fac() { @@ -8042,3 +8092,263 @@ void QMyCustomPlot::RefreshItems_Fac(bool bAdd) //属性清空 //PropertyService()->InitCurrentViewInfo(); } + + +bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve) +{ + m_pResultList_Tubing.clear(); + + cclimgpath_Tubing=GetSymbolDir()+"\\管柱组件\\"; + + Slf_JIEGUPOS *m_pResult=NULL; + CMemRdWt *logio=new CMemRdWt(); + if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) + { + delete logio; +// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); + return false; + } + + + int iIndex=logio->OpenTable(csCurve.toStdString().c_str()); + if(iIndex>-1) { + int count=logio->GetTableRecordCount(iIndex); + //int fieldnum=logio->GetTableFieldCount(iIndex); + int len=logio->GetTableRecordLength(iIndex); + m_pResult=(Slf_JIEGUPOS *)new char[len+1]; + char buf[200]; + logio->IsChange=true; + + bool bDrawGuanzhu = false; + for(int i=0;iReadTable(iIndex,i+1,m_pResult); + + Slf_JIEGUPOS result; + result.Depth=m_pResult->Depth; + result.Order=m_pResult->Order; + result.Number=m_pResult->Number; + m_pResultList_Tubing.append(result); + + // + double depth=m_pResult->Depth; + int Order=m_pResult->Order; + int Number=m_pResult->Number; + + if(bDrawGuanzhu == false) + { + //还没有画管柱 + if(Number == zoneOrder_Tubing.value("管底部").toInt()|| + Number == zoneOrder_Tubing.value("油管深").toInt()|| + Number == zoneOrder_Tubing.value("喇叭口").toInt()|| + Number == zoneOrder_Tubing.value("剌叭口").toInt()) + { + bDrawGuanzhu = true;//画管柱 + + 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)); // 设置图片 + } + } + } + logio->CloseTable(iIndex); + delete m_pResult; + } + delete logio; + + for(int i=0; ixAxis->coordToPixel(-depth)-h/2.0; + 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); + +// QString cclimgfile=cclimgpath+name+".png"; +// double lY1 = widget->yAxis->range().lower;//+10 +// double lY2 = widget->yAxis->range().upper; +// QCPItemPixmap *mPixmap; +// mPixmap = new QCPItemPixmap(widget); +// mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 +// mPixmap->setLayer("overlay"); // 确保在最上层 +// // +// float upper = widget->xAxis->coordToPixel(-depth)-h/2.0; +// float lower = widget->xAxis->coordToPixel(-depth)+h/2.0; +// float newUpper = widget->xAxis->pixelToCoord(upper); +// float newLower = widget->xAxis->pixelToCoord(lower); +// mPixmap->topLeft->setCoords(newUpper, lY1 + (lY2-lY1-in)/2.0); +// mPixmap->bottomRight->setCoords(newLower, lY2 - (lY2-lY1-in)/2.0); +// mPixmap->setPixmap(QPixmap(cclimgfile)); // 设置图片 +} + +bool QMyCustomPlot::SaveToSLF_Tubing() +{ + static int isrun=false; + if(isrun) return false; + QString ss=m_strSlfName; + if(ss=="") return false; + isrun=true; + + Slf_JIEGUPOS m_Result; + CMemRdWt *logio=new CMemRdWt(); + if(!logio->Open(ss.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); + isrun=false; + return false; + } + bool isfirst=false; + int iIndex=logio->OpenTable(m_strLineName.toStdString().c_str()); + if (iIndex < 0) + { + if(!m_mapDraggable_Guan.size()) { + delete logio; + isrun=false; + return false; + } + if(m_strLineName.indexOf("READCCL",0,Qt::CaseInsensitive)>-1) { + iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,3, + "NO,DEPTH,NUMBER", + "4,4,4",//字段长度 + "1,4,4",//字段类型 + "0,0,0");//字段备注,1-枚举 + } + else iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,4, + "NO,DEPTH,NUMBER,DEST", + "4,4,4,64",//字段长度 + "1,4,4,6",//字段类型 + "0,0,8,0");//字段备注,1-枚举 + isfirst=true; + } + logio->IsChange=true; + logio->SetTableRecordCount(iIndex,m_mapDraggable_Guan.size()); + if(!m_mapDraggable_Guan.size()) { + delete logio; + if(isfirst)AddTableToWellRound(); + isrun=false; + return false; + } + int len=logio->GetTableRecordLength(iIndex); + + TransparentDraggableGuan *pDraggableRect =NULL; + //排序 + QList listSDepth; + for (QMap::Iterator iter = m_mapDraggable_Guan.begin(); iter != m_mapDraggable_Guan.end(); iter++) + { + pDraggableRect = (TransparentDraggableGuan*)iter.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + // + float fSDepth = -tmpRange.upper; + listSDepth.append(fSDepth); + } + qSort(listSDepth); + + // + for(int i=0; i::Iterator iter = m_mapDraggable_Guan.begin(); iter != m_mapDraggable_Guan.end(); iter++) + { + pDraggableRect = (TransparentDraggableGuan*)iter.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + float fSDepth = -tmpRange.upper; + float fEDepth = -tmpRange.lower; + if(fSDepth == listSDepth[i])//按顺序写入 + { + memset(&m_Result,0,len); + m_Result.Order=i+1; + m_Result.Depth=(fSDepth+fEDepth)/2.0; + // + QString name,itemName; + pDraggableRect->m_Result.replace("\\","/"); + int l=pDraggableRect->m_Result.lastIndexOf("/"); + if(l>-1) name=pDraggableRect->m_Result.mid(l+1); + l=name.indexOf("."); + name=name.left(l); + itemName=name; + // + m_Result.Number=zoneOrder_Tubing.value(itemName).toInt(); + if(len==sizeof(Slf_JIEGUPOS)) { + strncpy(m_Result.Dest,"",64); + m_Result.Dest[63]=0; + } + logio->WriteTable(iIndex,i+1,&m_Result); + } + } + } + logio->CloseTable(iIndex); + delete logio; + if(isfirst)AddTableToWellRound(); + isrun=false; + return true; +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 0d34465..133a083 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -270,6 +270,18 @@ public: //保存 void SaveToSLF_Fac(); + //套管組件 + QMap zoneOrder_Tubing; + float m_Oguan_Tubing = 63.5; + float m_Oind_Tubing = 121.36; + bool m_bDrawCCL_Tubing = false; + QString cclimgpath_Tubing=""; + QList m_pResultList_Tubing; + QString m_strAddTubing=""; + bool LoadFromSLF_Tubing(QString strSlfName, QString csCurve); + void drawOne_Tubing(Slf_JIEGUPOS result); + bool SaveToSLF_Tubing(); + public slots: void slot_time(); @@ -439,6 +451,10 @@ public slots: void addItem_Fac(); //添加沉积相 void RefreshItems_Fac(bool bAdd=true); //刷新数据 + //右键--套管组件 + void addItem_Tubing(); //添加套管组件 + //void RefreshItems_Tubing(); //刷新数据 + //右键--解释结论 void onOpenEditResult(); void onCloseEditResult(); diff --git a/logPlus/transparentdraggableGuan.cpp b/logPlus/transparentdraggableGuan.cpp index 5dacd12..265dce1 100644 --- a/logPlus/transparentdraggableGuan.cpp +++ b/logPlus/transparentdraggableGuan.cpp @@ -1,5 +1,6 @@ #include "transparentdraggableGuan.h" - +#include "PropertyWidget.h" +#include "CallManage.h" extern double g_dPixelPerCm;//每厘米像素数 //static GeoIndicatorGenerator m_drawGeo; @@ -236,20 +237,52 @@ void TransparentDraggableGuan::deleteRect() mPlot->removeItem(mPixmap); // mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); - - // - // //避免二次绘制框图 - // mPlot->m_bDrawRect = false; - // mDragMode = DragNone; - // //取消选中框 - // mPlot->selectionRect()->cancel(); - // mPlot->replot(); - // mPlot->selectionRect()->mActive=true; } } +//设置深度移动量 +void TransparentDraggableGuan::setItemDepthOffset() +{ + bool ok=0; + double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok); + if(!ok) return; + + QCPRange currentRange = getRange(); + QCPRange newRange = currentRange; + + newRange.lower = currentRange.lower-depthshift; + newRange.upper = currentRange.upper-depthshift; + + // + double width = currentRange.size(); +// //double center = mDragStartRange.center() + dx; +// double center = currentRange.center() - depthshift; +// newRange.lower = center - width/2; +// newRange.upper = center + width/2; + + // 检查是否超出轴范围 + if(newRange.lower < getMyLower()) { + return; + } + else if(newRange.upper > getMyUpper()) { + return; + } + // + setRange(newRange.lower, newRange.upper); + + { + //保存 + mPlot->SaveToSLF_Tubing(); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); + + //取消所有选中单元格 + emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, ""); + } +} void TransparentDraggableGuan::initRect() { @@ -317,6 +350,11 @@ void TransparentDraggableGuan::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); + //保存 + mPlot->SaveToSLF_Tubing(); + //属性清空 + PropertyService()->InitCurrentViewInfo(); } @@ -343,19 +381,13 @@ 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); + QMenu menu(nullptr); - QAction *delAction = menu.addAction("删除框图"); - //delAction->installEventFilter(this); - connect(delAction, &QAction::triggered, this, &TransparentDraggableGuan::onDelRect); - - // QAction* pItem = menu.exec(event->globalPos()); - // if(pItem == delAction) - // { - // //event->accept(); - - // int ii=0; - // ii++; - // } + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &TransparentDraggableGuan::onDelRect); + menu.addAction(QIcon(::GetImagePath() + "icon/Shift.png"), "设置深度移动量", this, &TransparentDraggableGuan::setItemDepthOffset); menu.exec(event->globalPos()); return; @@ -393,8 +425,32 @@ void TransparentDraggableGuan::onMousePress(QMouseEvent *event) } +int TransparentDraggableGuan::getCursor() +{ + if (m_bMoveRect) + { + return 2; + } + if (m_bArrow) + { + return 1; + } + return 0; +} + void TransparentDraggableGuan::onMouseMove(QMouseEvent *event) { + if (mDragMode == DragRect) + { + m_bMoveRect = true; + } + else + { + m_bArrow = false; + m_bMoveRect = false; + } + + //-------------------- if(mDragMode == DragNone) return; event->accept(); @@ -487,6 +543,12 @@ void TransparentDraggableGuan::onMouseMove(QMouseEvent *event) } } + //位置改变,鼠标拖动item + if(newRange.lower!= mDragStartRange.lower || newRange.upper!= mDragStartRange.upper) + { + m_bChange = true; + } + setRange(newRange.lower, newRange.upper); } @@ -495,6 +557,21 @@ void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event) { if(event->button() == Qt::LeftButton && mDragMode != DragNone) { event->accept(); + //属性 + { +// double low = mRect->topLeft->coords().x(); +// double hight = mRect->bottomRight->coords().x(); +// PropertyService()->initGujingItemProperty(this, low, hight, m_Result); + if(m_bChange) + { + //保存 + mPlot->SaveToSLF_Tubing(); + } + + //取消所有选中单元格 + emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, ""); + } + //避免二次绘制框图 mPlot->m_bDrawRect = false; //emit rangeChanged(getRange()); diff --git a/logPlus/transparentdraggableGuan.h b/logPlus/transparentdraggableGuan.h index fa74325..f0b0d55 100644 --- a/logPlus/transparentdraggableGuan.h +++ b/logPlus/transparentdraggableGuan.h @@ -55,14 +55,15 @@ private: void updateHandles() ; private slots: - void onDelRect(); + void onDelRect(); //删除 + void setItemDepthOffset(); //设置深度移动量 void onMousePress(QMouseEvent *event); void onMouseMove(QMouseEvent *event); void onMouseRelease(QMouseEvent *event); double getMyLower(); double getMyUpper(); -private: +public: QMyCustomPlot *mPlot; QCPItemRect *mRect; // QCPItemRect *mLeftHandle; @@ -83,6 +84,13 @@ private: // 添加最小宽度成员变量 double mMinWidth; float mIn=123; + + //鼠标形状 + bool m_bArrow = false; + bool m_bMoveRect = false; + int getCursor(); + //鼠标是否拖动item + bool m_bChange = false; }; #endif // TRANSPARENTDRAGGABLEGUAN_H diff --git a/logPlus/transparentdraggableRightList.cpp b/logPlus/transparentdraggableRightList.cpp index c7757c0..236d453 100644 --- a/logPlus/transparentdraggableRightList.cpp +++ b/logPlus/transparentdraggableRightList.cpp @@ -159,7 +159,7 @@ void TransparentDraggableRightList::deleteRect() } mPlot->m_bPriviewRightList = false;//当前是否正在编辑曲线。 - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -244,6 +244,7 @@ void TransparentDraggableRightList::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); } diff --git a/logPlus/transparentdraggableSelectRect.cpp b/logPlus/transparentdraggableSelectRect.cpp index ce79e61..d8a61a3 100644 --- a/logPlus/transparentdraggableSelectRect.cpp +++ b/logPlus/transparentdraggableSelectRect.cpp @@ -171,7 +171,7 @@ void TransparentDraggableSelectRect::deleteRect() } mPlot->m_bEditRect = false;//当前是否正在编辑曲线。 - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -276,6 +276,7 @@ void TransparentDraggableSelectRect::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); } diff --git a/logPlus/transparentdraggableimage.cpp b/logPlus/transparentdraggableimage.cpp index 0c82e08..91161b4 100644 --- a/logPlus/transparentdraggableimage.cpp +++ b/logPlus/transparentdraggableimage.cpp @@ -284,7 +284,7 @@ void TransparentDraggableImage::deleteRect() mPlot->removeItem(mPixmap); mPlot->removeItem(mItemTitle); - mPlot->replot(); + //mPlot->replot(); this->deleteLater(); // @@ -365,6 +365,7 @@ void TransparentDraggableImage::onDelRect() //mDragMode = DragNone; //删除框图 deleteRect(); + mPlot->replot(); } From 0aeec10a646fa39c39c09461c2fabee82f38ee95 Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Thu, 19 Mar 2026 09:44:09 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=B2=A9=E5=BF=83=E7=85=A7=E7=89=87=20?= =?UTF-8?q?=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 65 ++++++++++++++++++++------ logPlus/PropertyWidget.h | 5 +- logPlus/forminfo.h | 13 +----- logPlus/qmycustomplot.cpp | 28 ++++++++++- logPlus/qmycustomplot.h | 2 + logPlus/transparentdraggableimage.cpp | 67 ++++++++++++++++++++++++--- logPlus/transparentdraggableimage.h | 16 +++++++ 7 files changed, 161 insertions(+), 35 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 889816e..20fb05c 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -226,27 +226,57 @@ void PropertyWidget::changedYxzpItemProperty(QtProperty *qtProperty, const QVari { if(m_tdImage) { -// double lower = qVariant.value(); -// m_tdImage->setLower(-lower); - m_tdImage->mPlot->SaveToSLFImage(); + int borderWidth = qVariant.toInt(); + m_tdImage->setBorderWidth(borderWidth); + m_tdImage->setRange(m_tdImage->getRange().lower, m_tdImage->getRange().upper); } } else if("颜色" == m_propertyData[qtProperty]) { if(m_tdImage) { -// double lower = qVariant.value(); -// m_tdImage->setLower(-lower); - m_tdImage->mPlot->SaveToSLFImage(); + QColor newColor = qVariant.value(); + m_tdImage->setBorderColor(newColor); + m_tdImage->setRange(m_tdImage->getRange().lower, m_tdImage->getRange().upper); } } else if("线型" == m_propertyData[qtProperty]) { if(m_tdImage) { -// double lower = qVariant.value(); -// m_tdImage->setLower(-lower); - m_tdImage->mPlot->SaveToSLFImage(); + Qt::PenStyle newStyle = Qt::SolidLine; + int iStyle = qVariant.value(); + switch(iStyle) + { + case 0: + //无 + newStyle = Qt::NoPen; + break; + case 1: + //实线 + newStyle = Qt::SolidLine; + break; + case 2: + //虚线 + newStyle = Qt::DashLine; + break; + case 3: + //点线 + newStyle = Qt::DotLine; + break; + case 4: + //虚点线 + newStyle = Qt::DashDotLine; + break; + case 5: + //虚点点线 + newStyle = Qt::DashDotDotLine; + break; + default: + break; + } + m_tdImage->setBorderStyle(newStyle); + m_tdImage->setRange(m_tdImage->getRange().lower, m_tdImage->getRange().upper); } } } @@ -2785,7 +2815,8 @@ void PropertyWidget::initImageProperty(FormInfo *formInfo) m_strCurrentProperty = Image_Property; } -void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString pictureFile,double left, double width) +void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString pictureFile, + double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth) { //初始化,清空 InitCurrentViewInfo(); @@ -2821,9 +2852,17 @@ void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, d _CreateVariantPropertyItem("当前项", "左边距%", left, QVariant::Int); _CreateVariantPropertyItem("当前项", "宽度%", width, QVariant::Int); - _CreateVariantPropertyItem("边框属性", "线宽", formInfo->m_yxzpLineWidth, QVariant::Int); - _CreateVariantPropertyItem("边框属性", "颜色", formInfo->m_yxzpColor, QVariant::Color); - _CreateVariantPropertyItem("边框属性", "线型", formInfo->m_yxzpLineshape, QVariant::String); + _CreateVariantPropertyItem("边框属性", "线宽", borderWidth, QVariant::Int); + _CreateVariantPropertyItem("边框属性", "颜色", borderColor, QVariant::Color); +// _CreateVariantPropertyItem("边框属性", "线型", borderStyle, QVariant::String); + QStringList listStyle; + listStyle.append("无"); + listStyle.append("实线"); + listStyle.append("虚线"); + listStyle.append("点线"); + listStyle.append("虚点线"); + listStyle.append("虚点点线"); + _CreateEnumPropertyItem("边框属性", "线型", (int)borderStyle, listStyle); } //当前属性类型 diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index df22198..3d088e6 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -75,10 +75,11 @@ class PropertyWidget:public QDockWidget { Q_OBJECT + public: PropertyWidget(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0); ~PropertyWidget(); - + private: QtTreePropertyBrowser *m_pPropertyBrowser; QtVariantPropertyManager *m_pVariantManager; @@ -177,7 +178,7 @@ public: // 岩心照片属性 void initImageProperty(FormInfo *formInfo); - void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width); + void initImageItemProperty(TransparentDraggableImage* tdImage, double lower, double upper, QString strResult, double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth); // 井壁取心属性 void initSwallCoreProperty(FormInfo *formInfo); diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index a7a537b..737d03c 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -165,18 +165,7 @@ public: bool m_yxzpTwoEndDrawing; // 绘制颜色 bool m_yxzpDrawColor; - // 图片文件 - QString m_yxzpPictureFile; - // 左边距 - double m_yxzpLeftMargin; - // 宽度 - double m_yxzpWidth; - // 线宽 - int m_yxzpLineWidth; - // 颜色 - QString m_yxzpColor; - // 线型 - QString m_yxzpLineshape; + //气测/FMT/射孔/文本 QStringList m_FieldNameList; diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 298eb7e..6d7c088 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -3974,7 +3974,33 @@ void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QS m_mapDraggable_Image[strUuid] = dragRect; } -void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QString imagePath, double left, double width) +void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QString imagePath, + double left, double width) +{ + QtCommonClass *qtCommon = new QtCommonClass(this); + QString strUuid = qtCommon->getUUid(); + + // 在初始化代码中 + TransparentDraggableImage *dragRect = new TransparentDraggableImage(this, strUuid); + //图片,提前设值,后面setRange改变 + dragRect->setResult(imagePath); + + // 可选:设置颜色 + dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色 + //最小宽度 + dragRect->setMinWidth(0.1); + //dragRect->setTitle(strText); + dragRect->setLeft(left); + dragRect->setWidth(width); + + // 设置初始范围 + dragRect->setRange(left_Low, right_Hight,left,width); + + m_mapDraggable_Image[strUuid] = dragRect; +} + +void QMyCustomPlot::addImageToPlot(double left_Low, double right_Hight, const QString imagePath, + double left, double width, QColor borderColor, Qt::PenStyle borderStyle, int borderWidth) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 0d34465..e702170 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -279,6 +279,8 @@ public: //岩心照片 void addImageToPlot(double left_Low, double right_Hight, const QString imagePath); void addImageToPlot(double left_Low, double right_Hight, const QString imagePath, double left, double width); + // 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 addRandomGraph(QVector x, QVector y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit, diff --git a/logPlus/transparentdraggableimage.cpp b/logPlus/transparentdraggableimage.cpp index 0c82e08..24b9a8c 100644 --- a/logPlus/transparentdraggableimage.cpp +++ b/logPlus/transparentdraggableimage.cpp @@ -199,6 +199,13 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight) //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); // 边框颜色 + this->m_BorderStyle = Qt::SolidLine; // 边框线型 + this->m_BorderWidth = 1; // 边框线宽(像素) + } + // 应用边框样式到主矩形 + mRect->setPen(QPen(m_BorderColor, m_BorderWidth, m_BorderStyle)); updateHandles(); mPlot->replot(); } @@ -244,6 +251,7 @@ void TransparentDraggableImage::setRange(double left_Low, double right_Hight,dou mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + mRect->setPen(QPen(m_BorderColor, m_BorderWidth, m_BorderStyle)); updateHandles(); mPlot->replot(); } @@ -305,7 +313,17 @@ void TransparentDraggableImage::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->setPen(QPen(QColor(70, 70, 255, 200))); + + // 左边距 宽度 都是百分比 + this->m_left = 0; + this->m_width = 100; + // ========== 新增:边框样式成员变量 ========== + this->m_BorderColor = QColor(0, 0, 0, 200); // 边框颜色 + this->m_BorderStyle = Qt::SolidLine; // 边框线型 + this->m_BorderWidth = 1; // 边框线宽(像素) + // 应用边框样式到主矩形 + mRect->setPen(QPen(this->m_BorderColor, this->m_BorderWidth, this->m_BorderStyle)); // 创建左右边界控制点 mLeftHandle = new QCPItemRect(mPlot); @@ -395,7 +413,10 @@ void TransparentDraggableImage::onMousePress(QMouseEvent *event) double hight = mRect->bottomRight->coords().x(); double left = getLeft(); double width = getWidth(); - PropertyService()->initImageItemProperty(this, low, hight, m_Result, left, width); + QColor borderColor = this->m_BorderColor; // 边框颜色 + Qt::PenStyle borderStyle = this->m_BorderStyle; // 边框线型 + int borderWidth = this->m_BorderWidth; // 边框线宽(像素) + PropertyService()->initImageItemProperty(this, low, hight, m_Result, left, width,borderColor,borderStyle,borderWidth); QMenu menu(nullptr); QAction *delAction = menu.addAction("删除框图"); @@ -497,7 +518,6 @@ void TransparentDraggableImage::onMouseMove(QMouseEvent *event) newRange.upper = getMyUpper(); newRange.lower = newRange.upper - width; } - // QCPRange axisRange = mPlot->xAxis->range(); // if(newRange.lower < axisRange.lower) { // newRange.lower = axisRange.lower; @@ -539,7 +559,6 @@ void TransparentDraggableImage::onMouseMove(QMouseEvent *event) } setRange(newRange.lower, newRange.upper); - } void TransparentDraggableImage::onMouseRelease(QMouseEvent *event) @@ -549,9 +568,12 @@ void TransparentDraggableImage::onMouseRelease(QMouseEvent *event) // 显示属性 double low = mRect->topLeft->coords().x(); double hight = mRect->bottomRight->coords().x(); - double left = getLeft(); - double width = getWidth(); - PropertyService()->initImageItemProperty(this, low, hight, m_Result, left, width); + double left = this->getLeft(); + double width = this->getWidth(); + QColor borderColor = this->m_BorderColor; // 边框颜色 + Qt::PenStyle borderStyle = this->m_BorderStyle; // 边框线型 + int borderWidth = this->m_BorderWidth; // 边框线宽(像素) + PropertyService()->initImageItemProperty(this, low, hight, m_Result, left, width, borderColor, borderStyle, borderWidth); //避免二次绘制框图 @@ -692,3 +714,34 @@ double TransparentDraggableImage::getWidth() { return this->m_width; } +// 设置边框颜色 +void TransparentDraggableImage::setBorderColor(const QColor &color) +{ + this->m_BorderColor = color; +} + +// 设置边框线型 +void TransparentDraggableImage::setBorderStyle(Qt::PenStyle style) +{ + this->m_BorderStyle = style; +} + +// 设置边框线宽 +void TransparentDraggableImage::setBorderWidth(int width) +{ + // 线宽不能小于1像素,避免无效值 + if (width < 1) width = 1; + this->m_BorderWidth = width; +} +QColor TransparentDraggableImage::geBorderColor() +{ + return this->m_BorderColor; +} +Qt::PenStyle TransparentDraggableImage::getBorderStyle() +{ + return this->m_BorderStyle; +} +int TransparentDraggableImage::getBorderWidth() +{ + return this->m_BorderWidth; +} diff --git a/logPlus/transparentdraggableimage.h b/logPlus/transparentdraggableimage.h index 1fddd6d..e08daba 100644 --- a/logPlus/transparentdraggableimage.h +++ b/logPlus/transparentdraggableimage.h @@ -58,6 +58,17 @@ public: void setWidth(double width); double getWidth(); + + // 设置边框颜色 + void setBorderColor(const QColor &color); + // 设置边框线型(实线、虚线、点线等) + void setBorderStyle(Qt::PenStyle style); + // 设置边框线宽 + void setBorderWidth(int width); + QColor geBorderColor(); + Qt::PenStyle getBorderStyle(); + int getBorderWidth(); + signals: void rangeChanged(QCPRange newRange); @@ -95,6 +106,11 @@ private: double mMinWidth; // 左边距 宽度 都是百分比 double m_left = 0, m_width = 100; + + // ========== 新增:边框样式成员变量 ========== + QColor m_BorderColor; // 边框颜色 + Qt::PenStyle m_BorderStyle; // 边框线型 + int m_BorderWidth; // 边框线宽(像素) }; #endif // TRANSPARENTDRAGGABLEIMAGE_H From b146ad58570edf061864f5b5fe0d9f1b43fd42fb Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Thu, 19 Mar 2026 14:24:54 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=B7=B1=E5=BA=A6=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 38 ++++++++++++++++++++++++++++++++++++-- logPlus/PropertyWidget.h | 8 +++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 66014e0..a75da4c 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1253,6 +1253,12 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant //先处理通用属性 CommonPropertyChanged(pProperty, variant); } + else if (m_strCurrentProperty == Depth_Property) // 深度 + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + changedDepthProperty(pProperty, variant); + } if("深度比例尺" == m_propertyData[pProperty]) { @@ -2372,12 +2378,35 @@ void PropertyWidget::initTableProperty(FormInfo *formInfo) void PropertyWidget::initDepthProperty(FormInfo *formInfo) { - // _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); - // + _CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("通常", "显示单位", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_nJg, QVariant::String); + + _CreateVariantPropertyItem("字体", "名称", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("字体", "单位", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "字体", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("深度标注", "旋转", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("深度标注", "斜深位置", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "垂深位置", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("深度标注", "海拔垂深位置", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("主刻度线", "长度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("主刻度线", "宽度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("次刻度线", "长度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("次刻度线", "宽度", formInfo->m_nJg, QVariant::String); + + m_strCurrentProperty = Depth_Property; } void PropertyWidget::initProperty(FormInfo *formInfo) @@ -3187,3 +3216,8 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo) m_strCurrentProperty = Tubing_Property; } + +void PropertyWidget::changedDepthProperty(QtProperty *pProperty, const QVariant &variant) +{ + +} diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index f9bf87e..7360ee9 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -47,6 +47,8 @@ #define Image_Property "Image_Property" // 岩心图片 #define ImageItem_Property "ImageItem_Property" // 岩心图片item +#define Depth_Property "Depth_Property" // 深度 + #define SwallCore_Property "SwallCore_Property" //井壁取心 #define SwallCoreItem_Property "SwallCoreItem_Property" //井壁取心item @@ -165,7 +167,7 @@ public: void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col); void initTableProperty(FormInfo *formInfo); - + // 深度 void initDepthProperty(FormInfo *formInfo); void initProperty(FormInfo *formInfo); @@ -221,9 +223,13 @@ public: //处理通用属性 void CommonPropertyChanged(QtProperty *pProperty, const QVariant &variant); + // 岩心照片 void changedYxzpProperty(QtProperty *pProperty, const QVariant &variant); void changedYxzpItemProperty(QtProperty *pProperty, const QVariant &variant); + // 深度 + void changedDepthProperty(QtProperty *pProperty, const QVariant &variant); + public slots: void SlotPropertyChanged(QtProperty *property, const QVariant &variant); void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle); From e8a0ee786900d168ed9a7e70e09b295eeb9e1599 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Thu, 19 Mar 2026 18:02:39 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=A5=97=E7=AE=A1=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E8=BF=BD=E5=8A=A0=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 38 +++++++++++++- logPlus/formdraw.cpp | 13 ++++- logPlus/qmycustomplot.cpp | 78 +++++++++++++++++++--------- logPlus/qmycustomplot.h | 9 ++-- logPlus/transparentdraggableGuan.cpp | 2 - 5 files changed, 106 insertions(+), 34 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index a75da4c..9f8759d 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1005,6 +1005,10 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { return; } + if("" == strLineName) + { + return; + } // m_formInfo->m_strLineName = strLineName; @@ -1178,6 +1182,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_formInfo->m_strAliasName = strAliasName; //改变曲线Title emit CallManage::getInstance()->sig_changeJiegutextTitle(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, strAliasName); + //刷新 + InitCurrentViewInfo(); } } else @@ -1188,6 +1194,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_formInfo->m_strAliasName = strAliasName; //改变曲线Title emit CallManage::getInstance()->sig_changeJiegutextTitle(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, strAliasName); + //刷新 + InitCurrentViewInfo(); } else { @@ -1201,6 +1209,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant strAliasName == "气测-FMT-射孔-文本"; //改变曲线Title emit CallManage::getInstance()->sig_changeJiegutextTitle(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, strAliasName); + //刷新 + InitCurrentViewInfo(); } else { @@ -1215,6 +1225,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } //改变曲线Title emit CallManage::getInstance()->sig_changeJiegutextTitle(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, strAliasName); + //刷新 + InitCurrentViewInfo(); } } } @@ -1252,14 +1264,32 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { //先处理通用属性 CommonPropertyChanged(pProperty, variant); + if("显示单位" == m_propertyData[pProperty]) + { + QString newUnit = variant.value(); + m_formInfo->m_strUnit = newUnit; + m_formInfo->update(); + } + else if("左刻度" == m_propertyData[pProperty]) + { + double newLeftScale = variant.value(); + m_formInfo->m_vmin = newLeftScale; + emit CallManage::getInstance()->sig_ChangeLeftScale(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, newLeftScale); + } + else if("右刻度" == m_propertyData[pProperty]) + { + double newRightScale = variant.value(); + m_formInfo->m_vmax = newRightScale; + emit CallManage::getInstance()->sig_ChangeRightScale(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, newRightScale); + } } - else if (m_strCurrentProperty == Depth_Property) // 深度 + else if (m_strCurrentProperty == Depth_Property) // 深度 { //先处理通用属性 CommonPropertyChanged(pProperty, variant); changedDepthProperty(pProperty, variant); } - + if("深度比例尺" == m_propertyData[pProperty]) { //qDebug() << "深度比例尺->改变"; @@ -3214,6 +3244,10 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo) _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 = Tubing_Property; } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 05b4eec..fc73f60 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -2979,7 +2979,11 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st curv->show(); //------------------- - int iMyWidth = curv->axisRect(0)->width(); + int iMyWidth = curv->m_OutD_Tubing; //暂时按照套管外径 //curv->axisRect(0)->width(); + if(listOtherProperty.size()>=6) + { + iMyWidth = listOtherProperty[5].toDouble(); + } m_LeftVal = 0; m_RightVal = iMyWidth; @@ -3028,7 +3032,12 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st newlineColor.setNamedColor(listOtherProperty[1]); } - QString strUnit = ""; + QString strUnit = "mm"; + if(listOtherProperty.size()>=6) + { + strUnit = listOtherProperty[3]; + } + double width=2; QString strScaleType = ""; //道-对象 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 337365d..1942ca5 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -6567,6 +6567,10 @@ bool QMyCustomPlot::LoadFromSLF_Jiegutext(QString strSlfName, QString csCurve, Q } int iIndex=logio->OpenTable(csCurve.toStdString().c_str()); + if(iIndex<0) { + delete logio; + return false; + } if(iIndex>-1) { int count = logio->GetTableRecordCount(iIndex); int fieldnum = logio->GetTableFieldCount(iIndex); @@ -6648,7 +6652,7 @@ bool QMyCustomPlot::LoadFromSLF_Jiegutext(QString strSlfName, QString csCurve, Q pInfo->update(); //属性清空 - PropertyService()->InitCurrentViewInfo(); + //PropertyService()->InitCurrentViewInfo(); return true; } @@ -7840,10 +7844,12 @@ bool QMyCustomPlot::LoadFromSLF_Fac(QString strSlfName, QString csCurve, bool bA if(m_qcpItemLine) { removeItem(m_qcpItemLine); + m_qcpItemLine = nullptr; } if(m_qcpItemLine2) { removeItem(m_qcpItemLine2); + m_qcpItemLine2 = nullptr; } int iMyWidth = this->axisRect(0)->width(); @@ -8131,12 +8137,16 @@ bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve) if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) { delete logio; -// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); return false; } - int iIndex=logio->OpenTable(csCurve.toStdString().c_str()); + if(iIndex<0) + { + delete logio; + return false; + } + // if(iIndex>-1) { int count=logio->GetTableRecordCount(iIndex); //int fieldnum=logio->GetTableFieldCount(iIndex); @@ -8191,6 +8201,40 @@ bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve) } } } + + //先删除 + 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); + + // logio->CloseTable(iIndex); delete m_pResult; } @@ -8212,15 +8256,15 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result) int Number=result.Number; float h=20; - float in=m_Oind_Tubing; + float in=m_Oguan_Tubing; if(!m_bDrawCCL_Tubing) { if(Number==1) { - in=m_Oind_Tubing+1; + in=m_Oguan_Tubing+1; } else if(Number==zoneOrder_Tubing.value("套管接箍").toInt()){ h=10; - in=m_Oind_Tubing; + in=m_Oguan_Tubing; } else if(Number==zoneOrder_Tubing.value("封隔器").toInt()|| Number==zoneOrder_Tubing.value("水力猫").toInt()|| @@ -8229,15 +8273,15 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result) ) { if(Number==zoneOrder_Tubing.value("封隔器").toInt()) h=25; - in=m_Oind_Tubing; + in=m_Oguan_Tubing; } else { - in=m_Oind_Tubing+1; + in=m_Oguan_Tubing+1; } } else { - in=m_Oind_Tubing+1; + in=m_Oguan_Tubing+1; } QString name; @@ -8257,22 +8301,6 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result) float newUpper = this->xAxis->pixelToCoord(upper); float newLower = this->xAxis->pixelToCoord(lower); this->addGuanToPlot(newLower, newUpper, cclimgfile, in); - -// QString cclimgfile=cclimgpath+name+".png"; -// double lY1 = widget->yAxis->range().lower;//+10 -// double lY2 = widget->yAxis->range().upper; -// QCPItemPixmap *mPixmap; -// mPixmap = new QCPItemPixmap(widget); -// mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 -// mPixmap->setLayer("overlay"); // 确保在最上层 -// // -// float upper = widget->xAxis->coordToPixel(-depth)-h/2.0; -// float lower = widget->xAxis->coordToPixel(-depth)+h/2.0; -// float newUpper = widget->xAxis->pixelToCoord(upper); -// float newLower = widget->xAxis->pixelToCoord(lower); -// mPixmap->topLeft->setCoords(newUpper, lY1 + (lY2-lY1-in)/2.0); -// mPixmap->bottomRight->setCoords(newLower, lY2 - (lY2-lY1-in)/2.0); -// mPixmap->setPixmap(QPixmap(cclimgfile)); // 设置图片 } bool QMyCustomPlot::SaveToSLF_Tubing() diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 86e2069..34a5904 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -272,12 +272,15 @@ public: //套管組件 QMap zoneOrder_Tubing; - float m_Oguan_Tubing = 63.5; - float m_Oind_Tubing = 121.36; + 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=""; + QString m_strAddTubing=""; + QCPItemRect *mRect_Tubing=nullptr; + QCPItemRect *mRect2_Tubing=nullptr; bool LoadFromSLF_Tubing(QString strSlfName, QString csCurve); void drawOne_Tubing(Slf_JIEGUPOS result); bool SaveToSLF_Tubing(); diff --git a/logPlus/transparentdraggableGuan.cpp b/logPlus/transparentdraggableGuan.cpp index 265dce1..ac0ac08 100644 --- a/logPlus/transparentdraggableGuan.cpp +++ b/logPlus/transparentdraggableGuan.cpp @@ -70,8 +70,6 @@ void TransparentDraggableGuan::DrawSVGTiled(QPainter* painter,QString svgFileNam painter->restore(); } - - //设置最小宽度 void TransparentDraggableGuan::setMinWidth(double minWidth) { From 729f608f892df557492e0b55b0c4d48e089e1d74 Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Fri, 20 Mar 2026 09:10:07 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=B7=B1=E5=BA=A6=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 3 ++ logPlus/PropertyWidget.cpp | 57 ++++++++++++++++------- logPlus/PropertyWidget.h | 1 + logPlus/formdraw.cpp | 43 ++++++++++++++--- logPlus/formtrack.cpp | 2 +- logPlus/mainwindowcurve.cpp | 3 +- logPlus/qmycustomplot.cpp | 93 +++++++++++++++++++++++++++++++++++++ logPlus/qmycustomplot.h | 2 + 8 files changed, 177 insertions(+), 27 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index d29e994..dae8a73 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -171,6 +171,9 @@ signals: //改变Draw属性 void sig_changeDrawProperty(QVariantList vlist); + //改变深度属性 + void sig_changeDepthProperty(QVariantList vlist); + //右键--添加分段线 void sig_AddShiftLine(QString strUuid, double left_Low, double right_Hight); //校深线段 diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index a75da4c..1a19bfe 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1257,7 +1257,17 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { //先处理通用属性 CommonPropertyChanged(pProperty, variant); - changedDepthProperty(pProperty, variant); +// changedDepthProperty(pProperty, variant); + + 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_changeDepthProperty(listCond); } if("深度比例尺" == m_propertyData[pProperty]) @@ -2379,32 +2389,32 @@ void PropertyWidget::initTableProperty(FormInfo *formInfo) void PropertyWidget::initDepthProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_bVerticaDrawing, QVariant::Bool); + _CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); + _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); _CreateVariantPropertyItem("通常", "显示单位", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_lineColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "名称", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("字体", "字体", formInfo->m_curveNameFont, QVariant::Font);//名称 _CreateVariantPropertyItem("字体", "单位", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "字体", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("深度标注", "旋转", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::Double); + _CreateVariantPropertyItem("深度标注", "标注字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("深度标注", "旋转(°)", formInfo->m_nJg, QVariant::Double); + _CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_nJg, QVariant::Bool); + _CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_nJg, QVariant::Bool); + _CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_nJg, QVariant::Bool); + _CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_nJg, QVariant::Bool); + _CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_strAliasName, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "斜深位置", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("深度标注", "垂深位置", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("深度标注", "海拔垂深位置", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("主刻度线", "长度", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("主刻度线", "宽度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("主刻度线", "主刻度线长度", formInfo->m_nJg, QVariant::Double); + _CreateVariantPropertyItem("主刻度线", "主刻度线宽度", formInfo->m_nJg, QVariant::Double); - _CreateVariantPropertyItem("次刻度线", "长度", formInfo->m_nJg, QVariant::String); - _CreateVariantPropertyItem("次刻度线", "宽度", formInfo->m_nJg, QVariant::String); + _CreateVariantPropertyItem("次刻度线", "次刻度线长度", formInfo->m_nJg, QVariant::Double); + _CreateVariantPropertyItem("次刻度线", "次刻度线宽度", formInfo->m_nJg, QVariant::Double); m_strCurrentProperty = Depth_Property; } @@ -3219,5 +3229,16 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo) void PropertyWidget::changedDepthProperty(QtProperty *pProperty, const QVariant &variant) { + if("长度" == m_propertyData[pProperty]) + { + int height = variant.toInt(); + m_formInfo->update(); + } + else if("长度" == m_propertyData[pProperty]) + { + int height = variant.toInt(); + + m_formInfo->update(); + } } diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 7360ee9..0749118 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -145,6 +145,7 @@ public: TransparentDraggableRect* m_tdText; TransparentDraggableLayer* m_tdLayer; TransparentDraggableJiegutext* m_tdJiegutext; + QMyCustomPlot m_depthMyCustomPlot; public: QWidget* GetPropertyWidget(); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 05b4eec..f57b7a1 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -4369,25 +4369,54 @@ void FormDraw::initGujing(QMyCustomPlot *widget, QString strSlfName, QString str void FormDraw::initDepth(QMyCustomPlot *curv) { + curv->xAxis->setTicks(false); + curv->xAxis->setSubTicks(false); + curv->xAxis->setTickLabels(false); + curv->yAxis->setTickLabels(true); curv->yAxis->setTickLabelSide(QCPAxis::lsInside); - QFont font1("微软雅黑", 16); //fontSize 10 + QFont font1("微软雅黑", 16); //fontSize 16 curv->yAxis->setTickLabelFont(font1); curv->yAxis->setRange(m_iY1, m_iY2); curv->axisRect()->setupFullAxesBox(); // // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 - // curv->yAxis->ticker()->setTickCount(60);//y个主刻度 + curv->yAxis->ticker()->setTickCount(60);//y个主刻度 + curv->m_bX2Y = false; + //对调XY轴,在最前面设置 - QCPAxis *yAxis = curv->yAxis; - QCPAxis *xAxis = curv->xAxis; - curv->xAxis = yAxis; - curv->yAxis = xAxis; - + // QCPAxis *yAxis = curv->yAxis; + // QCPAxis *xAxis = curv->xAxis; + // curv->xAxis = yAxis; + // curv->yAxis = xAxis; } +//void FormDraw::initDepth(QMyCustomPlot *curv) +//{ +// curv->xAxis->setTicks(true); // 显示X轴主刻度(默认true) +// curv->yAxis->setTicks(false); // 隐藏Y轴主刻度 +// curv->xAxis->setSubTicks(true); // 显示X轴副刻度 +// curv->yAxis->setSubTicks(false); // 隐藏Y轴副刻度 +// curv->xAxis->setTickLabels(true); +// curv->yAxis->setTickLabels(false); +// curv->xAxis->setTickLabelSide(QCPAxis::lsInside); +//// curv->yAxis->setTickLabelSide(QCPAxis::lsInside); +// curv->xAxis->setTickLength(25, 0); // X轴主刻度:内侧15px,外侧0px(隐藏) +//// curv->yAxis->setTickLength(25, 0); +// QPen tickPen; +// tickPen.setColor(Qt::red); // 主刻度颜色(红色) +// tickPen.setWidth(2); // 主刻度线宽(2像素) +// tickPen.setStyle(Qt::SolidLine); // 刻度线样式(实线,可选虚线Qt::DashLine) +// curv->xAxis->setTickPen(tickPen); // 应用到X轴主刻度 +// //对调XY轴,在最前面设置 +// QCPAxis *yAxis = curv->yAxis; +// QCPAxis *xAxis = curv->xAxis; +// curv->xAxis = yAxis; +// curv->yAxis = xAxis; +//} + void FormDraw::initFgrq(QMyCustomPlot *widget) { widget->m_iX1 = 0; diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index df964fb..31e7834 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -292,7 +292,7 @@ FormInfo* FormTrack::setDrawDt(QStringList listdt, QJsonObject obj) { if ("depthObject" == strType) { - strAliasName = "深度"; + strAliasName = "深度22"; } else if ("plObject" == strType) { diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 087fb7e..0b2a2bb 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -2429,7 +2429,8 @@ void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName) //增加1列 ui->tableWidget_2->setColumnCount(columnCount+1); } - else { + else + { //增加1列(空白) ui->tableWidget_2->setColumnCount(columnCount+1); //设置列宽 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 337365d..0c87406 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -135,6 +135,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel //Plot重新加载数据 connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString))); + connect(CallManage::getInstance(), SIGNAL(sig_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList))); connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList))); //改变固井曲线名 connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString))); @@ -4501,6 +4502,98 @@ void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist) } } +void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist) +{ + + + QString strUuid = vlist.at(0).toString(); + QString strSlfName = vlist.at(1).toString(); + QString strWellName = vlist.at(2).toString(); + QString strTrackName = vlist.at(3).toString(); + QString strLineName = vlist.at(4).toString(); + + if (m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + QString strProperty = vlist.at(5).toString(); + QVariant varVal = vlist.at(6).toString(); + if ("主刻度线长度" == strProperty) + { + double height = varVal.toDouble(); + this->yAxis->setTickLength(height, 0); + +// QPen tickPen; +// tickPen.setColor(Qt::green); // 主刻度颜色(红色) +// tickPen.setWidth(2); // 主刻度线宽(2像素) +// tickPen.setStyle(Qt::SolidLine); // 刻度线样式(实线,可选虚线Qt::DashLine) +// this->xAxis->setTickPen(tickPen); // 应用到X轴主刻度 + } + else if ("主刻度线宽度" == strProperty) + { + double temp = varVal.toDouble(); + QPen tickPen = this->yAxis->tickPen(); + // 4. 仅修改画笔宽度(核心:不改动其他属性) + tickPen.setWidth(temp); + // 5. 重新应用画笔到主刻度(仅影响主刻度) + this->yAxis->setTickPen(tickPen); + } + else if ("次刻度线长度" == strProperty) + { + double temp = varVal.toDouble(); + this->yAxis->setSubTickLength(temp, 0); + } + else if ("次刻度线宽度" == strProperty) + { + double temp = varVal.toDouble(); + QPen tickPen = this->yAxis->subTickPen(); + // 4. 仅修改画笔宽度(核心:不改动其他属性) + tickPen.setWidth(temp); + // 5. 重新应用画笔到主刻度(仅影响主刻度) + this->yAxis->setSubTickPen(tickPen); + } + else if ("标尺颜色" == strProperty) + { + QColor newColor = varVal.value(); + this->yAxis->setTickLabelColor(newColor); + } + else if ("间隔" == strProperty) + { + double temp = varVal.toDouble(); + // 创建固定间隔刻度器 + QSharedPointer fixedTicker(new QCPAxisTickerFixed); + // 设置刻度间隔为50 + fixedTicker->setTickStep(temp); + // 设置刻度步长策略为固定值 + fixedTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone); + // 应用到Y轴 + this->yAxis->setTicker(fixedTicker); + } + else if ("标注字体" == strProperty) + { + QFont newFont = varVal.value(); + this->yAxis->setTickLabelFont(newFont); + } + else if ("旋转(°)" == strProperty) + { + double temp = varVal.toDouble(); + this->yAxis->setTickLabelRotation(temp); + } + else if ("斜深" == strProperty) + { + bool temp = varVal.toBool(); + this->yAxis->setTickLabels(temp); + } + + + + + + this->replot(); + } +} void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 86e2069..05177c4 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -493,6 +493,8 @@ public slots: void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName); void s_changeDrawProperty(QVariantList vlist); + // 深度 + void s_changeDepthProperty(QVariantList vlist); void onAddRect();