From 84092edf7d3d59e93c92d5aa8112f63e7e743727 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Thu, 23 Apr 2026 18:42:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=9A=E8=87=82?= =?UTF-8?q?=E4=BA=95=E5=BE=84json=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/DrawNrad.cpp | 16 +-- logPlus/DrawNrad.h | 18 +-- logPlus/PropertyWidget.cpp | 32 ++--- logPlus/formdraw.cpp | 216 ++++++++++++++++++++++++++++----- logPlus/formdraw.h | 9 ++ logPlus/forminfo.cpp | 232 ++++++++++++++++++++++++------------ logPlus/forminfo.h | 22 ++++ logPlus/formtrack.cpp | 34 +++++- logPlus/formtrack.h | 2 + logPlus/mainwindowcurve.cpp | 15 ++- logPlus/qmycustomplot.cpp | 38 ++++++ logPlus/qmycustomplot.h | 3 + 12 files changed, 487 insertions(+), 150 deletions(-) diff --git a/logPlus/DrawNrad.cpp b/logPlus/DrawNrad.cpp index f9da076..e0548cc 100644 --- a/logPlus/DrawNrad.cpp +++ b/logPlus/DrawNrad.cpp @@ -10,14 +10,14 @@ extern double GetData(int RepCode,char *buffer); -CDrawNrad::CDrawNrad(QMyCustomPlot *myCustomPlot, QString strSlfName, QString csCurve) +CDrawNrad::CDrawNrad(QMyCustomPlot *myCustomPlot) { m_myCustomPlot = myCustomPlot; // m_PointNum=0; - m_LeftVal=30; - m_RightVal=65; + m_LeftVal=30;//最小井径 + m_RightVal=65;//最大井径 m_crHorzLine=qRgb(0,0,0); m_crVertLine=qRgb(0,0,0); @@ -25,8 +25,10 @@ CDrawNrad::CDrawNrad(QMyCustomPlot *myCustomPlot, QString strSlfName, QString cs m_nVertLineWidth = 1; m_nHorzGrid = 0; m_nArm = 36; - m_iStartArmPos=1; - m_iEndArmPos=11; + + m_iStartArmPos=1;//左边井径序号 + m_iEndArmPos=11; //右边井径序号 + m_nFrac = 0; m_D3Angle = 10; @@ -40,8 +42,8 @@ CDrawNrad::CDrawNrad(QMyCustomPlot *myCustomPlot, QString strSlfName, QString cs m_flVFactor = 0.8; //椭圆纵向半径占横向半径比例 m_nVertGrid = 20; //纵向网格间隔 - ReadData(strSlfName, csCurve); - DrawNrad(strSlfName, csCurve); +// ReadData(strSlfName, csCurve); +// DrawNrad(strSlfName, csCurve); } CDrawNrad::~CDrawNrad(void) diff --git a/logPlus/DrawNrad.h b/logPlus/DrawNrad.h index 3e89cd9..92103aa 100644 --- a/logPlus/DrawNrad.h +++ b/logPlus/DrawNrad.h @@ -10,7 +10,7 @@ class CDrawNrad:public QObject { Q_OBJECT public: - CDrawNrad(QMyCustomPlot *myCustomPlot, QString strSlfName, QString csCurve); + CDrawNrad(QMyCustomPlot *myCustomPlot); virtual ~CDrawNrad(void); public: @@ -19,12 +19,12 @@ public: public: // 以下变量需保存在模板里 - float m_flVFactor; // 椭圆纵向半径占横向半径比例 - float m_flWjMaxFactor; //外径最大位置占道的比例 - float m_flWjMinFactor; //外径最小位置占道的比例 - float m_nVertGrid; // 深度方向每隔多少个采样点绘制一个网格 - int m_nHorzStep; // 旋转时增量,最小0,最大:20 - int m_nHorzGrid; // 井径曲线间网格数 + float m_flVFactor; // 椭圆纵向半径占横向半径比例 + float m_flWjMaxFactor; //外径最大位置占道的比例 + float m_flWjMinFactor; //外径最小位置占道的比例 + float m_nVertGrid; // 纵向网格间隔 深度方向每隔多少个采样点绘制一个网格 + int m_nHorzStep; // 旋转井径增量,最小0,最大:20 + int m_nHorzGrid; // 井径曲线间网格数 QColor m_crHorzLine, m_crVertLine; // 网格纵、横线颜色 int m_nHorzLineWidth, m_nVertLineWidth;// 网格纵、横线宽度 int m_nArm, m_nColorNum;// @@ -39,8 +39,8 @@ public: float m_flRlev2; //二维曲线采样间隔 int m_nSamples; int m_PointNum; - float m_LeftVal; //左刻度 - float m_RightVal; //右刻度 + float m_LeftVal; //最小井径 + float m_RightVal; //最大井径 Slf_WAVE WaveInfo; //波列基本信息 float m_SDep,m_EDep,m_Rlev; }; diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index cf62eba..1f9343f 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -3216,27 +3216,27 @@ void PropertyWidget::initProperty(FormInfo *formInfo) { //蝌蚪图 this->initKedouProperty(formInfo); - } - else if (m_strLineName == "GANZHUANG.LINE") - { - //杆状图 - this->initGanzhuangProperty(formInfo); - } - else if (m_strLineName == "JINGYANKUATA.LINE") - { - //井眼垮塌矢量图 - this->initJyktProperty(formInfo); - } - else if (m_strLineName == "XIEFANGWEI.LINE") - { - //井斜方位图 - this->initDenvProperty(formInfo); - } + } else { this->initTableProperty(formInfo); } } + else if (formInfo->m_strType == "ganzhuangtuObject") + { + //杆状图 + this->initGanzhuangProperty(formInfo); + } + else if (formInfo->m_strType == "JyktObject") + { + //井眼垮塌矢量图 + this->initJyktProperty(formInfo); + } + else if (formInfo->m_strType == "DenvObject") + { + //井斜方位图 + this->initDenvProperty(formInfo); + } else if (formInfo->m_strType == "depthObject") { this->initDepthProperty(formInfo); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index f65b257..fc8808d 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -10,7 +10,6 @@ #include #include "Gradient.h" #include "PickFrac.h" -#include "DrawNrad.h" #include "formline.h" #include "PropertyWidget.h" #include "DrawTvd.h" @@ -536,12 +535,18 @@ void FormDraw::DisplayLines(QJsonArray linesArray) // 岩心照片 displayImageData(lineObjInfo); } - else if (strLineName == "FRAC_HOLE.TABLE" || strLineName == "GANZHUANG.LINE" || strLineName == "JINGYANKUATA.LINE" || strLineName == "XIEFANGWEI.LINE") + else if (strLineName == "FRAC_HOLE.TABLE") { - // 蝌蚪图、杆状图、井眼垮塌矢量图、井斜方位图 + // 蝌蚪图 DisplayKedouAndOthers_One(lineObjInfo); } } + else if (strType == "ganzhuangtuObject" + || strType == "JyktObject" || strType == "DenvObject") + { + // 杆状图、井眼垮塌矢量图、井斜方位图 + DisplayKedouAndOthers_One(lineObjInfo); + } else if (strType == "JiegutextObject") { //气测/FMT/射孔/文本 @@ -568,6 +573,11 @@ void FormDraw::DisplayLines(QJsonArray linesArray) // 频率统计图 DisplayType_One(lineObjInfo); } + else if (strType == "MCalsObject") + { + // 多臂井径属性 + DisplayMCals_One(lineObjInfo); + } else { DisplayType_One(lineObjInfo); @@ -1199,6 +1209,79 @@ void FormDraw::DisplayKedouAndOthers_One(QJsonObject lineObjInfo) } } +//多臂井径 +void FormDraw::DisplayMCals_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; + } + } + + QString folderPath = GetLogdataPath(); + folderPath = folderPath + g_prjname; + strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; + + if (strLineName != "") + { + //多臂井径 + this->addMCals(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, lineObjInfo); + } +} + //气测/FMT/射孔/文本 void FormDraw::DisplayJiegutext_One(QJsonObject lineObjInfo) { @@ -3122,6 +3205,50 @@ QMyCustomPlot* FormDraw::addKedouAndOthers(QString strUuid, QString strSlfName, return curv; } +QMyCustomPlot* FormDraw::addMCals(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QJsonObject listOtherProperty) +{ + //井名&道名不一致 + if (strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) + { + } + else + { + return NULL; + } + + if (m_listLineName.contains(strLineName)) + { + qDebug() << "FormDraw strLineName already exist! " << strLineName; + return NULL; + } + + // + QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strLineName); + //绑定m_formTrack,方便关联formInfo + curv->m_formTrack = m_formTrack; + curv->setDepthY(m_iY1, m_iY2); + curv->initGeometry(m_strUuid, m_iScale, m_nTrackW); + curv->show(); + + QString strAliasName = "多臂井径"; + QColor newlineColor=QColor(0,0,0); + // 显示名称 + if (listOtherProperty.contains("AliasName")) + { + QJsonValue value = listOtherProperty.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + } + } + // + initMCals(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty); + + connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); + // + m_listLineName.push_back(strLineName); + return curv; +} + void FormDraw::s_addLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) { //井名&道名不一致 @@ -4248,47 +4375,70 @@ void FormDraw::s_addMCals(QString strUuid, QString strSlfName, QString strWellNa QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strLineName); //绑定m_formTrack,方便关联formInfo curv->m_formTrack = m_formTrack; + curv->m_strUuid = m_strUuid; + curv->setDepthY(m_iY1, m_iY2); + curv->initGeometry(m_strUuid, m_iScale, g_iOneWidth); curv->show(); - //------------------- - int iMyWidth = curv->axisRect(0)->width(); - - m_LeftVal = 0; - m_RightVal = iMyWidth; - - float vmax = iMyWidth; - float vmin = 0; - curv->setScaleX(vmin, vmax); - curv->setDepthY(m_iY1, m_iY2); - curv->initGeometry(m_strUuid, m_iScale, g_iOneWidth); - curv->axisRect()->setupFullAxesBox(); - // - curv->xAxis->ticker()->setTickCount(10);//x个主刻度 - curv->yAxis->ticker()->setTickCount(60);//y个主刻度 - - //对调XY轴,在最前面设置 - QCPAxis *yAxis = curv->yAxis; - QCPAxis *xAxis = curv->xAxis; - curv->xAxis = yAxis; - curv->yAxis = xAxis; - //多臂井径 - QString strWaveName = "FCA2"; - CDrawNrad *drawNrad = new CDrawNrad(curv, strSlfName, strWaveName); + initMCals(curv, strSlfName, strLineName); // connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // m_listLineName.push_back(strLineName); +} - QString strAliasName = "多臂井径"; +//多臂井径 +void FormDraw::initMCals(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QJsonObject listOtherProperty) +{ + //隐藏网格 + widget->xAxis->grid()->setVisible(false); + widget->yAxis->grid()->setVisible(false); + // + widget->m_bRowGridVisible = false; + widget->m_bColGridVisible = false; + + //------------------- + int iMyWidth = widget->axisRect(0)->width(); + + m_LeftVal = 0; + m_RightVal = iMyWidth; + + float vmax = iMyWidth; + float vmin = 0; + widget->setScaleX(vmin, vmax); + widget->axisRect()->setupFullAxesBox(); + // + widget->xAxis->ticker()->setTickCount(10);//x个主刻度 + widget->yAxis->ticker()->setTickCount(60);//y个主刻度 + + //对调XY轴,在最前面设置 + QCPAxis *yAxis = widget->yAxis; + QCPAxis *xAxis = widget->xAxis; + widget->xAxis = yAxis; + widget->yAxis = xAxis; + + //隐藏刻度 + widget->xAxis->setTicks(false); + widget->yAxis->setTicks(false); + widget->xAxis2->setTicks(false); + widget->yAxis2->setTicks(false); + widget->xAxis->setVisible(false); + widget->xAxis2->setVisible(false); + widget->yAxis->setVisible(false); + widget->yAxis2->setVisible(false); + + //----------------------------------- QString strUnit = ""; - QColor newlineColor=QColor(0,0,0); double width=2; QString strScaleType = ""; //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "MCalsObject"); + FormInfo* pInfo = m_formTrack->AddMCals(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "MCalsObject", listOtherProperty); + + //多臂井径 + widget->Draw_MCals(); } //套管组件 @@ -5171,7 +5321,7 @@ void FormDraw::initGanzhuang(QMyCustomPlot *widget, QString strSlfName, QString strUnit = listOtherProperty["Unit"].toString(); // 单位 } //道-对象 - FormInfo* pInfo = m_formTrack->AddKedouAndOthers(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty); + FormInfo* pInfo = m_formTrack->AddKedouAndOthers(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "ganzhuangtuObject", listOtherProperty); //杆状图 widget->Draw_Ganzhuang(); @@ -5229,7 +5379,7 @@ void FormDraw::initJykt(QMyCustomPlot *widget, QString strSlfName, QString strLi strUnit = listOtherProperty["Unit"].toString(); // 单位 } //道-对象 - FormInfo* pInfo = m_formTrack->AddKedouAndOthers(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty); + FormInfo* pInfo = m_formTrack->AddKedouAndOthers(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "JyktObject", listOtherProperty); //杆状图 widget->Draw_Jykt(); @@ -5287,7 +5437,7 @@ void FormDraw::initDenv(QMyCustomPlot *widget, QString strSlfName, QString strLi strUnit = listOtherProperty["Unit"].toString(); // 单位 } //道-对象 - FormInfo* pInfo = m_formTrack->AddKedouAndOthers(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty); + FormInfo* pInfo = m_formTrack->AddKedouAndOthers(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "DenvObject", listOtherProperty); //杆状图 widget->Draw_Denv(); diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index b085966..8f5aa31 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -48,6 +48,8 @@ public: void DisplayTable_One(QJsonObject lineObjInfo); //蝌蚪图 void DisplayKedouAndOthers_One(QJsonObject lineObjInfo); + //多臂井径 + void DisplayMCals_One(QJsonObject lineObjInfo); //气测/FMT/射孔/文本 void DisplayJiegutext_One(QJsonObject lineObjInfo); @@ -94,6 +96,10 @@ protected: QMyCustomPlot* addKedouAndOthers(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QJsonObject listOtherProperty={}); + //多臂井径 + QMyCustomPlot* addMCals(QString strUuid, QString strSlfName, QString strWellName, + QString strTrackName, QString strLineName, QJsonObject listOtherProperty={}); + public slots: void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent* event); @@ -157,6 +163,9 @@ public: //井斜方位图 void initDenv(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "井斜方位图", QColor newlineColor=QColor(0,0,0), QJsonObject listOtherProperty={}); + //多臂井径 + void initMCals(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "多臂井径", QColor newlineColor=QColor(0,0,0), QJsonObject listOtherProperty={}); + void ReadFracDef(); void ReadData(QString strSlfName, QString strLineName);//表格 void ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve);//曲线 diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index cf1614c..b4e6a17 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -239,7 +239,7 @@ void FormInfo::initProperty_Ganzhuang(QJsonObject obj) else { QString strType = obj.value("Type").toString(); - if ("tableObject" == strType) + if ("ganzhuangtuObject" == strType) { // 字体 // 名称 @@ -295,7 +295,7 @@ void FormInfo::initProperty_Jykt(QJsonObject obj) else { QString strType = obj.value("Type").toString(); - if ("tableObject" == strType) + if ("JyktObject" == strType) { // 字体 // 名称 @@ -356,7 +356,7 @@ void FormInfo::initProperty_Denv(QJsonObject obj) else { QString strType = obj.value("Type").toString(); - if ("tableObject" == strType) + if ("DenvObject" == strType) { // 字体 // 名称 @@ -389,6 +389,56 @@ void FormInfo::initProperty_Denv(QJsonObject obj) } } +void FormInfo::initProperty_MCals(QJsonObject obj) +{ + if(obj.isEmpty()) + { + m_MinVal = 30;//最小井径 + m_MaxVal = 65;//最大井径 + m_iStartArmPos = 0; //左边井径序号 + m_iEndArmPos = 20;//右边井径序号 + m_MinRatio = 0.5; //最小外径占道比例 + m_MaxRatio = 0.6;//最大外径占道比例 + m_nVertGrid = 20; //纵向网格间隔 + m_nHorzGrid = 0;//井径曲线间网格 + m_nHorzStep = 5;//旋转井径增量 + m_flVFactor = 0.8; //井柱椭圆纵横半径比 + + m_nHLineWidth =1; + m_nVLineWidth =1; + } + else + { + QString strType = obj.value("Type").toString(); + if ("waveObject" == strType) + { + // 字体 + // 名称 + this->m_curveNameFont.fromString(obj["curveNameFont"].toString()); + // 单位 + this->m_strUnitFont.fromString(obj["m_strUnitFont"].toString()); + // 刻度 + this->m_pl_fontScale.fromString(obj["m_pl_fontScale"].toString()); + + m_MinVal = obj["m_MinVal"].toDouble();//最小井径 + m_MaxVal = obj["m_MaxVal"].toDouble();//最大井径 + m_iStartArmPos = obj["m_iStartArmPos"].toInt(); //左边井径序号 + m_iEndArmPos = obj["m_iEndArmPos"].toInt(); //右边井径序号 + m_MinRatio =obj["m_MinRatio"].toDouble(); //最小外径占道比例 + m_MaxRatio = obj["m_MaxRatio"].toDouble();//最大外径占道比例 + m_nVertGrid = obj["m_nVertGrid"].toInt(); //纵向网格间隔 + m_nHorzGrid = obj["m_nHorzGrid"].toInt();//井径曲线间网格 + m_nHorzStep = obj["m_nHorzStep"].toInt();//旋转井径增量 + m_flVFactor = obj["m_flVFactor"].toDouble(); //井柱椭圆纵横半径比 + + m_nHLineWidth = obj["m_nHLineWidth"].toInt(); + m_HLineColor.setNamedColor(obj["m_HLineColor"].toString()); + m_nVLineWidth = obj["m_nVLineWidth"].toInt(); + m_VLineColor.setNamedColor(obj["m_VLineColor"].toString()); + } + } +} + void FormInfo::initProperty(QJsonObject obj) { m_vmin = obj.value("vmin").toDouble(); @@ -705,82 +755,7 @@ QJsonObject FormInfo::makeJson() rootObj["m_pl_custom1"] = this->m_pl_custom1; // 自定义1 rootObj["m_pl_custom2"] = this->m_pl_custom2; // 自定义2 return rootObj; - } - else if (m_strLineName == "GANZHUANG.LINE") - { - //杆状图 - // 字体 - rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 - rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 - // 曲线选择 - rootObj["m_pl_azimuthCurve"] = this->m_pl_azimuthCurve; // 方位曲线 - rootObj["m_pl_inclinationCurve"] = this->m_pl_inclinationCurve; // 倾角曲线 - rootObj["m_pl_GradCurve"] = this->m_pl_GradCurve; // 可信度曲线 - //杆 - rootObj["m_nTailLen"] = this->m_nTailLen; // 尾线长度 - rootObj["m_nTailWidth"] = this->m_nTailWidth; // 尾线宽度 - rootObj["m_crTail"] = this->m_crTail.name(); // 尾线颜色 - // 显示控制 - rootObj["m_pl_minInclination"] = this->m_pl_minInclination; // 最小倾角 - rootObj["m_pl_maxInclination"] = this->m_pl_maxInclination; // 最大倾角 - rootObj["m_flGrad1"] = this->m_flGrad1; // 可信度1 - rootObj["m_flGrad2"] = this->m_flGrad2; // 可信度2 - //单位 - rootObj["Unit"] = m_strUnit; - rootObj["m_flStep"] = m_flStep;//深度间隔 - return rootObj; - } - else if (m_strLineName == "JINGYANKUATA.LINE") - { - //井眼垮塌矢量图 - // 字体 - rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 - rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 - // 曲线选择 - rootObj["m_pl_azimuthCurve"] = this->m_pl_azimuthCurve; // 方位曲线 - rootObj["m_pl_deltaCurve"] = this->m_pl_deltaCurve; // 井径差曲线 - //蝌蚪符号 - rootObj["m_nRadius"] = this->m_nRadius; // 圆半径 - rootObj["m_nCircleWidth"] = this->m_nCircleWidth; // 圆线宽度 - rootObj["m_nTailLen"] = this->m_nTailLen; // 尾线长度 - rootObj["m_nTailWidth"] = this->m_nTailWidth; // 尾线宽度 - rootObj["m_crCircle"] = this->m_crCircle.name(); // 圆线颜色 - rootObj["m_crTail"] = this->m_crTail.name(); // 尾线颜色 - rootObj["m_crPointFill"] = this->m_crPointFill.name(); // 圆填充色 - // - rootObj["vmax"] = m_vmax;//右刻度 - rootObj["vmin"] = m_vmin;//左刻度 - rootObj["m_flStep"] = m_flStep;//深度间隔 - rootObj["m_nOffset"] = m_nOffset;//角度偏移 - //单位 - rootObj["Unit"] = m_strUnit; - return rootObj; - } - else if (m_strLineName == "XIEFANGWEI.LINE") - { - //井斜方位图 - // 字体 - rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 - rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 - // 曲线选择 - rootObj["m_pl_azimuthCurve"] = this->m_pl_azimuthCurve; // 方位曲线 - rootObj["m_pl_deviCurve"] = this->m_pl_deviCurve; // 井斜曲线 - //蝌蚪符号 - rootObj["m_nRadius"] = this->m_nRadius; // 圆半径 - rootObj["m_nCircleWidth"] = this->m_nCircleWidth; // 圆线宽度 - rootObj["m_nTailLen"] = this->m_nTailLen; // 尾线长度 - rootObj["m_nTailWidth"] = this->m_nTailWidth; // 尾线宽度 - rootObj["m_crCircle"] = this->m_crCircle.name(); // 圆线颜色 - rootObj["m_crTail"] = this->m_crTail.name(); // 尾线颜色 - rootObj["m_crPointFill"] = this->m_crPointFill.name(); // 圆填充色 - // - rootObj["vmax"] = m_vmax;//右刻度 - rootObj["vmin"] = m_vmin;//左刻度 - rootObj["m_flStep"] = m_flStep;//深度间隔 - //单位 - rootObj["Unit"] = m_strUnit; - return rootObj; - } + } } else if (m_strType == "JiegutextObject") { @@ -820,6 +795,105 @@ QJsonObject FormInfo::makeJson() //item属性写入slf文件,不需要此次记录 return rootObj; } + else if (m_strType == "ganzhuangtuObject") + { + //杆状图 + // 字体 + rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 + rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 + // 曲线选择 + rootObj["m_pl_azimuthCurve"] = this->m_pl_azimuthCurve; // 方位曲线 + rootObj["m_pl_inclinationCurve"] = this->m_pl_inclinationCurve; // 倾角曲线 + rootObj["m_pl_GradCurve"] = this->m_pl_GradCurve; // 可信度曲线 + //杆 + rootObj["m_nTailLen"] = this->m_nTailLen; // 尾线长度 + rootObj["m_nTailWidth"] = this->m_nTailWidth; // 尾线宽度 + rootObj["m_crTail"] = this->m_crTail.name(); // 尾线颜色 + // 显示控制 + rootObj["m_pl_minInclination"] = this->m_pl_minInclination; // 最小倾角 + rootObj["m_pl_maxInclination"] = this->m_pl_maxInclination; // 最大倾角 + rootObj["m_flGrad1"] = this->m_flGrad1; // 可信度1 + rootObj["m_flGrad2"] = this->m_flGrad2; // 可信度2 + //单位 + rootObj["Unit"] = m_strUnit; + rootObj["m_flStep"] = m_flStep;//深度间隔 + return rootObj; + } + else if (m_strType == "JyktObject") + { + //井眼垮塌矢量图 + // 字体 + rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 + rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 + // 曲线选择 + rootObj["m_pl_azimuthCurve"] = this->m_pl_azimuthCurve; // 方位曲线 + rootObj["m_pl_deltaCurve"] = this->m_pl_deltaCurve; // 井径差曲线 + //蝌蚪符号 + rootObj["m_nRadius"] = this->m_nRadius; // 圆半径 + rootObj["m_nCircleWidth"] = this->m_nCircleWidth; // 圆线宽度 + rootObj["m_nTailLen"] = this->m_nTailLen; // 尾线长度 + rootObj["m_nTailWidth"] = this->m_nTailWidth; // 尾线宽度 + rootObj["m_crCircle"] = this->m_crCircle.name(); // 圆线颜色 + rootObj["m_crTail"] = this->m_crTail.name(); // 尾线颜色 + rootObj["m_crPointFill"] = this->m_crPointFill.name(); // 圆填充色 + // + rootObj["vmax"] = m_vmax;//右刻度 + rootObj["vmin"] = m_vmin;//左刻度 + rootObj["m_flStep"] = m_flStep;//深度间隔 + rootObj["m_nOffset"] = m_nOffset;//角度偏移 + //单位 + rootObj["Unit"] = m_strUnit; + return rootObj; + } + else if (m_strType == "DenvObject") + { + //井斜方位图 + // 字体 + rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 + rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 + // 曲线选择 + rootObj["m_pl_azimuthCurve"] = this->m_pl_azimuthCurve; // 方位曲线 + rootObj["m_pl_deviCurve"] = this->m_pl_deviCurve; // 井斜曲线 + //蝌蚪符号 + rootObj["m_nRadius"] = this->m_nRadius; // 圆半径 + rootObj["m_nCircleWidth"] = this->m_nCircleWidth; // 圆线宽度 + rootObj["m_nTailLen"] = this->m_nTailLen; // 尾线长度 + rootObj["m_nTailWidth"] = this->m_nTailWidth; // 尾线宽度 + rootObj["m_crCircle"] = this->m_crCircle.name(); // 圆线颜色 + rootObj["m_crTail"] = this->m_crTail.name(); // 尾线颜色 + rootObj["m_crPointFill"] = this->m_crPointFill.name(); // 圆填充色 + // + rootObj["vmax"] = m_vmax;//右刻度 + rootObj["vmin"] = m_vmin;//左刻度 + rootObj["m_flStep"] = m_flStep;//深度间隔 + //单位 + rootObj["Unit"] = m_strUnit; + return rootObj; + } + else if (m_strType == "MCalsObject") + { + //多臂井径 + // 字体 + rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 + rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 + + rootObj["m_MinVal"] = m_MinVal;//最小井径 + rootObj["m_MaxVal"] = m_MaxVal;//最大井径 + rootObj["m_iStartArmPos"] = m_iStartArmPos; //左边井径序号 + rootObj["m_iEndArmPos"] = m_iEndArmPos; //右边井径序号 + rootObj["m_MinRatio"] = m_MinRatio; //最小外径占道比例 + rootObj["m_MaxRatio"] = m_MaxRatio;//最大外径占道比例 + rootObj["m_nVertGrid"] = m_nVertGrid; //纵向网格间隔 + rootObj["m_nHorzGrid"] = m_nHorzGrid;//井径曲线间网格 + rootObj["m_nHorzStep"] = m_nHorzStep;//旋转井径增量 + rootObj["m_flVFactor"] = m_flVFactor; //井柱椭圆纵横半径比 + + rootObj["m_nHLineWidth"] = m_nHLineWidth; + rootObj["m_HLineColor"] = m_HLineColor.name(); + rootObj["m_nVLineWidth"] = m_nVLineWidth; + rootObj["m_VLineColor"] = m_VLineColor.name(); + return rootObj; + } rootObj["Unit"] = m_strUnit; rootObj["Width"] = m_dWidth; diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index e928c14..d1bc948 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -26,10 +26,16 @@ public: ~FormInfo(); void initProperty(QJsonObject obj); + //蝌蚪图 void initProperty_Kedou(QJsonObject obj); + //杆状图 void initProperty_Ganzhuang(QJsonObject obj); + //井眼垮塌矢量图 void initProperty_Jykt(QJsonObject obj); + //井斜方位图 void initProperty_Denv(QJsonObject obj); + //多臂井径 + void initProperty_MCals(QJsonObject obj); void paintClassify(QPainter &painter, int compassCenterY); private: @@ -387,6 +393,22 @@ public: //井斜方位图 QString m_pl_deviCurve = "DEVI"; // 井斜曲线 + //多臂井径 + float m_MinVal = 30; //最小井径 + float m_MaxVal = 65; //最大井径 + int m_iStartArmPos = 0; //左边井径序号 + int m_iEndArmPos = 20; //右边井径序号 + float m_MinRatio = 0.5; //最小外径占道比例 + float m_MaxRatio = 0.6; //最大外径占道比例 + int m_nVertGrid = 20; //纵向网格间隔 + int m_nHorzGrid = 0; //井径曲线间网格 + int m_nHorzStep = 5; //旋转井径增量 + float m_flVFactor = 0.8; //井柱椭圆纵横半径比 + int m_nHLineWidth =1; + QColor m_HLineColor = QColor(0,0,0); + int m_nVLineWidth =1; + QColor m_VLineColor = QColor(0,0,0); + public: void setLineWidth(double dWidth); double getLineWidth(); diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index bd3d077..93b649b 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -301,7 +301,7 @@ FormInfo* FormTrack::AddKedouAndOthers(QString strSlfName, QString strWellName, return nullptr; } - qDebug() << "FormTrack AddKedou"; + qDebug() << "FormTrack AddKedouAndOthers"; ui->tableWidget->m_strUuid = m_strUuid; int row = ui->tableWidget->rowCount(); @@ -329,7 +329,37 @@ FormInfo* FormTrack::AddKedouAndOthers(QString strSlfName, QString strWellName, formInfo->m_strAliasName = strAliasName; formInfo->m_strUnit = strUnit; formInfo->m_strScaleType = strScaleType; - formInfo->m_strType = "tableObject"; + formInfo->m_strType = strType; + formInfo->setLineWidth(dWidth); + formInfo->setVMax(vmax); + formInfo->setVMin(vmin); + formInfo->setFrontColor(QColor(0,0,0)); + formInfo->setBackColor(QColor(255,255,255)); + + //设置高度 + ui->tableWidget->setRowHeight(row, 100); + // + ui->tableWidget->setCellWidget(row, 0, formInfo); + return formInfo; +} + +//多臂井径 +FormInfo* FormTrack::AddMCals(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QString strType, QJsonObject listOtherProperty) +{ + qDebug() << "FormTrack AddMCals"; + + ui->tableWidget->m_strUuid = m_strUuid; + int row = ui->tableWidget->rowCount(); + ui->tableWidget->setRowCount(row + 1); + + //曲线信息栏 + FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, strTrackName, strLineName, lineColor); + formInfo->m_strUuid = m_strUuid; + formInfo->initProperty_MCals(listOtherProperty); + formInfo->m_strAliasName = strAliasName; + formInfo->m_strUnit = strUnit; + formInfo->m_strScaleType = strScaleType; + formInfo->m_strType = strType; formInfo->setLineWidth(dWidth); formInfo->setVMax(vmax); formInfo->setVMin(vmin); diff --git a/logPlus/formtrack.h b/logPlus/formtrack.h index 14d606a..fb8dd2a 100644 --- a/logPlus/formtrack.h +++ b/logPlus/formtrack.h @@ -46,6 +46,8 @@ public: void Add(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QString strType, QStringList listOtherProperty={}); //蝌蚪图 FormInfo* AddKedouAndOthers(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QString strType, QJsonObject listOtherProperty={}); + //多臂井径 + FormInfo* AddMCals(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QString strType, QJsonObject listOtherProperty={}); FormInfo* setDrawDt(QStringList listdt, QJsonObject obj); diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 2713c95..25c5379 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -3829,12 +3829,19 @@ void MainWindowCurve::s_NewMCals() return; } - QStringList sret = this->getSelectWell(); - if(sret.length() <= 0) + int nW = 4; + QStringList sret = this->insertCol(nW); + if (sret.length() <= 0) return; + QString strWellName = sret.at(0); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = sret.at(1); - //新建井+道+曲线(首条) - NewWellAndTrack(sret.at(0), sret.at(1), "FCA2", "MCalsObject"); + //新建道 + emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, "FCA2", "MCalsObject", nW); + +// //新建井+道+曲线(首条) +// NewWellAndTrack(sret.at(0), sret.at(1), "FCA2", "MCalsObject"); } //套管组件 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 189db44..695b1ce 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -27,6 +27,7 @@ #include "fracsel.h" #include "formtrack.h" #include "formdraw.h" +#include "DrawNrad.h" //是否隐藏刻度 extern int g_iShow; @@ -12795,3 +12796,40 @@ void QMyCustomPlot::Draw_Denv() } this->replot(); } + +//多臂井径 +void QMyCustomPlot::Draw_MCals() +{ + //this->clearGraphs(); + this->clearItems(); + + // + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + + //多臂井径 + QString strWaveName = "FCA2"; + CDrawNrad *drawNrad = new CDrawNrad(this); + //属性 + drawNrad->m_LeftVal = pInfo->m_MinVal;//最小井径 + drawNrad->m_RightVal = pInfo->m_MaxVal;//最大井径 + drawNrad->m_iStartArmPos = pInfo->m_iStartArmPos;//左边井径序号 + drawNrad->m_iEndArmPos = pInfo->m_iEndArmPos;//右边井径序号 + drawNrad->m_flWjMinFactor = pInfo->m_MinRatio; //最小外径占道比例 + drawNrad->m_flWjMaxFactor = pInfo->m_MaxRatio;//最大外径占道比例 + drawNrad->m_nVertGrid = pInfo->m_nVertGrid; //纵向网格间隔 + drawNrad->m_nHorzGrid = pInfo->m_nHorzGrid;//井径曲线间网格 + drawNrad->m_nHorzStep = pInfo->m_nHorzStep;//旋转井径增量 + drawNrad->m_flVFactor = pInfo->m_flVFactor; //井柱椭圆纵横半径比 + drawNrad->m_nHorzLineWidth = pInfo->m_nHLineWidth; + drawNrad->m_crHorzLine = pInfo->m_HLineColor; + drawNrad->m_nVertLineWidth = pInfo->m_nVLineWidth; + drawNrad->m_crVertLine = pInfo->m_VLineColor; + + drawNrad->ReadData(m_strSlfName, strWaveName); + drawNrad->DrawNrad(m_strSlfName, strWaveName); + this->replot(); +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 14d2598..3b187ac 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -777,6 +777,9 @@ public: CPickFrac *m_cPickFrac; + //多臂井径 + void Draw_MCals(); + private: }; From 02bc42b903c65d0873897a86d64000c1e5d9b5b9 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Fri, 24 Apr 2026 11:52:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=9A=E8=87=82?= =?UTF-8?q?=E4=BA=95=E5=BE=84=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/DrawNrad.cpp | 6 ++ logPlus/PropertyWidget.cpp | 173 +++++++++++++++++++++++++++++++++++-- logPlus/PropertyWidget.h | 6 ++ logPlus/formdraw.cpp | 4 +- logPlus/forminfo.h | 8 +- logPlus/qmycustomplot.cpp | 48 ++++++++-- logPlus/qmycustomplot.h | 6 +- 8 files changed, 232 insertions(+), 22 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 0a4bd07..23d4e2e 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -275,6 +275,9 @@ signals: //改变井斜方位图属性 void sig_changeDenvProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //改变多臂井径属性 + void sig_changeMCalsProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/DrawNrad.cpp b/logPlus/DrawNrad.cpp index e0548cc..fa2669b 100644 --- a/logPlus/DrawNrad.cpp +++ b/logPlus/DrawNrad.cpp @@ -122,6 +122,12 @@ void CDrawNrad::DrawNrad(QString strSlfName, QString csCurve) // 初始化 int iMyWidth = m_myCustomPlot->axisRect(0)->width(); + + //重置范围 + float vmax = iMyWidth; + float vmin = 0; + m_myCustomPlot->yAxis->setRange(vmin, vmax); + centerX = (iMyWidth+0)/2.0; centerY = 0; nWidth = iMyWidth; diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 1f9343f..52ab853 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -2392,6 +2392,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant // changedDenvProperty(m_propertyData[pProperty], variant); } + else if (m_strCurrentProperty == MCals_Property)//多臂井径 + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + // + changedMCalsProperty(m_propertyData[pProperty], variant); + } } void PropertyWidget::SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle) @@ -3236,6 +3243,11 @@ void PropertyWidget::initProperty(FormInfo *formInfo) { //井斜方位图 this->initDenvProperty(formInfo); + } + else if (formInfo->m_strType == "MCalsObject") + { + //多臂井径 + this->initMCalsProperty(formInfo); } else if (formInfo->m_strType == "depthObject") { @@ -5236,7 +5248,7 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal) emit CallManage::getInstance()->sig_changeRoseProperty(variantMap); } } - +//蝌蚪图 void PropertyWidget::initKedouProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5278,7 +5290,7 @@ void PropertyWidget::initKedouProperty(FormInfo *formInfo) m_strCurrentProperty = Kedou_Property; } - +//蝌蚪图 void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5483,7 +5495,7 @@ void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) emit CallManage::getInstance()->sig_changeKedouProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName); } } - +//杆状图 void PropertyWidget::initGanzhuangProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5509,7 +5521,7 @@ void PropertyWidget::initGanzhuangProperty(FormInfo *formInfo) m_strCurrentProperty = Ganzhuang_Property; } - +//杆状图 void PropertyWidget::changedGanzhuangProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5584,7 +5596,7 @@ void PropertyWidget::changedGanzhuangProperty(QString strProperty, QVariant varV emit CallManage::getInstance()->sig_changeGanzhuangProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName); } } - +//井眼垮塌矢量图 void PropertyWidget::initJyktProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5609,7 +5621,7 @@ void PropertyWidget::initJyktProperty(FormInfo *formInfo) m_strCurrentProperty = Jykt_Property; } - +//井眼垮塌矢量图 void PropertyWidget::changedJyktProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5695,7 +5707,7 @@ void PropertyWidget::changedJyktProperty(QString strProperty, QVariant varVal) } } - +//井斜方位图 void PropertyWidget::initDenvProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5720,7 +5732,7 @@ void PropertyWidget::initDenvProperty(FormInfo *formInfo) m_strCurrentProperty = Denv_Property; } - +//井斜方位图 void PropertyWidget::changedDenvProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5800,3 +5812,148 @@ void PropertyWidget::changedDenvProperty(QString strProperty, QVariant varVal) emit CallManage::getInstance()->sig_changeDenvProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName); } } + +//多臂井径 +void PropertyWidget::initMCalsProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + + // + _CreateVariantPropertyItem("网格图", "最小井径", formInfo->m_MinVal, QVariant::Double); + _CreateVariantPropertyItem("网格图", "最大井径", formInfo->m_MaxVal, QVariant::Double); + _CreateVariantPropertyItem("网格图", "左边井径序号", formInfo->m_iStartArmPos, QVariant::Int); + _CreateVariantPropertyItem("网格图", "右边井径序号", formInfo->m_iEndArmPos, QVariant::Int); + _CreateVariantPropertyItem("网格图", "最小外径占道比例", formInfo->m_MinRatio, QVariant::Double); + _CreateVariantPropertyItem("网格图", "最大外径占道比例", formInfo->m_MaxRatio, QVariant::Double); + _CreateVariantPropertyItem("网格图", "纵向网格间隔", formInfo->m_nVertGrid, QVariant::Int); + _CreateVariantPropertyItem("网格图", "井径曲线间网格", formInfo->m_nHorzGrid, QVariant::Int); + _CreateVariantPropertyItem("网格图", "旋转井径增量", formInfo->m_nHorzStep, QVariant::Int); + _CreateVariantPropertyItem("网格图", "井柱椭圆纵横半径比", formInfo->m_flVFactor, QVariant::Double); + _CreateVariantPropertyItem("网格图", "横格线宽度", formInfo->m_nHLineWidth, QVariant::Int); + _CreateVariantPropertyItem("网格图", "横格线颜色", formInfo->m_HLineColor, QVariant::Color); + _CreateVariantPropertyItem("网格图", "纵格线宽度", formInfo->m_nVLineWidth, QVariant::Int); + _CreateVariantPropertyItem("网格图", "纵格线颜色", formInfo->m_VLineColor, QVariant::Color); + m_strCurrentProperty = MCals_Property; +} +//多臂井径 +void PropertyWidget::changedMCalsProperty(QString strProperty, QVariant varVal) +{ + bool flag = false; + + if("选择井曲线" == strProperty) + { + QString sFilePath = varVal.toString(); + if(sFilePath.indexOf("@")>-1) + { + int ind=sFilePath.indexOf("@"); + QString strLineName = sFilePath.left(ind); + sFilePath=sFilePath.mid(ind+1); + sFilePath.trimmed(); + { + QString strOldLineName = m_formInfo->m_strLineName; + QString strOldSlfName = m_formInfo->m_strSlfName; + //暂时不允许改变slf井次名称,不然不在同一口井绘制 + if(strOldSlfName != sFilePath) + { + QMessageBox::information(nullptr,"提示","不允许改变slf井次名称"); + return; + } + //名称不变 + if(strOldLineName == strLineName) + { + return; + } + if("" == strLineName) + { + return; + } + + // + m_formInfo->m_strLineName = strLineName; + //m_formInfo->m_strSlfName = sFilePath; + m_formInfo->update(); + //flag = true; + //此处需要使用strOldLineName + emit CallManage::getInstance()->sig_changeMCalsProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, strOldLineName, strLineName); + return; + } + } + } + // 网格图 + else if ("最小井径" == strProperty) + { + this->m_formInfo->m_MinVal = varVal.toDouble(); + flag = true; + } + else if ("最大井径" == strProperty) + { + this->m_formInfo->m_MaxVal = varVal.toDouble(); + flag = true; + } + else if ("左边井径序号" == strProperty) + { + this->m_formInfo->m_iStartArmPos = varVal.toInt(); + flag = true; + } + else if ("右边井径序号" == strProperty) + { + this->m_formInfo->m_iEndArmPos = varVal.toInt(); + flag = true; + } + else if ("最小外径占道比例" == strProperty) + { + this->m_formInfo->m_MinRatio = varVal.toDouble(); + flag = true; + } + else if ("最大外径占道比例" == strProperty) + { + this->m_formInfo->m_MaxRatio = varVal.toDouble(); + flag = true; + } + else if ("纵向网格间隔" == strProperty) + { + this->m_formInfo->m_nVertGrid = varVal.toInt(); + flag = true; + } + else if ("井径曲线间网格" == strProperty) + { + this->m_formInfo->m_nHorzGrid = varVal.toInt(); + flag = true; + } + else if ("旋转井径增量" == strProperty) + { + this->m_formInfo->m_nHorzStep = varVal.toInt(); + flag = true; + } + else if ("井柱椭圆纵横半径比" == strProperty) + { + this->m_formInfo->m_flVFactor = varVal.toDouble(); + flag = true; + } + else if ("横格线宽度" == strProperty) + { + this->m_formInfo->m_nHLineWidth = varVal.toInt(); + flag = true; + } + else if ("横格线颜色" == strProperty) + { + this->m_formInfo->m_HLineColor = varVal.value(); + flag = true; + } + else if ("纵格线宽度" == strProperty) + { + this->m_formInfo->m_nVLineWidth = varVal.toInt(); + flag = true; + } + else if ("纵格线颜色" == strProperty) + { + this->m_formInfo->m_VLineColor = varVal.value(); + flag = true; + } + + if(flag) + { + emit CallManage::getInstance()->sig_changeMCalsProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_formInfo->m_strLineName); + } +} diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 85daec9..29951f4 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -82,6 +82,8 @@ #define Jykt_Property "Jykt_Property" //井眼垮塌矢量图 #define Denv_Property "Denv_Property" //井斜方位图 +#define MCals_Property "MCals_Property" //多臂井径 + #pragma execution_character_set("utf-8") /** @@ -277,6 +279,10 @@ public: void initDenvProperty(FormInfo *formInfo); void changedDenvProperty(QString strProName, QVariant val); + //多臂井径 + void initMCalsProperty(FormInfo *formInfo); + void changedMCalsProperty(QString strProName, QVariant val); + public slots: void SlotPropertyChanged(QtProperty *property, const QVariant &variant); void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index fc8808d..1498e29 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -3415,7 +3415,7 @@ void FormDraw::s_mouseWheel(QWheelEvent *event) void FormDraw::setColWidth(float fNewWidth) { m_nTrackW = fNewWidth; - fNewWidth = fNewWidth * g_dPixelPerCm; + //fNewWidth = fNewWidth * g_dPixelPerCm; // 获取当前widget的所有子控件 const QObjectList &children = this->children(); //判断为空 @@ -4438,7 +4438,7 @@ void FormDraw::initMCals(QMyCustomPlot *widget, QString strSlfName, QString strL FormInfo* pInfo = m_formTrack->AddMCals(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "MCalsObject", listOtherProperty); //多臂井径 - widget->Draw_MCals(); + widget->Draw_MCals(strLineName, strLineName); } //套管组件 diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index d1bc948..1c13555 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -404,10 +404,10 @@ public: int m_nHorzGrid = 0; //井径曲线间网格 int m_nHorzStep = 5; //旋转井径增量 float m_flVFactor = 0.8; //井柱椭圆纵横半径比 - int m_nHLineWidth =1; - QColor m_HLineColor = QColor(0,0,0); - int m_nVLineWidth =1; - QColor m_VLineColor = QColor(0,0,0); + int m_nHLineWidth =1; //横格线宽度 + QColor m_HLineColor = QColor(0,0,0);//横格线颜色 + int m_nVLineWidth =1; //纵格线宽度 + QColor m_VLineColor = QColor(0,0,0);//纵格线颜色 public: void setLineWidth(double dWidth); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 695b1ce..5498ccd 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -222,6 +222,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeJyktProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeJyktProperty(QString, QString, QString, QString, QString))); //改变井斜方位图属性 connect(CallManage::getInstance(), SIGNAL(sig_changeDenvProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeDenvProperty(QString, QString, QString, QString, QString))); + //改变多臂井径属性 + connect(CallManage::getInstance(), SIGNAL(sig_changeMCalsProperty(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeMCalsProperty(QString, QString, QString, QString, QString, QString))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, double fW) @@ -10720,6 +10722,19 @@ void QMyCustomPlot::resetPosition() //地质层位 resetPosition_Layer(); + // + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + + if(pInfo->m_strType == "MCalsObject") + { + //多臂井径 + Draw_MCals(m_strLineName, m_strLineName); + return; + } //刷新 replot(); } @@ -12797,21 +12812,40 @@ void QMyCustomPlot::Draw_Denv() this->replot(); } -//多臂井径 -void QMyCustomPlot::Draw_MCals() +//改变多臂井径属性 +void QMyCustomPlot::s_changeMCalsProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName) { - //this->clearGraphs(); + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + //绘制多臂井径 + Draw_MCals(strLineName, strNewLineName); +} + +//多臂井径 +void QMyCustomPlot::Draw_MCals(QString strLineName, QString strNewLineName) +{ + this->clearGraphs(); this->clearItems(); // - FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, strNewLineName); if (pInfo == NULL) { return; } //多臂井径 - QString strWaveName = "FCA2"; + m_strLineName = pInfo->m_strLineName; //"FCA2"; CDrawNrad *drawNrad = new CDrawNrad(this); //属性 drawNrad->m_LeftVal = pInfo->m_MinVal;//最小井径 @@ -12829,7 +12863,7 @@ void QMyCustomPlot::Draw_MCals() drawNrad->m_nVertLineWidth = pInfo->m_nVLineWidth; drawNrad->m_crVertLine = pInfo->m_VLineColor; - drawNrad->ReadData(m_strSlfName, strWaveName); - drawNrad->DrawNrad(m_strSlfName, strWaveName); + drawNrad->ReadData(m_strSlfName, m_strLineName); + drawNrad->DrawNrad(m_strSlfName, m_strLineName); this->replot(); } diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 3b187ac..ce40e2a 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -688,6 +688,10 @@ public slots: //改变井斜方位图属性 void s_changeDenvProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //改变多臂井径属性 + void s_changeMCalsProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName); + + public: //蝌蚪图重绘网格线 bool mKedou = false; @@ -778,7 +782,7 @@ public: CPickFrac *m_cPickFrac; //多臂井径 - void Draw_MCals(); + void Draw_MCals(QString strLineName, QString strNewLineName); private: From 52986a8ef0fb1990b0d387dafce7a14e3bf06d20 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Fri, 24 Apr 2026 15:01:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=EF=BC=8C=E6=94=AF=E6=8C=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=A4=9A=E8=87=82=E4=BA=95=E5=BE=84=E3=80=81=E6=9D=86=E7=8A=B6?= =?UTF-8?q?=E5=9B=BE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/forminfo.cpp | 17 ++++++++++++++++- logPlus/forminfo.h | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index b4e6a17..cfe5b56 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -395,7 +395,7 @@ void FormInfo::initProperty_MCals(QJsonObject obj) { m_MinVal = 30;//最小井径 m_MaxVal = 65;//最大井径 - m_iStartArmPos = 0; //左边井径序号 + m_iStartArmPos = 1; //左边井径序号 m_iEndArmPos = 20;//右边井径序号 m_MinRatio = 0.5; //最小外径占道比例 m_MaxRatio = 0.6;//最大外径占道比例 @@ -2706,6 +2706,21 @@ void FormInfo::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteTable); menu.exec(event->globalPos()); } + else if(m_strType=="ganzhuangtuObject" || m_strType=="JyktObject" ||m_strType=="DenvObject") + { + //杆状图、井眼垮塌矢量图、井斜方位图 + QMenu menu(this); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteTable); + menu.exec(event->globalPos()); + } + else if(m_strType=="MCalsObject") + { + //多臂井径 + QMenu menu(this); + menu.addAction(QIcon(::GetImagePath() + "icon/Sheet.png"), "数据对象查看", this, &FormInfo::onShowWave); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteWave); + menu.exec(event->globalPos()); + } } //曲线数据查看 diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 1c13555..095c5cf 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -396,7 +396,7 @@ public: //多臂井径 float m_MinVal = 30; //最小井径 float m_MaxVal = 65; //最大井径 - int m_iStartArmPos = 0; //左边井径序号 + int m_iStartArmPos = 1; //左边井径序号 int m_iEndArmPos = 20; //右边井径序号 float m_MinRatio = 0.5; //最小外径占道比例 float m_MaxRatio = 0.6; //最大外径占道比例