From 58fc7492343a4e688b9164de8929e8f7228c49c8 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Tue, 21 Apr 2026 17:05:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=9D=8C=E8=9A=AA=E5=9B=BE=E5=B1=9E=E6=80=A7=EF=BC=8C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95json=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 2 + logPlus/PropertyWidget.cpp | 47 ++------ logPlus/formdraw.cpp | 237 +++++++++++++++++++++++++++---------- logPlus/formdraw.h | 25 ++-- logPlus/forminfo.cpp | 164 +++++++++++++++++++++++++ logPlus/forminfo.h | 15 ++- logPlus/formtrack.cpp | 37 ++++++ logPlus/formtrack.h | 1 + logPlus/qmycustomplot.cpp | 120 +++++++++++++------ logPlus/qmycustomplot.h | 4 +- 10 files changed, 503 insertions(+), 149 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 71d6f3c..995c63c 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -256,6 +256,8 @@ signals: //改变套管组件属性,直径 void sig_changeGuanD(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, double newD); + //改变蝌蚪图属性 + void sig_changeKedouProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 7acbe2a..fc10e6c 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -79,7 +79,16 @@ void PropertyWidget::InitCurrentViewInfo(bool bAll) m_formHead = NULL; m_tableWidget = NULL; m_item = NULL; + // m_tdGujing = NULL; + m_tdImage = NULL; + m_tdSwallCore = NULL; + m_tdGeoLith = NULL; + m_tdText = NULL; + m_tdLayer = NULL; + m_tdJiegutext = NULL; + m_tdGuan = NULL; + m_tdCorePhysics = NULL; // m_strUuid = ""; m_strTrackUuid = ""; @@ -5417,42 +5426,6 @@ void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) if(flag) { - QVariantMap variantMap; - // 必须用来判断当前道 - variantMap["m_strTrackName"] = this->m_formInfo->m_strTrackName; - // 数据 - variantMap["m_pl_dataType"] = this->m_formInfo->m_pl_dataType; - variantMap["m_pl_azimuthCurve"] = this->m_formInfo->m_pl_azimuthCurve; - variantMap["m_pl_inclinationCurve"] = this->m_formInfo->m_pl_inclinationCurve; - // 表数据 - variantMap["m_rose_depth_field"] = this->m_formInfo->m_rose_depth_field; - variantMap["m_rose_azimuth_field"] = this->m_formInfo->m_rose_azimuth_field; - variantMap["m_rose_dip_field"] = this->m_formInfo->m_rose_dip_field; - variantMap["m_rose_attribute_field"] = this->m_formInfo->m_rose_attribute_field; - // 控制曲线 - variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName; - variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue; - variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue; - // 字体 - variantMap["m_pl_fontScale"] = this->m_formInfo->m_pl_fontScale; - // 蝌蚪图 - variantMap["m_rose_sector_enabled"] = this->m_formInfo->m_rose_sector_enabled; - variantMap["m_rose_circle_radius_cm"] = this->m_formInfo->m_rose_circle_radius_cm; - variantMap["m_rose_radiation_circle_enabled"] = this->m_formInfo->m_rose_radiation_circle_enabled; - variantMap["m_rose_azimuth_print_interval"] = this->m_formInfo->m_rose_azimuth_print_interval; - variantMap["m_rose_circle_line_color"] = this->m_formInfo->m_rose_circle_line_color; - variantMap["m_rose_circle_line_width"] = this->m_formInfo->m_rose_circle_line_width; - variantMap["m_rose_stress_line_color"] = this->m_formInfo->m_rose_stress_line_color; - variantMap["m_rose_collapse_line_color"] = this->m_formInfo->m_rose_collapse_line_color; - variantMap["m_rose_draw_radiation_line"] = this->m_formInfo->m_rose_draw_radiation_line; - variantMap["m_rose_draw_wellbore_collapse"] = this->m_formInfo->m_rose_draw_wellbore_collapse; - variantMap["m_rose_fill_enabled"] = this->m_formInfo->m_rose_fill_enabled; - variantMap["m_rose_draw_annotation"] = this->m_formInfo->m_rose_draw_annotation; - // - variantMap["m_pl_minInclination"] = this->m_formInfo->m_pl_minInclination; - variantMap["m_pl_maxInclination"] = this->m_formInfo->m_pl_maxInclination; - - variantMap["m_strUuid"] = this->m_formInfo->m_strUuid; - //emit CallManage::getInstance()->sig_changeRoseProperty(variantMap); + 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); } } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index a35e309..e1bac3b 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -536,6 +536,11 @@ void FormDraw::DisplayLines(QJsonArray linesArray) // 岩心照片 displayImageData(lineObjInfo); } + else if (strLineName == "FRAC_HOLE.TABLE") + { + // 蝌蚪图 + DisplayKedou_One(lineObjInfo); + } } else if (strType == "JiegutextObject") { @@ -1121,6 +1126,85 @@ void FormDraw::DisplayTable_One(QJsonObject lineObjInfo) } } +//蝌蚪图 +void FormDraw::DisplayKedou_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 != "") + { + /* + QVariantMap variantMap; + // 数据 + variantMap["AliasName"] = strAliasName; + variantMap["curveNameFont"] = curveNameFont;*/ + + //结论 + this->addKedou(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, lineObjInfo); + } +} + //气测/FMT/射孔/文本 void FormDraw::DisplayJiegutext_One(QJsonObject lineObjInfo) { @@ -2807,7 +2891,7 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri return NULL; } - if (m_listTableName.contains(strLineName)) + if (m_listLineName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; return NULL; @@ -2942,7 +3026,75 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri } connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // - m_listTableName.push_back(strLineName); + m_listLineName.push_back(strLineName); + return curv; +} + +QMyCustomPlot* FormDraw::addKedou(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QJsonObject listOtherProperty) +{ + if (strLineName == "FRAC_HOLE.TABLE" || strLineName == "WORDS_RELUST" || strLineName == "RESULT" + || strLineName == "GEO_LITH" || strLineName == "SWALL_CORE" + || strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT" + || strLineName == "CORE_PHYSICS" || strLineName == "IMAGE_DATA" + || strLineName == "LAYER_DATA" ) + { + + } + else + { + return NULL; + } + //井名&道名不一致 + 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(); + + if (strLineName == "FRAC_HOLE.TABLE") + { + //蝌蚪图 + curv->mKedou = true; + //隐藏网格 + curv->xAxis->grid()->setVisible(false); + curv->yAxis->grid()->setVisible(false); + // + curv->m_bRowGridVisible = false; + curv->m_bColGridVisible = false; + + QString strAliasName = "蝌蚪图"; + QColor newlineColor=QColor(0,0,0); + // 显示名称 + // 显示名称 + if (listOtherProperty.contains("AliasName")) + { + QJsonValue value = listOtherProperty.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + } + } + // + initKedou(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty); + } + connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); + // + m_listLineName.push_back(strLineName); return curv; } @@ -3032,7 +3184,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam return; } - if(m_listWaveName.contains(strWaveName)) + if(m_listLineName.contains(strWaveName)) { qDebug() << "FormDraw strLineName already exist! " << strWaveName; return; @@ -3085,7 +3237,7 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam emit CallManage::getInstance()->sig_ReplotFinished(m_strUuid); }); // - m_listWaveName.push_back(strWaveName); + m_listLineName.push_back(strWaveName); QString strAliasName = ""; QString strUnit = "mv"; @@ -3263,7 +3415,7 @@ void FormDraw::s_delWave(QString strUuid, QString strWellName, QString strTrackN } qDebug() << "FormDraw s_delWave"; - if(m_listWaveName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { } else @@ -3288,7 +3440,7 @@ void FormDraw::s_delWave(QString strUuid, QString strWellName, QString strTrackN if(form->m_strLineName == strLineName) { childWidget->deleteLater(); // 安排控件的删除,稍后执行 - m_listWaveName.removeOne(strLineName); + m_listLineName.removeOne(strLineName); //属性清空 PropertyService()->InitCurrentViewInfo(); @@ -3314,7 +3466,7 @@ void FormDraw::s_delTableLine(QString strUuid, QString strWellName, QString strT } qDebug() << "FormDraw s_delTableLine"; - if(m_listTableName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { } else @@ -3339,7 +3491,7 @@ void FormDraw::s_delTableLine(QString strUuid, QString strWellName, QString strT if(form->m_strLineName == strLineName) { childWidget->deleteLater(); // 安排控件的删除,稍后执行 - m_listTableName.removeOne(strLineName); + m_listLineName.removeOne(strLineName); //属性清空 PropertyService()->InitCurrentViewInfo(); @@ -3597,10 +3749,7 @@ void FormDraw::s_addGanZuangTu(QString strUuid, QString strSlfName, QString strW m_Value=NULL; m_Value2=NULL; m_Value3=NULL; - //m_csUnit = "(°)"; m_bTableData=0;//表格或曲线 - m_LeftVal2=0; - m_RightVal2=360; //m_csCurveDDIR="DDIR"; //m_csCurveDANG="DANG"; //m_csCurveGrad="GRAD"; @@ -3834,7 +3983,7 @@ FormLine* FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QStrin return NULL; } - if(m_listTableName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; return NULL; @@ -3868,7 +4017,7 @@ FormLine* FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QStrin // connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // - m_listTableName.push_back(strLineName); + m_listLineName.push_back(strLineName); QString strAliasName = "斜井三图一表"; QString strUnit = ""; @@ -3894,7 +4043,7 @@ void FormDraw::s_addCrack(QString strUuid, QString strSlfName, QString strWellNa return; } - if(m_listTableName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; return; @@ -3939,7 +4088,7 @@ void FormDraw::s_addCrack(QString strUuid, QString strSlfName, QString strWellNa connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // - m_listTableName.push_back(strLineName); + m_listLineName.push_back(strLineName); QString strAliasName = "裂缝描述"; QString strUnit = ""; @@ -3962,7 +4111,7 @@ void FormDraw::s_addJiegutext(QString strUuid, QString strSlfName, QString strWe return; } - if(m_listTableName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; return; @@ -4037,7 +4186,7 @@ void FormDraw::s_addJiegutext(QString strUuid, QString strSlfName, QString strWe connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // - m_listTableName.push_back(strLineName); + m_listLineName.push_back(strLineName); QString strUnit = ""; double width=2; @@ -4067,7 +4216,7 @@ void FormDraw::s_addLogface(QString strUuid, QString strSlfName, QString strWell return; } - if(m_listTableName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; return; @@ -4140,7 +4289,7 @@ void FormDraw::s_addLogface(QString strUuid, QString strSlfName, QString strWell connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // - m_listTableName.push_back(strLineName); + m_listLineName.push_back(strLineName); QString strAliasName = "沉积相"; QColor newlineColor=QColor(0,0,0); @@ -4234,7 +4383,7 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st return; } - if(m_listTableName.contains(strLineName)) + if(m_listLineName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; return; @@ -4353,7 +4502,7 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // - m_listTableName.push_back(strLineName); + m_listLineName.push_back(strLineName); QString strAliasName = "套管组件"; QColor newlineColor=QColor(0,0,0); @@ -5004,8 +5153,8 @@ void FormDraw::DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, //widget->rescaleAxes(); } -//表格曲线 -void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty) +//蝌蚪图 +void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QJsonObject listOtherProperty) { int iMyWidth = widget->axisRect(0)->width(); float vmax = iMyWidth; @@ -5023,7 +5172,6 @@ void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strL widget->xAxis = yAxis; widget->yAxis = xAxis; - m_LeftVal = 0; m_RightVal = 90; //隐藏刻度 @@ -5037,43 +5185,15 @@ void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strL widget->yAxis2->setVisible(false); //----------------------------------- - widget->m_Value=NULL; - widget->m_Value2=NULL; - widget->m_Value3=NULL; - //m_csUnit = "(°)"; - widget->m_bTableData=0;//表格或曲线 - widget->m_LeftVal2=0; - widget->m_RightVal2=360; - widget->m_csCurveDDIR = "DDIR"; // 方位 曲线名 - widget->m_csCurveDANG = "DANG";//倾角 - widget->m_csCurveGrad = "GRAD"; - widget->m_nTailWidth=2; - widget->m_crTail=qRgb(0,0,0); - widget->m_crPointFill=qRgb(0,0,0); - // - widget->m_crGridSmall=qRgb(100,100,100); - widget->m_nRadius = 6; - widget->m_nTailLen = 10; - widget->m_nCircleWidth=1; - widget->m_flGrad1 = 10; //可信度 - widget->m_flGrad2 = 50; - //Table dip - widget->m_qsTable="FRAC_HOLE.TABLE"; - widget->m_qsDIR=("DIR"); // 方位 曲线名 - widget->m_qsDIP=("DIPorS");//倾角 - widget->m_qsDepth="DEP"; - widget->m_qsID = "ID"; - widget->m_qsProperty=("ID"); - widget->m_iPrecision = 3; - //蝌蚪图 - widget->Draw_Kedou(); - - //------ QString strUnit = ""; double width=2; QString strScaleType = ""; //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject"); + FormInfo* pInfo = m_formTrack->AddKedou(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty); + + //蝌蚪图 + widget->Draw_Kedou(); + } @@ -6576,9 +6696,6 @@ void FormDraw::DrawJykt(QMyCustomPlot *widget, QString strSlfName) void FormDraw::DrawDenv(QMyCustomPlot *widget, QString strSlfName) { //初始化数据 - m_LeftVal2=0; - m_RightVal2=90; - m_csCurveAZIM=("AZIM"); m_csCurveDEVI=("DEVI"); diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index cbd6bf0..0bba313 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -46,6 +46,8 @@ public: //表格:固井结论等 void DisplayTable_One(QJsonObject lineObjInfo); + //蝌蚪图 + void DisplayKedou_One(QJsonObject lineObjInfo); //气测/FMT/射孔/文本 void DisplayJiegutext_One(QJsonObject lineObjInfo); @@ -89,6 +91,9 @@ protected: QMyCustomPlot* addTableLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QStringList listOtherProperty={}); + QMyCustomPlot* addKedou(QString strUuid, QString strSlfName, QString strWellName, + QString strTrackName, QString strLineName, QJsonObject listOtherProperty={}); + public slots: void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent* event); @@ -121,8 +126,6 @@ public: FormTrack *m_formTrack = NULL; QStringList m_listLineName; - QStringList m_listWaveName; - QStringList m_listTableName; BorderFlags m_BorderFlags; @@ -146,7 +149,7 @@ public: void DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, QString &strWaveName, int &_nSamples); //表格曲线 - void initKedou(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "蝌蚪图", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={}); + void initKedou(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);//曲线 @@ -161,20 +164,14 @@ public: int FracNum; float *m_pflTab_Frac; bool m_bFracIsOK; - //CString m_csUnit; // Slf_CURVE m_Curve,m_Curve2,m_Curve3; - char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL; - // 以下变量需保存在模板里 - // 绘制时,方位/倾角/可信度曲线的深度、采样间隔应该一致 - //CString m_csCurveDDIR,m_csCurveDANG,m_csCurveGrad; // 方位/倾角/可信度 曲线名 - float m_LeftVal2,m_RightVal2; - float m_flGrad1,m_flGrad2; // 可信度 - int m_bTableData = 0;//表格或曲线 - QRectF m_Rect; + char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL; + float m_flGrad1,m_flGrad2; // 可信度 + int m_bTableData = 0; //表格或曲线 float m_nRadius,m_nCircleWidth; // 半径,圆线宽度 - float m_nTailWidth,m_nTailLen; // 尾宽度、尾长 - float m_nSltk; // 杆状图长度 + float m_nTailWidth,m_nTailLen; // 尾宽度、尾长 + float m_nSltk; // 杆状图长度 QColor m_crPointFill,m_crTail,m_crCircle; QColor m_crGridSmall; //TabDip diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 092ea88..43679c8 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -98,6 +98,120 @@ FormInfo::~FormInfo() delete ui; } +void FormInfo::initProperty_Kedou(QJsonObject obj) +{ + if(obj.isEmpty()) + { + // 字体 + + // 数据类型选择 + this->m_pl_dataType = 0; // 数据类型 + + // 曲线选择 + this->m_pl_azimuthCurve = "DDIR"; // 方位曲线 + this->m_pl_inclinationCurve = "DANG"; // 倾角曲线 + this->m_pl_GradCurve = "GRAD"; // 可信度曲线 + + // 表数据字段 + this->m_rose_depth_field = "DEPT"; // 深度字段 + this->m_rose_azimuth_field = "DDIR"; // 方位字段 + this->m_rose_dip_field = "DANG"; // 倾角字段 + this->m_rose_attribute_field = "ID"; // 属性字段 + + //蝌蚪符号 + this->m_nRadius = 6; // 圆半径 + this->m_nCircleWidth = 1; // 圆线宽度 + this->m_nTailLen = 10; // 尾线长度 + this->m_nTailWidth = 2; // 尾线宽度 + + // 显示控制 + this->m_pl_minInclination = 0; // 最小倾角 + this->m_pl_maxInclination = 360; // 最大倾角 + this->m_flGrad1 = 10; // 可信度1 + this->m_flGrad2 = 50; // 可信度2 + // 显示控制(数据表) + this->m_crack_decimal_digits = 2; // 小数位数 + + // 分类 + this->m_pl_highGap = false; // 高导缝 + this->m_pl_highReservoir = false; // 高阻缝 + this->m_pl_reticularFracture = false; // 网状缝 + this->m_pl_inducedFracture = false; // 诱导缝 + this->m_pl_bedLayer = false; // 层理 + this->m_pl_erosionSurface = false; // 侵蚀面 + this->m_pl_pore = false; // 孔洞 + this->m_pl_vesicle = false; // 气孔 + this->m_pl_gravel = false; // 砾石 + this->m_pl_nodule = false; // 结核 + this->m_pl_lumps = false; // 团块 + this->m_pl_fault = false; // 断层 + this->m_pl_verticalFracture = false; // 垂直缝 + this->m_pl_custom1 = false; // 自定义1 + this->m_pl_custom2 = false; // 自定义2 + } + else + { + QString strType = obj.value("Type").toString(); + if ("tableObject" == 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()); + + // 数据类型选择 + this->m_pl_dataType = obj["m_pl_dataType"].toInt(); // 数据类型 + + // 曲线选择 + this->m_pl_azimuthCurve = obj["m_pl_azimuthCurve"].toString(); // 方位曲线 + this->m_pl_inclinationCurve = obj["m_pl_inclinationCurve"].toString(); // 倾角曲线 + this->m_pl_GradCurve = obj["m_pl_GradCurve"].toString(); // 可信度曲线 + + // 表数据字段 + this->m_rose_depth_field = obj["m_rose_depth_field"].toString(); // 深度字段 + this->m_rose_azimuth_field = obj["m_rose_azimuth_field"].toString(); // 方位字段 + this->m_rose_dip_field = obj["m_rose_dip_field"].toString(); // 倾角字段 + this->m_rose_attribute_field = obj["m_rose_attribute_field"].toString(); // 属性字段 + + //蝌蚪符号 + this->m_nRadius = obj["m_nRadius"].toDouble(); // 圆半径 + this->m_nCircleWidth = obj["m_nCircleWidth"].toDouble();// 圆线宽度 + this->m_nTailLen = obj["m_nTailLen"].toDouble(); // 尾线长度 + this->m_nTailWidth = obj["m_nTailWidth"].toDouble(); // 尾线宽度 + this->m_crCircle.setNamedColor(obj["m_crCircle"].toString());// 圆线颜色 + this->m_crTail.setNamedColor(obj["m_crTail"].toString());// 尾线颜色 + + // 显示控制 + this->m_pl_minInclination = obj["m_pl_minInclination"].toDouble(); // 最小倾角 + this->m_pl_maxInclination = obj["m_pl_maxInclination"].toDouble(); // 最大倾角 + this->m_flGrad1 = obj["m_flGrad1"].toDouble(); // 可信度1 + this->m_flGrad2 = obj["m_flGrad2"].toDouble(); // 可信度2 + // 显示控制(数据表) + this->m_crack_decimal_digits = obj["m_crack_decimal_digits"].toInt(); // 小数位数 + + // 分类 + this->m_pl_highGap = obj["m_pl_highGap"].toBool(); // 高导缝 + this->m_pl_highReservoir = obj["m_pl_highReservoir"].toBool(); // 高阻缝 + this->m_pl_reticularFracture = obj["m_pl_reticularFracture"].toBool(); // 网状缝 + this->m_pl_inducedFracture = obj["m_pl_inducedFracture"].toBool(); // 诱导缝 + this->m_pl_bedLayer = obj["m_pl_bedLayer"].toBool(); // 层理 + this->m_pl_erosionSurface = obj["m_pl_erosionSurface"].toBool(); // 侵蚀面 + this->m_pl_pore = obj["m_pl_pore"].toBool(); // 孔洞 + this->m_pl_vesicle = obj["m_pl_vesicle"].toBool(); // 气孔 + this->m_pl_gravel = obj["m_pl_gravel"].toBool(); // 砾石 + this->m_pl_nodule = obj["m_pl_nodule"].toBool(); // 结核 + this->m_pl_lumps = obj["m_pl_lumps"].toBool(); // 团块 + this->m_pl_fault = obj["m_pl_fault"].toBool(); // 断层 + this->m_pl_verticalFracture = obj["m_pl_verticalFracture"].toBool(); // 垂直缝 + this->m_pl_custom1 = obj["m_pl_custom1"].toBool(); // 自定义1 + this->m_pl_custom2 = obj["m_pl_custom2"].toBool(); // 自定义2 + } + } +} + void FormInfo::initProperty(QJsonObject obj) { m_vmin = obj.value("vmin").toDouble(); @@ -366,6 +480,56 @@ QJsonObject FormInfo::makeJson() //item属性写入slf文件,不需要此次记录 return rootObj; } + else if (m_strLineName == "FRAC_HOLE.TABLE") + { + //蝌蚪图 + // 字体 + //rootObj["m_strAliasNameFont"] = this->m_strAliasNameFont.toString(); // 名称 + rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 + rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 + // 数据类型选择 + rootObj["m_pl_dataType"] = this->m_pl_dataType; // 数据类型 + // 曲线选择 + 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_rose_depth_field"] = this->m_rose_depth_field; // 深度字段 + rootObj["m_rose_azimuth_field"] = this->m_rose_azimuth_field; // 方位字段 + rootObj["m_rose_dip_field"] = this->m_rose_dip_field; // 倾角字段 + rootObj["m_rose_attribute_field"] = this->m_rose_attribute_field; // 属性字段 + //蝌蚪符号 + 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_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["m_crack_decimal_digits"] = this->m_crack_decimal_digits; // 小数位数 + // 分类 + rootObj["m_pl_highGap"] = this->m_pl_highGap; // 高导缝 + rootObj["m_pl_highReservoir"] = this->m_pl_highReservoir; // 高阻缝 + rootObj["m_pl_reticularFracture"] = this->m_pl_reticularFracture; // 网状缝 + rootObj["m_pl_inducedFracture"] = this->m_pl_inducedFracture; // 诱导缝 + rootObj["m_pl_bedLayer"] = this->m_pl_bedLayer; // 层理 + rootObj["m_pl_erosionSurface"] = this->m_pl_erosionSurface; // 侵蚀面 + rootObj["m_pl_pore"] = this->m_pl_pore; // 孔洞 + rootObj["m_pl_vesicle"] = this->m_pl_vesicle; // 气孔 + rootObj["m_pl_gravel"] = this->m_pl_gravel; // 砾石 + rootObj["m_pl_nodule"] = this->m_pl_nodule; // 结核 + rootObj["m_pl_lumps"] = this->m_pl_lumps; // 团块 + rootObj["m_pl_fault"] = this->m_pl_fault; // 断层 + rootObj["m_pl_verticalFracture"] = this->m_pl_verticalFracture; // 垂直缝 + rootObj["m_pl_custom1"] = this->m_pl_custom1; // 自定义1 + rootObj["m_pl_custom2"] = this->m_pl_custom2; // 自定义2 + return rootObj; + } } else if (m_strType == "JiegutextObject") { diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 052e9d6..ffdd2b3 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -26,6 +26,7 @@ public: ~FormInfo(); void initProperty(QJsonObject obj); + void initProperty_Kedou(QJsonObject obj); void paintClassify(QPainter &painter, int compassCenterY); private: @@ -364,10 +365,16 @@ public: //蝌蚪图 QString m_pl_GradCurve = "GRAD"; // 可信度曲线 - float m_flGrad1,m_flGrad2; // 可信度 - float m_nRadius,m_nCircleWidth; // 半径,圆线宽度 - float m_nTailWidth,m_nTailLen; // 尾宽度、尾长 - QColor m_crTail,m_crCircle;//颜色 + float m_flGrad1 = 10; // 可信度 + float m_flGrad2 = 50; // 可信度 + float m_nRadius = 6; // 半径 + float m_nCircleWidth = 2; // 圆线宽度 + float m_nTailWidth = 2; // 尾宽度 + float m_nTailLen = 10; // 尾长 + QColor m_crCircle = qRgb(0,0,0); //颜色 + QColor m_crTail = qRgb(0,0,0); //颜色 + QColor m_crPointFill = qRgb(0,0,0); + public: void setLineWidth(double dWidth); double getLineWidth(); diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 5b67e0e..6b99167 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -312,6 +312,43 @@ void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackNam } } +FormInfo* FormTrack::AddKedou(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) +{ + if(strLineName == "FRAC_HOLE.TABLE") + { + + } + else + { + return nullptr; + } + + qDebug() << "FormTrack AddKedou"; + + 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_Kedou(listOtherProperty); + formInfo->m_strAliasName = strAliasName; + formInfo->m_strUnit = strUnit; + formInfo->m_strScaleType = strScaleType; + formInfo->m_strType = "tableObject"; + 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); +} + FormInfo* FormTrack::setDrawDt(QStringList listdt, QJsonObject obj) { QString strWellName = listdt.at(1); diff --git a/logPlus/formtrack.h b/logPlus/formtrack.h index 9ae8d81..5bc18f1 100644 --- a/logPlus/formtrack.h +++ b/logPlus/formtrack.h @@ -44,6 +44,7 @@ public: 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* AddKedou(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/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index b87adb3..a14ebc7 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -213,6 +213,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeGuanShow(QString, QString, QString, QString, QString, QString, bool)), this, SLOT(s_changeGuanShow(QString, QString, QString, QString, QString, QString, bool))); //改变套管组件属性,直径 connect(CallManage::getInstance(), SIGNAL(sig_changeGuanD(QString, QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGuanD(QString, QString, QString, QString, QString, QString, double))); + //改变蝌蚪图属性 + connect(CallManage::getInstance(), SIGNAL(sig_changeKedouProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeKedouProperty(QString, QString, QString, QString, QString))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, double fW) @@ -11789,7 +11791,48 @@ void QMyCustomPlot::vertScrollBarChanged(QString strUuid, int value) } void QMyCustomPlot::Draw_Kedou() -{ +{ + //this->clearGraphs(); + this->clearItems(); + + // + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + + //----------------------------------- + this->m_Value=NULL; + this->m_Value2=NULL; + this->m_Value3=NULL; + this->m_bTableData = pInfo->m_pl_dataType;//曲线//表格 + // 曲线选择 + this->m_csCurveDDIR = pInfo->m_pl_azimuthCurve; // 方位 曲线名 + this->m_csCurveDANG = pInfo->m_pl_inclinationCurve;//倾角 + this->m_csCurveGrad = pInfo->m_pl_GradCurve; // 可信度曲线 + //字段选择(数据表) + this->m_qsDepth = pInfo->m_rose_depth_field; // 深度字段 + this->m_qsDIR = pInfo->m_rose_azimuth_field; // 方位字段 + this->m_qsDIP = pInfo->m_rose_dip_field; // 倾角字段 + this->m_qsID = this->m_qsProperty = pInfo->m_rose_attribute_field; // 属性字段 + //蝌蚪符号 + this->m_nRadius = pInfo->m_nRadius; // 圆半径 + this->m_nCircleWidth = pInfo->m_nCircleWidth; // 圆线宽度 + this->m_nTailLen = pInfo->m_nTailLen; // 尾线长度 + this->m_nTailWidth = pInfo->m_nTailWidth; // 尾线宽度 + this->m_crCircle = pInfo->m_crCircle; // 圆线颜色 + this->m_crTail = pInfo->m_crTail; // 尾线颜色 + this->m_crPointFill=this->m_crCircle; + // + this->m_crGridSmall=qRgb(100,100,100); + + this->m_flGrad1 = pInfo->m_flGrad1; //可信度 + this->m_flGrad2 = pInfo->m_flGrad2; + //Table dip + this->m_qsTable="FRAC_HOLE.TABLE"; + this->m_iPrecision = pInfo->m_crack_decimal_digits; + if (m_bTableData) { ReadFracDef_gaodaofeng(); @@ -11797,20 +11840,10 @@ void QMyCustomPlot::Draw_Kedou() { m_bTypeDraw[i] = true; } - - // - m_qsDIR="DDIR"; // 方位 曲线名 - m_qsDIP="DANG";//倾角 - m_qsDepth="DEPT"; - m_qsID = "ID"; ReadData(m_strSlfName, m_strLineName); } else { - // - m_csCurveDDIR = "DDIR"; // 方位 曲线名 - m_csCurveDANG = "DANG";//倾角 - m_csCurveGrad = "GRAD"; this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve); this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2); this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3); @@ -11824,6 +11857,7 @@ void QMyCustomPlot::Draw_Kedou() { this->DrawDip_Kedou(); } + this->replot(); } void QMyCustomPlot::CalcDipWidth(int nColumn,float *flWidth,float factor,int x1,int x2,float flHoriRatio) @@ -11861,18 +11895,10 @@ void QMyCustomPlot::DrawTabDip_Kedou() if ( nPointNum < 1 )return ; dgtord=3.14159265/180.; - // - m_nCircleWidth = 1; - m_nRadius = 6; - m_crCircle = QColor(0,0,0); - // - m_nTailWidth = 2; - m_nTailLen = 10; - m_crTail = QColor(0,0,0); int iMyWidth = this->axisRect(0)->width(); //setSizeConstraintRect() int iMyHeight = this->axisRect(0)->height(); //setSizeConstraintRect() - qDebug() << "iMyWidth=" << QString::number(iMyWidth) << ", iMyHeight=" << QString::number(iMyHeight); + //qDebug() << "iMyWidth=" << QString::number(iMyWidth) << ", iMyHeight=" << QString::number(iMyHeight); //----------- int l; @@ -11883,8 +11909,8 @@ void QMyCustomPlot::DrawTabDip_Kedou() int m_nScaleThinGrid=10; CalcDipWidth(m_nScaleThinGrid, flWidth, 1.2, x1, x2, 1.); //绘制网格线,注意颜色、宽度属性 - QPen pPenStraightLine(m_crTail, m_nTailWidth); - QPen pPenStraightLineSmall(m_crGridSmall, m_nTailWidth/2); + QPen pPenStraightLine(m_crTail, 2); + QPen pPenStraightLineSmall(m_crGridSmall, 1); for(i=0;istart->setCoords(y, x);//圆心位置 qcpItemLine->end->setCoords(y, x);//圆心位置 - qcpItemLine->setPen(pPen); + qcpItemLine->setPen(pPenTail); qcpItemLine->m_bCustom = true; qcpItemLine->m_nTailLen = m_nTailLen; //尾长 qcpItemLine->m_nRadius = m_nRadius; //半径 @@ -12111,3 +12146,22 @@ void QMyCustomPlot::DrawDip_Kedou() k++; } } + +//改变蝌蚪图属性 +void QMyCustomPlot::s_changeKedouProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) +{ + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + //绘制蝌蚪图 + Draw_Kedou(); +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 450ecc9..ee7b7fc 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -674,6 +674,9 @@ public slots: //改变套管组件属性,直径 void s_changeGuanD(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, double newD); + //改变蝌蚪图属性 + void s_changeKedouProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + public: //蝌蚪图重绘网格线 bool mKedou = false; @@ -730,7 +733,6 @@ public: void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen); //蝌蚪 - float m_LeftVal2,m_RightVal2; //最小倾角、最大倾角 float m_flGrad1,m_flGrad2; // 可信度 int m_iPrecision; //小数位数 float m_nRadius,m_nCircleWidth; // 半径,圆线宽度 From 123a44a17ffa29e96f9ece1be02b281852d2e3fd Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 22 Apr 2026 09:33:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=9D=8C=E8=9A=AA=E5=9B=BE(=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC)=E6=94=AF=E6=8C=81=E9=AB=98=E5=AF=BC=E5=B0=81?= =?UTF-8?q?=E7=AD=89=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 27 +++-- logPlus/qmycustomplot.cpp | 214 +++++++++++++++++++++++++++++++++---- logPlus/qmycustomplot.h | 2 + 3 files changed, 216 insertions(+), 27 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index fc10e6c..da75902 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -5215,12 +5215,7 @@ void PropertyWidget::initKedouProperty(FormInfo *formInfo) _CreateVariantPropertyItem("曲线选择", "方位曲线", formInfo->m_pl_azimuthCurve, QVariant::String); _CreateVariantPropertyItem("曲线选择", "倾角曲线", formInfo->m_pl_inclinationCurve, QVariant::String); _CreateVariantPropertyItem("曲线选择", "可信度曲线", formInfo->m_pl_GradCurve, QVariant::String); - // - _CreateVariantPropertyItem("字段选择(数据表)", "深度字段", formInfo->m_rose_depth_field, QVariant::String); - _CreateVariantPropertyItem("字段选择(数据表)", "方位字段", formInfo->m_rose_azimuth_field, QVariant::String); - _CreateVariantPropertyItem("字段选择(数据表)", "倾角字段", formInfo->m_rose_dip_field, QVariant::String); - _CreateVariantPropertyItem("字段选择(数据表)", "属性字段", formInfo->m_rose_attribute_field, QVariant::String); - // + // _CreateVariantPropertyItem("蝌蚪符号", "圆半径", formInfo->m_nRadius, QVariant::Double); _CreateVariantPropertyItem("蝌蚪符号", "圆线宽度", formInfo->m_nCircleWidth, QVariant::Double); _CreateVariantPropertyItem("蝌蚪符号", "尾线长度", formInfo->m_nTailLen, QVariant::Double); @@ -5234,6 +5229,11 @@ void PropertyWidget::initKedouProperty(FormInfo *formInfo) _CreateVariantPropertyItem("显示控制", "可信度2", formInfo->m_flGrad2, QVariant::Double); // _CreateVariantPropertyItem("显示控制(数据表)", "小数位数", formInfo->m_crack_decimal_digits, QVariant::Int); + // + _CreateVariantPropertyItem("字段选择(数据表)", "深度字段", formInfo->m_rose_depth_field, QVariant::String); + _CreateVariantPropertyItem("字段选择(数据表)", "方位字段", formInfo->m_rose_azimuth_field, QVariant::String); + _CreateVariantPropertyItem("字段选择(数据表)", "倾角字段", formInfo->m_rose_dip_field, QVariant::String); + _CreateVariantPropertyItem("字段选择(数据表)", "属性字段", formInfo->m_rose_attribute_field, QVariant::String); // 分类 this->loadClassifyProperty(formInfo); @@ -5366,62 +5366,77 @@ void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) else if ("高导缝" == strProperty) { this->m_formInfo->m_pl_highGap = varVal.toBool(); + flag = true; } else if ("高阻缝" == strProperty) { this->m_formInfo->m_pl_highReservoir = varVal.toBool(); + flag = true; } else if ("网状缝" == strProperty) { this->m_formInfo->m_pl_reticularFracture = varVal.toBool(); + flag = true; } else if ("诱导缝" == strProperty) { this->m_formInfo->m_pl_inducedFracture = varVal.toBool(); + flag = true; } else if ("层理" == strProperty) { this->m_formInfo->m_pl_bedLayer = varVal.toBool(); + flag = true; } else if ("侵蚀面" == strProperty) { this->m_formInfo->m_pl_erosionSurface = varVal.toBool(); + flag = true; } else if ("孔洞" == strProperty) { this->m_formInfo->m_pl_pore = varVal.toBool(); + flag = true; } else if ("气孔" == strProperty) { this->m_formInfo->m_pl_vesicle = varVal.toBool(); + flag = true; } else if ("砾石" == strProperty) { this->m_formInfo->m_pl_gravel = varVal.toBool(); + flag = true; } else if ("结核" == strProperty) { this->m_formInfo->m_pl_nodule = varVal.toBool(); + flag = true; } else if ("团块" == strProperty) { this->m_formInfo->m_pl_lumps = varVal.toBool(); + flag = true; } else if ("断层" == strProperty) { this->m_formInfo->m_pl_fault = varVal.toBool(); + flag = true; } else if ("垂直缝" == strProperty) { this->m_formInfo->m_pl_verticalFracture = varVal.toBool(); + flag = true; } else if ("自定义1" == strProperty) { this->m_formInfo->m_pl_custom1 = varVal.toBool(); + flag = true; } else if ("自定义2" == strProperty) { this->m_formInfo->m_pl_custom2 = varVal.toBool(); + flag = true; } if(flag) diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index a14ebc7..30cbe69 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -11812,34 +11812,175 @@ void QMyCustomPlot::Draw_Kedou() this->m_csCurveDANG = pInfo->m_pl_inclinationCurve;//倾角 this->m_csCurveGrad = pInfo->m_pl_GradCurve; // 可信度曲线 //字段选择(数据表) - this->m_qsDepth = pInfo->m_rose_depth_field; // 深度字段 - this->m_qsDIR = pInfo->m_rose_azimuth_field; // 方位字段 - this->m_qsDIP = pInfo->m_rose_dip_field; // 倾角字段 - this->m_qsID = this->m_qsProperty = pInfo->m_rose_attribute_field; // 属性字段 + this->m_qsDepth = pInfo->m_rose_depth_field; // 深度字段 + this->m_qsDIR = pInfo->m_rose_azimuth_field; // 方位字段 + this->m_qsDIP = pInfo->m_rose_dip_field; // 倾角字段 + this->m_qsID = pInfo->m_rose_attribute_field; // 属性字段 + this->m_qsProperty = pInfo->m_rose_attribute_field; // 属性字段 //蝌蚪符号 - this->m_nRadius = pInfo->m_nRadius; // 圆半径 + this->m_nRadius = pInfo->m_nRadius; // 圆半径 this->m_nCircleWidth = pInfo->m_nCircleWidth; // 圆线宽度 - this->m_nTailLen = pInfo->m_nTailLen; // 尾线长度 - this->m_nTailWidth = pInfo->m_nTailWidth; // 尾线宽度 - this->m_crCircle = pInfo->m_crCircle; // 圆线颜色 - this->m_crTail = pInfo->m_crTail; // 尾线颜色 + this->m_nTailLen = pInfo->m_nTailLen; // 尾线长度 + this->m_nTailWidth = pInfo->m_nTailWidth; // 尾线宽度 + this->m_crCircle = pInfo->m_crCircle; // 圆线颜色 + this->m_crTail = pInfo->m_crTail; // 尾线颜色 this->m_crPointFill=this->m_crCircle; // this->m_crGridSmall=qRgb(100,100,100); - this->m_flGrad1 = pInfo->m_flGrad1; //可信度 - this->m_flGrad2 = pInfo->m_flGrad2; - //Table dip + // 显示控制 + this->m_pl_minInclination = pInfo->m_pl_minInclination; // 最小倾角 + this->m_pl_maxInclination = pInfo->m_pl_maxInclination; // 最大倾角 + this->m_flGrad1 = pInfo->m_flGrad1; //可信度1 + this->m_flGrad2 = pInfo->m_flGrad2; //可信度2 + + //Table dip表名 this->m_qsTable="FRAC_HOLE.TABLE"; - this->m_iPrecision = pInfo->m_crack_decimal_digits; + this->m_iPrecision = pInfo->m_crack_decimal_digits; //小数位数 + + // 分类 + if(pInfo->m_pl_highGap)// 高导缝 + { + m_bTypeDraw[0] = true; + } + else + { + m_bTypeDraw[0] = false; + } + + if(pInfo->m_pl_highReservoir) // 高阻缝 + { + m_bTypeDraw[1] = true; + } + else + { + m_bTypeDraw[1] = false; + } + + if(pInfo->m_pl_reticularFracture) // 网状缝 + { + m_bTypeDraw[2] = true; + } + else + { + m_bTypeDraw[2] = false; + } + + if(pInfo->m_pl_inducedFracture) // 诱导缝 + { + m_bTypeDraw[3] = true; + } + else + { + m_bTypeDraw[3] = false; + } + + if(pInfo->m_pl_bedLayer) // 层理 + { + m_bTypeDraw[4] = true; + } + else + { + m_bTypeDraw[4] = false; + } + + if(pInfo->m_pl_erosionSurface) // 侵蚀面 + { + m_bTypeDraw[5] = true; + } + else + { + m_bTypeDraw[5] = false; + } + + if(pInfo->m_pl_pore) // 孔洞 + { + m_bTypeDraw[6] = true; + } + else + { + m_bTypeDraw[6] = false; + } + + if(pInfo->m_pl_vesicle) // 气孔 + { + m_bTypeDraw[7] = true; + } + else + { + m_bTypeDraw[7] = false; + } + + if(pInfo->m_pl_gravel) // 砾石 + { + m_bTypeDraw[8] = true; + } + else + { + m_bTypeDraw[8] = false; + } + + if(pInfo->m_pl_nodule) // 结核 + { + m_bTypeDraw[9] = true; + } + else + { + m_bTypeDraw[9] = false; + } + + if(pInfo->m_pl_lumps) // 团块 + { + m_bTypeDraw[10] = true; + } + else + { + m_bTypeDraw[10] = false; + } + + if(pInfo->m_pl_fault) // 断层 + { + m_bTypeDraw[11] = true; + } + else + { + m_bTypeDraw[11] = false; + } + + if(pInfo->m_pl_verticalFracture) // 垂直缝 + { + m_bTypeDraw[12] = true; + } + else + { + m_bTypeDraw[12] = false; + } + + if(pInfo->m_pl_custom1) // 自定义1 + { + m_bTypeDraw[13] = true; + } + else + { + m_bTypeDraw[13] = false; + } + + if(pInfo->m_pl_custom2) // 自定义2 + { + m_bTypeDraw[14] = true; + } + else + { + m_bTypeDraw[14] = false; + } if (m_bTableData) { ReadFracDef_gaodaofeng(); - for (int i = 0 ; i < iFracType ; i++) - { - m_bTypeDraw[i] = true; - } +// for (int i = 0 ; i < iFracType ; i++) +// { +// m_bTypeDraw[i] = true; +// } ReadData(m_strSlfName, m_strLineName); } else @@ -12065,8 +12206,9 @@ void QMyCustomPlot::DrawDip_Kedou() //尾巴 QPen pPenTail(m_crTail); pPenTail.setWidth(m_nTailWidth); - // - QBrush cBrushFill(m_crPointFill); + //圆填充 + QBrush cBrushFill(m_crPointFill); + QBrush brush2(QColor(qRgb(255,255,255)));//NULL_BRUSH float flDepthScale,tempf,flVal; int nPointNum=0,tempi; @@ -12104,9 +12246,32 @@ void QMyCustomPlot::DrawDip_Kedou() continue; } + bool bFillBrush = true; + if ( m_Value3!=NULL)// && m_Value3 !=0xcdcdcdcd ) + { + flVal = GetData(m_Curve3.RepCode,(char *)&m_Value3[i*m_Curve3.CodeLen]);//置信度 + if ( flVal < m_flGrad1 ) + { + k++; + continue; + } + if ( flVal > m_flGrad2 ) + { + bFillBrush = true; + } + else + { + bFillBrush = false; + } + } + else + { + bFillBrush = true; + } + // flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[i*m_Curve2.CodeLen]);//DANG - if ( flVal > m_flGrad2 || flVal < m_flGrad1 ) + if ( flVal > m_pl_maxInclination || flVal < m_pl_minInclination ) { k++; continue; @@ -12129,7 +12294,14 @@ void QMyCustomPlot::DrawDip_Kedou() qcpItemEllipse->m_nRadius = m_nRadius; qcpItemEllipse->topLeft->setCoords(y, x);//圆心位置 qcpItemEllipse->bottomRight->setCoords(y, x);//圆心位置 - qcpItemEllipse->setBrush(cBrushFill);//填充圆的颜色 + if(bFillBrush) + { + qcpItemEllipse->setBrush(cBrushFill);//填充圆的颜色 + } + else + { + qcpItemEllipse->setBrush(brush2);//填充圆的颜色 + } //方位 flVal = GetData(m_Curve.RepCode,(char *)&m_Value[i*m_Curve.CodeLen]);//DDIR diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index ee7b7fc..d09d6fc 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -733,6 +733,8 @@ public: void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen); //蝌蚪 + double m_pl_minInclination = 0; // 最小倾角 + double m_pl_maxInclination = 90; // 最大倾角 float m_flGrad1,m_flGrad2; // 可信度 int m_iPrecision; //小数位数 float m_nRadius,m_nCircleWidth; // 半径,圆线宽度 From 802f654c3d2535e30217e8e6ba85f5c1474d2df9 Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Wed, 22 Apr 2026 09:58:42 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=8F=9C=E5=8D=95=EF=BC=8C=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 7 + DataOutput/src/TranSlf2Data.cpp | 4 +- logPlus/mainwindow.cpp | 37 ++++- logPlus/mainwindow.h | 5 + logPlus/mainwindowcurve.cpp | 4 + logPlus/qtprojectwidgets.cpp | 146 ++++++++++++++---- logPlus/qtprojectwidgets.h | 5 +- .../src/SLFAsciiConvertor.cpp | 2 +- 8 files changed, 170 insertions(+), 40 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 995c63c..8833b3b 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -38,6 +38,13 @@ signals: void sig_OpenProject(QString strName);//打开项目 void sig_CloseProject();//关闭项目 + void sig_ImportSingleWellLogData();//数据导入 + void sig_OutWellLogRound();//输出数据,数据导出 + + void sig_SaveAsPicture(); //导出长图 + void sig_SaveAsPdf(); //导出PDF + void sig_SaveAsSvg(); //导出SVG + void sig_ShowParameterCard(QString strSlfName, QString strName);//参数表查看 void sig_ShowCurve(QMap> mapShowObject);//曲线数据查看 void sig_DepthShift(QString strSlfName, QString strName, double DepthOffset);//深度移动 diff --git a/DataOutput/src/TranSlf2Data.cpp b/DataOutput/src/TranSlf2Data.cpp index da700eb..60aa371 100644 --- a/DataOutput/src/TranSlf2Data.cpp +++ b/DataOutput/src/TranSlf2Data.cpp @@ -1504,7 +1504,7 @@ void TranToAscii(CMemRdWt *mrw,QString Outfile,float sdep,float edep,float rlev, return; } FILE *fp; - fp=fopen(Outfile.toStdString().c_str(),"wt+"); + fp=fopen(UTF8ToGBK(Outfile)/*Outfile.toStdString().c_str()*/,"wt+"); if(fp==NULL) { QMessageBox::information(NULL,"提示","打开输出文件"+Outfile+"失败"); @@ -4333,7 +4333,7 @@ void TranSlf2Data(int FormatType,QMap > OutFileInfVec,O //如果输出文件目录不存在,先创建目录 QFileInfo rFileInfo(Outfile); QDir rDir = rFileInfo.absoluteDir(); - if(!rDir.exists())rDir.mkpath(rFileInfo.absolutePath()); + if(!rDir.exists())rDir.mkpath(UTF8ToGBK(rFileInfo.absolutePath())); if(FormatType<=3) TranToAscii(&mrw,Outfile,Outsdep,Outedep,Outrlev,NumObject,&OutInf[0],FormatType,IsCheck[5]); diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index dbfbe83..d78bf79 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -225,11 +225,15 @@ void MainWindow::initTitleBar() // QMenu* m_dataMenu = this->menuBar()->addMenu(tr("数据管理(&D)")); - // - QMenu* m_resultMenu = this->menuBar()->addMenu(tr("成果输出(&R)")); + m_dataMenu->addAction(QIcon( ::GetImagePath() + "wellog.png"), tr("&数据导入"), this, SLOT(s_ImportSingleWellLogData())); // QMenu* m_analyzeToolMenu = this->menuBar()->addMenu(tr("分析工具(&W)")); // + QMenu* m_resultMenu = this->menuBar()->addMenu(tr("成果输出(&R)")); + m_resultMenu->addAction(QIcon( ::GetImagePath() + "icon/SaveAsPicture.png"), tr("&导出长图"), this, SLOT(s_SaveAsPicture())); + m_resultMenu->addAction(QIcon( ::GetImagePath() + "icon/ExportPDF.png"), tr("&导出PDF"), this, SLOT(s_SaveAsPdf())); + m_resultMenu->addAction(QIcon( ::GetImagePath() + "icon/ExportSVG.png"), tr("&导出SVG"), this, SLOT(s_SaveAsSvg())); + // QMenu* m_SystemToolMenu = this->menuBar()->addMenu(tr("系统工具(&T)")); // QMenu* m_helpMenu = this->menuBar()->addMenu(tr("帮助(&H)")); @@ -257,8 +261,8 @@ void MainWindow::initToolBar() ui->mainToolBar->addAction(QIcon( ::GetImagePath() + "openproject.png"), tr("&打开项目"), this, SLOT(s_Open())); ui->mainToolBar->addSeparator();//添加分隔符 // - ui->mainToolBar->addAction(QIcon( ::GetImagePath() + "wellog.png"), tr("&数据导入"), this, SLOT(s_wellog())); - ui->mainToolBar->addAction(QIcon( ::GetImagePath() + "outcurves.png"), tr("&数据导出"), this, SLOT(s_outcurves())); + ui->mainToolBar->addAction(QIcon( ::GetImagePath() + "wellog.png"), tr("&数据导入"), this, SLOT(s_ImportSingleWellLogData())); + ui->mainToolBar->addAction(QIcon( ::GetImagePath() + "outcurves.png"), tr("&数据导出"), this, SLOT(s_OutWellLogRound())); ui->mainToolBar->addSeparator();//添加分隔符 // ui->mainToolBar->addAction(QIcon( ::GetImagePath() + "wellsectionwindow.png"), tr("&可视解释"), this, SLOT(s_showView())); @@ -432,6 +436,31 @@ void MainWindow::s_Open() } } +void MainWindow::s_ImportSingleWellLogData() +{ + emit CallManage::getInstance()->sig_ImportSingleWellLogData(); +} + +void MainWindow::s_OutWellLogRound() +{ + emit CallManage::getInstance()->sig_OutWellLogRound(); +} + +void MainWindow::s_SaveAsPicture() +{ + emit CallManage::getInstance()->sig_SaveAsPicture(); +} + +void MainWindow::s_SaveAsPdf() +{ + emit CallManage::getInstance()->sig_SaveAsPdf(); +} + +void MainWindow::s_SaveAsSvg() +{ + emit CallManage::getInstance()->sig_SaveAsSvg(); +} + void MainWindow::s_SaveProject() { // //加载插件显示 diff --git a/logPlus/mainwindow.h b/logPlus/mainwindow.h index 089f6b8..bc201cd 100644 --- a/logPlus/mainwindow.h +++ b/logPlus/mainwindow.h @@ -68,6 +68,11 @@ public: public slots: void s_New(); void s_Open(); + void s_ImportSingleWellLogData(); + void s_OutWellLogRound(); + void s_SaveAsPicture(); + void s_SaveAsPdf(); + void s_SaveAsSvg(); void s_SaveProject(); void s_CloseProject(); void slotExitSystem(); diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 9191458..e2a51bc 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -306,6 +306,10 @@ void MainWindowCurve::initMainToolBar() connect(m_SaveAsPdfAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsPdf); connect(m_SaveAsSvgAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsSvg); + connect(CallManage::getInstance(), SIGNAL(sig_SaveAsPicture()), this, SLOT(s_SaveAsPicture())); + connect(CallManage::getInstance(), SIGNAL(sig_SaveAsPdf()), this, SLOT(s_SaveAsPdf())); + connect(CallManage::getInstance(), SIGNAL(sig_SaveAsSvg()), this, SLOT(s_SaveAsSvg())); + // connect(m_grepAc, &QAction::triggered, this, &MainWindow::s_Risize); // connect(m_compileAc, &QAction::triggered, this, &MainWindow::s_AddOne); // connect(m_debugAc, &QAction::triggered, this, &MainWindow::s_DrawImg); diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index f58908a..c64aa1f 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -58,6 +58,12 @@ QtProjectWidgets::QtProjectWidgets(QWidget *parent) //关联信号槽,关闭项目 connect(CallManage::getInstance(), SIGNAL(sig_CloseProject()), this, SLOT(s_CloseProject())); + //关联信号槽,数据导入 + connect(CallManage::getInstance(), SIGNAL(sig_ImportSingleWellLogData()), this, SLOT(onImportSingleWellLogDataToolBar())); + + //关联信号槽,输出数据,数据导出 + connect(CallManage::getInstance(), SIGNAL(sig_OutWellLogRound()), this, SLOT(onOutWellLogRound())); + //向左侧树图,追加固井结论表格 connect(CallManage::getInstance(), SIGNAL(sig_AddGujingToTree(QString,QString,QString)), this, SLOT(s_AddGujingToTree(QString,QString,QString))); @@ -771,10 +777,10 @@ void QtProjectWidgets::initWellsTreeMenu(QMenu *menu, QTreeWidget *treeWidget) connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCopyObject())); menu->addAction(action_New); - // action_New = new QAction("输出数据", treeWidget); - // action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标 - // connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound())); - // menu->addAction(action_New); + action_New = new QAction("输出数据", treeWidget); + action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标 + connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound())); + menu->addAction(action_New); } //初始化参数卡-右键菜单 void QtProjectWidgets::initParameterCardTreeMenu(QMenu *menu, QTreeWidget *treeWidget) @@ -1857,7 +1863,7 @@ void QtProjectWidgets::onImportFolder() return; } -void QtProjectWidgets::onImportSingleWellLogData() +void QtProjectWidgets::ImportSingleWellLogData(bool bToolBar) { MainWindow* pMainWindow = nullptr; @@ -1901,28 +1907,30 @@ void QtProjectWidgets::onImportSingleWellLogData() QMessageBox::information(NULL,"无法识别的文件",listFiles[0]); return ; } - QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin(); - QString wellname = wellItem->text(0); + QFileInfo temDir(file_name); + QString tempWellName=temDir.completeBaseName(); + tempWellName.replace(" ","");//whp add 2020.3.3 删除井名中的空格 + //m_WellLogRoundInfo->SetName(tempWellName.toStdString()); + QString wellname = tempWellName; QString wellroundname = wellname; - QString strTreeTag = wellItem->data(0, Qt::UserRole).toString(); - if (strTreeTag == "wells") //井组 - { - QFileInfo temDir(file_name); - QString tempWellName=temDir.completeBaseName(); - tempWellName.replace(" ","");//whp add 2020.3.3 删除井名中的空格 - //m_WellLogRoundInfo->SetName(tempWellName.toStdString()); - wellname = tempWellName; - wellroundname = wellname; - } - else if (strTreeTag == "wellname") //井名 - { - } - else if (strTreeTag == "wellItem") //井次 + if (!bToolBar) { - wellname = wellItem->parent()->text(0); + QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin(); + + QString strTreeTag = wellItem->data(0, Qt::UserRole).toString(); + if (strTreeTag == "wellname") //井名 + { + wellname = wellItem->text(0); + } + else if (strTreeTag == "wellItem") //井次 + { + wellname = wellItem->parent()->text(0); + wellroundname = wellItem->text(0); + } } + CDataImport::m_prjname = g_prjname; ImportDataDialog *pDialog = new ImportDataDialog(NULL,wellname,wellroundname); QTreeWidgetItem rootItem = *ui->treeWidget->topLevelItem(0); @@ -1934,11 +1942,20 @@ void QtProjectWidgets::onImportSingleWellLogData() QString strProjectFile = strProjectFolder + g_prjname; strProjectFile += ".wwl"; s_OpenProject(strProjectFile); - return ; } } } +void QtProjectWidgets::onImportSingleWellLogData() +{ + ImportSingleWellLogData(false); +} + +void QtProjectWidgets::onImportSingleWellLogDataToolBar() +{ + ImportSingleWellLogData(true); +} + void QtProjectWidgets::onImportSlfTable() { // CInDefTableDlg InDefTableDlg(0); @@ -1961,16 +1978,81 @@ void QtProjectWidgets::onImportSlfTable() void QtProjectWidgets::onOutWellLogRound() { - QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin(); - - QString wellname = wellItem->text(0); - QString wellroundname = wellname; - - QString folderPath = GetLogdataPath(); - folderPath = folderPath + g_prjname; - folderPath = folderPath + "/" + "#" + wellname + "/" + wellroundname + ".slf"; QStringList namelist;//=GetSelWellRound(); - namelist<treeWidget->selectedItems().begin(); + if (wellItem) + { + QString strTreeTag = wellItem->data(0, Qt::UserRole).toString(); + if (strTreeTag == "wellname") //井名 + { + int childCount = wellItem->childCount(); // 获取子节点数量 + for (int i = 0; i < childCount; ++i) + { + QTreeWidgetItem *wellround = wellItem->child(i); + QString strSlfFile = wellItem->child(i)->data(0, Qt::UserRole + 1).toString(); // 存储额外数据,项目名 + namelist<data(0, Qt::UserRole + 1).toString(); // 存储额外数据,项目名 + namelist<parent(); + while(parenItem) + { + if (parenItem == ui->treeWidget->topLevelItem(0)) + break; + strTreeTag = wellItem->data(0, Qt::UserRole).toString(); + if (strTreeTag == "wellItem") //井次 + { + QString strSlfFile = wellItem->data(0, Qt::UserRole + 1).toString(); // 存储额外数据,项目名 + namelist<parent(); + } + } + } + if (namelist.size()==0) + { + int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量 + if(topCount<1) + { + return; + } + + QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0); + int childCount = item->childCount(); // 获取子节点数量 + for (int i = 0; i < childCount; ++i) + { + //井组,数据分析... + QTreeWidgetItem *wellGroupItem = item->child(i); + QString wellGroupname = wellGroupItem->text(0); + if (wellGroupname == "井组") + { + int wellCount = wellGroupItem->childCount(); // 获取井节点数量 + for (int j = 0; j < wellCount; ++j) + { + QTreeWidgetItem *wellchild = wellGroupItem->child(j); + int wellchildCount = wellchild->childCount(); // 获取井节点数量 + for (int k = 0; k < wellchildCount; ++k) + { + QString strTreeTag = wellchild->child(k)->data(0, Qt::UserRole).toString(); + if (strTreeTag == "wellItem") //井次 + { + QString strSlfFile = wellchild->child(k)->data(0, Qt::UserRole + 1).toString(); // 存储额外数据,项目名 + namelist< Date: Wed, 22 Apr 2026 11:20:50 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=86=E6=9E=90=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=92=8C=E5=8F=AF=E8=A7=86=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/mainwindow.cpp | 2 ++ logPlus/qtprojectwidgets.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index d78bf79..26f7510 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -228,6 +228,8 @@ void MainWindow::initTitleBar() m_dataMenu->addAction(QIcon( ::GetImagePath() + "wellog.png"), tr("&数据导入"), this, SLOT(s_ImportSingleWellLogData())); // QMenu* m_analyzeToolMenu = this->menuBar()->addMenu(tr("分析工具(&W)")); + m_analyzeToolMenu->addAction(QIcon( ::GetImagePath() + "outcurves.png"), tr("&数据导出"), this, SLOT(s_OutWellLogRound())); + m_analyzeToolMenu->addAction(QIcon( ::GetImagePath() + "wellsectionwindow.png"), tr("&可视解释"), this, SLOT(s_showView())); // QMenu* m_resultMenu = this->menuBar()->addMenu(tr("成果输出(&R)")); m_resultMenu->addAction(QIcon( ::GetImagePath() + "icon/SaveAsPicture.png"), tr("&导出长图"), this, SLOT(s_SaveAsPicture())); diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index c64aa1f..a0d864a 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -1980,7 +1980,8 @@ void QtProjectWidgets::onOutWellLogRound() { QStringList namelist;//=GetSelWellRound(); QTreeWidgetItem *wellItem = *ui->treeWidget->selectedItems().begin(); - if (wellItem) + int nSelSize = ui->treeWidget->selectedItems().size();// 防止没有选中时崩溃 + if (wellItem && nSelSize>0) { QString strTreeTag = wellItem->data(0, Qt::UserRole).toString(); if (strTreeTag == "wellname") //井名 From 945436e7d9c49adb2126d1617d1c3abb3caad349 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 22 Apr 2026 15:14:50 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E6=9D=86=E7=8A=B6=E5=9B=BE=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=BF=BD=E5=8A=A0=202.=E6=94=AF=E6=8C=81=E4=BB=8Ejson?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8A=A0=E8=BD=BD=E6=9D=86=E7=8A=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 4 + logPlus/PropertyWidget.cpp | 114 +++++++++++- logPlus/PropertyWidget.h | 5 + logPlus/formdraw.cpp | 344 ++++++++++-------------------------- logPlus/formdraw.h | 6 +- logPlus/forminfo.cpp | 118 ++++++++++++- logPlus/forminfo.h | 2 + logPlus/formtrack.cpp | 39 ++++ logPlus/formtrack.h | 1 + logPlus/mainwindowcurve.cpp | 2 +- logPlus/qmycustomplot.cpp | 175 +++++++++++++++++- logPlus/qmycustomplot.h | 6 + 12 files changed, 547 insertions(+), 269 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 8833b3b..4d2b71d 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -265,6 +265,10 @@ signals: //改变蝌蚪图属性 void sig_changeKedouProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + + //改变杆状图属性 + void sig_changeGanzhuangProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index da75902..52429c8 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -2371,7 +2371,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant // changedKedouProperty(m_propertyData[pProperty], variant); } - + else if (m_strCurrentProperty == Ganzhuang_Property)//杆状图 + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + // + changedGanzhuangProperty(m_propertyData[pProperty], variant); + } } @@ -3198,6 +3204,11 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //蝌蚪图 this->initKedouProperty(formInfo); } + else if (m_strLineName == "GANZHUANG.LINE") + { + //杆状图 + this->initGanzhuangProperty(formInfo); + } else { this->initTableProperty(formInfo); @@ -5247,8 +5258,6 @@ void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) if ("名称" == strProperty) { QFont newFont = varVal.value(); -// this->m_formInfo->m_strAliasNameFont = newFont; -// this->m_formInfo->repaint(); m_formInfo->m_curveNameFont = newFont; m_formInfo->update(); } @@ -5319,11 +5328,13 @@ void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) else if ("最小倾角" == strProperty) { this->m_formInfo->m_pl_minInclination = varVal.toDouble(); + this->m_formInfo->repaint(); flag = true; } else if ("最大倾角" == strProperty) { this->m_formInfo->m_pl_maxInclination = varVal.toDouble(); + this->m_formInfo->repaint(); flag = true; } else if ("可信度1" == strProperty) @@ -5444,3 +5455,100 @@ 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); + _CreateVariantPropertyItem("井文件名", "井文件名称", m_strSlfName, QVariant::String); + + // + _CreateVariantPropertyItem("曲线选择", "方位曲线", formInfo->m_pl_azimuthCurve, QVariant::String); + _CreateVariantPropertyItem("曲线选择", "倾角曲线", formInfo->m_pl_inclinationCurve, QVariant::String); + _CreateVariantPropertyItem("曲线选择", "可信度曲线", formInfo->m_pl_GradCurve, QVariant::String); + // + _CreateVariantPropertyItem("倾角刻度", "最小倾角", formInfo->m_pl_minInclination, QVariant::Double); + _CreateVariantPropertyItem("倾角刻度", "最大倾角", formInfo->m_pl_maxInclination, QVariant::Double); + // + _CreateVariantPropertyItem("可信度", "可信度1", formInfo->m_flGrad1, QVariant::Double); + _CreateVariantPropertyItem("可信度", "可信度2", formInfo->m_flGrad2, QVariant::Double); + // + _CreateVariantPropertyItem("曲线单位", "显示单位", formInfo->m_strUnit, QVariant::String); + // + _CreateVariantPropertyItem("杆设置", "线长度", formInfo->m_nTailLen, QVariant::Double); + _CreateVariantPropertyItem("杆设置", "线宽度", formInfo->m_nTailWidth, QVariant::Double); + _CreateVariantPropertyItem("杆设置", "线颜色", formInfo->m_crTail, QVariant::Color); + + m_strCurrentProperty = Ganzhuang_Property; +} + +void PropertyWidget::changedGanzhuangProperty(QString strProperty, QVariant varVal) +{ + bool flag = false; + + if ("方位曲线" == strProperty) + { + this->m_formInfo->m_pl_azimuthCurve = varVal.toString(); + flag = true; + } + else if ("倾角曲线" == strProperty) + { + this->m_formInfo->m_pl_inclinationCurve = varVal.toString(); + flag = true; + } + else if ("可信度曲线" == strProperty) + { + this->m_formInfo->m_pl_GradCurve = varVal.toString(); + flag = true; + } + // 杆 + else if ("线长度" == strProperty) + { + this->m_formInfo->m_nTailLen = varVal.toDouble(); + flag = true; + } + else if ("线宽度" == strProperty) + { + this->m_formInfo->m_nTailWidth = varVal.toDouble(); + flag = true; + } + else if ("线颜色" == strProperty) + { + this->m_formInfo->m_crTail = varVal.value(); + flag = true; + } + // + else if ("最小倾角" == strProperty) + { + this->m_formInfo->m_pl_minInclination = varVal.toDouble(); + this->m_formInfo->repaint(); + flag = true; + } + else if ("最大倾角" == strProperty) + { + this->m_formInfo->m_pl_maxInclination = varVal.toDouble(); + this->m_formInfo->repaint(); + flag = true; + } + else if ("可信度1" == strProperty) + { + this->m_formInfo->m_flGrad1 = varVal.toDouble(); + flag = true; + } + else if ("可信度2" == strProperty) + { + this->m_formInfo->m_flGrad2 = varVal.toDouble(); + flag = true; + } + else if ("显示单位" == strProperty) + { + this->m_formInfo->m_strUnit = varVal.toString(); + this->m_formInfo->repaint(); + } + + if(flag) + { + 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); + } +} diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index e81e14e..45a2b16 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -78,6 +78,7 @@ #define TubingItem_Property "TubingItem_Property" //套管组件item #define Kedou_Property "Kedou_Property" //蝌蚪图 +#define Ganzhuang_Property "Ganzhuang_Property" //杆状图 #pragma execution_character_set("utf-8") @@ -262,6 +263,10 @@ public: void initKedouProperty(FormInfo *formInfo); void changedKedouProperty(QString strProName, QVariant val); + //杆状图 + void initGanzhuangProperty(FormInfo *formInfo); + void changedGanzhuangProperty(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 e1bac3b..927b4e0 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -59,7 +59,7 @@ FormDraw::FormDraw(QWidget *parent, QString strSlfName, QString strWellName, QSt connect(CallManage::getInstance(), SIGNAL(sig_AddTableLine(QString, QString, QString, QString, QString)), this, SLOT(s_addTableLine(QString, QString, QString, QString, QString))); connect(CallManage::getInstance(), SIGNAL(sig_delTableLine(QString, QString, QString, QString)), this, SLOT(s_delTableLine(QString, QString, QString, QString))); - connect(CallManage::getInstance(), SIGNAL(sig_AddGanZhuangTu(QString, QString, QString, QString, QString, int)), this, SLOT(s_addGanZuangTu(QString, QString, QString, QString, QString,int))); + connect(CallManage::getInstance(), SIGNAL(sig_AddGanZhuangTu(QString, QString, QString, QString, QString, int)), this, SLOT(s_addGanZhuangTu(QString, QString, QString, QString, QString,int))); //井眼垮塌矢量图 connect(CallManage::getInstance(), SIGNAL(sig_AddJykt(QString, QString, QString, QString, QString, int)), this, SLOT(s_addJykt(QString, QString, QString, QString, QString,int))); @@ -536,9 +536,9 @@ void FormDraw::DisplayLines(QJsonArray linesArray) // 岩心照片 displayImageData(lineObjInfo); } - else if (strLineName == "FRAC_HOLE.TABLE") + else if (strLineName == "FRAC_HOLE.TABLE" || strLineName == "GANZHUANG.LINE") { - // 蝌蚪图 + // 蝌蚪图、杆状图 DisplayKedou_One(lineObjInfo); } } @@ -1194,15 +1194,9 @@ void FormDraw::DisplayKedou_One(QJsonObject lineObjInfo) if (strLineName != "") { - /* - QVariantMap variantMap; - // 数据 - variantMap["AliasName"] = strAliasName; - variantMap["curveNameFont"] = curveNameFont;*/ - - //结论 + //蝌蚪图、杆状 this->addKedou(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, lineObjInfo); - } + } } //气测/FMT/射孔/文本 @@ -2908,14 +2902,6 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri if (strLineName == "FRAC_HOLE.TABLE") { //蝌蚪图 - curv->mKedou = true; - //隐藏网格 - curv->xAxis->grid()->setVisible(false); - curv->yAxis->grid()->setVisible(false); - // - curv->m_bRowGridVisible = false; - curv->m_bColGridVisible = false; - // initKedou(curv, strSlfName, strLineName); } else if (strLineName == "WORDS_RELUST") @@ -3032,13 +3018,9 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri QMyCustomPlot* FormDraw::addKedou(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QJsonObject listOtherProperty) { - if (strLineName == "FRAC_HOLE.TABLE" || strLineName == "WORDS_RELUST" || strLineName == "RESULT" - || strLineName == "GEO_LITH" || strLineName == "SWALL_CORE" - || strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT" - || strLineName == "CORE_PHYSICS" || strLineName == "IMAGE_DATA" - || strLineName == "LAYER_DATA" ) + //蝌蚪、杆状 + if (strLineName == "FRAC_HOLE.TABLE" || strLineName == "GANZHUANG.LINE") { - } else { @@ -3070,14 +3052,6 @@ QMyCustomPlot* FormDraw::addKedou(QString strUuid, QString strSlfName, QString s if (strLineName == "FRAC_HOLE.TABLE") { //蝌蚪图 - curv->mKedou = true; - //隐藏网格 - curv->xAxis->grid()->setVisible(false); - curv->yAxis->grid()->setVisible(false); - // - curv->m_bRowGridVisible = false; - curv->m_bColGridVisible = false; - QString strAliasName = "蝌蚪图"; QColor newlineColor=QColor(0,0,0); // 显示名称 @@ -3092,6 +3066,23 @@ QMyCustomPlot* FormDraw::addKedou(QString strUuid, QString strSlfName, QString s // initKedou(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty); } + else if(strLineName == "GANZHUANG.LINE") + { + QString strAliasName = "杆状图"; + QColor newlineColor=QColor(0,0,0); + // 显示名称 + // 显示名称 + if (listOtherProperty.contains("AliasName")) + { + QJsonValue value = listOtherProperty.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + } + } + // + initGanzhuang(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty); + } + connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); // m_listLineName.push_back(strLineName); @@ -3716,9 +3707,8 @@ void FormDraw::s_selectionRectAccepted(const QRect &rect, QMouseEvent *event) // double y2 = widget->yAxis->pixelToCoord(rect.bottom()); } -void FormDraw::s_addGanZuangTu(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW) +void FormDraw::s_addGanZhuangTu(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW) { - //井名&道名不一致 if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) { @@ -3741,100 +3731,17 @@ void FormDraw::s_addGanZuangTu(QString strUuid, QString strSlfName, QString strW curv->m_strUuid = m_strUuid; curv->setDepthY(m_iY1, m_iY2); curv->initGeometry(m_strUuid, m_iScale, g_iOneWidth); - curv->show(); + //杆状图 + initGanzhuang(curv, strSlfName, strLineName); - //////////////////////////////////////// - m_Value=NULL; - m_Value2=NULL; - m_Value3=NULL; - m_bTableData=0;//表格或曲线 - //m_csCurveDDIR="DDIR"; - //m_csCurveDANG="DANG"; - //m_csCurveGrad="GRAD"; - m_nTailWidth=2; - m_crTail=qRgb(0,0,0); - m_crPointFill=qRgb(0,0,0); - - m_crGridSmall=qRgb(100,100,100); - m_nRadius = 6; - m_nTailLen = 10; - m_nCircleWidth=1; - m_flGrad1 = 10; - m_flGrad2 = 50; - - //Table dip - m_qsTable="FRAC_HOLE.TABLE"; - m_qsDIR=("DIR"); // 方位 曲线名 - m_qsDIP=("DIPorS");//倾角 - m_qsDepth="DEP"; - m_qsID = "ID"; - m_qsProperty=("ID"); - m_iPrecision = 3; - - //读数据 - m_csCurveDDIR = "DDIR"; // 方位 曲线名 - m_csCurveDANG = "DANG";//倾角 - m_csCurveGrad = "GRAD"; - this->ReadData(strSlfName, m_csCurveDDIR, 0, &m_Curve); - this->ReadData(strSlfName, m_csCurveDANG, 1, &m_Curve2); - this->ReadData(strSlfName, m_csCurveGrad, 2, &m_Curve3); - curv->yAxis->setTickLabels(true); - curv->yAxis->setTickLabelSide(QCPAxis::lsInside); - QFont font1("微软雅黑", 16); //fontSize 10 - curv->yAxis->setTickLabelFont(font1); - // - // curv->xAxis->ticker()->setTickCount(10);//x个主刻度 - // curv->yAxis->ticker()->setTickCount(60);//y个主刻度 - int iMyWidth = curv->axisRect(0)->width(); - float vmax = iMyWidth; - float vmin = 0; - curv->setScaleX(vmin, vmax); - 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; - - - m_LeftVal = 0; - m_RightVal = 90; - //隐藏刻度 - curv->xAxis->setTicks(false); - curv->yAxis->setTicks(false); - curv->xAxis2->setTicks(false); - curv->yAxis2->setTicks(false); - curv->xAxis->setVisible(false); - curv->xAxis2->setVisible(false); - curv->yAxis->setVisible(false); - curv->yAxis2->setVisible(false); - //蝌蚪图 - // curv->mKedou = true; - //隐藏网格 - // curv->xAxis->grid()->setVisible(false); - // curv->yAxis->grid()->setVisible(false); - DrawStck(curv); - - - //道-对象 - QString strAliasName = "杆状图"; - QString strUnit = ""; - QColor newlineColor=QColor(0,0,0); - double width=2; - QString strScaleType = ""; - //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "ganzhuangtuObject"); // connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); m_listLineName.push_back(strLineName); } + void FormDraw::s_addJykt(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW) { //井名&道名不一致 @@ -5156,6 +5063,15 @@ void FormDraw::DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, //蝌蚪图 void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QJsonObject listOtherProperty) { + widget->mKedou = true; + + //隐藏网格 + widget->xAxis->grid()->setVisible(false); + widget->yAxis->grid()->setVisible(false); + // + widget->m_bRowGridVisible = false; + widget->m_bColGridVisible = false; + int iMyWidth = widget->axisRect(0)->width(); float vmax = iMyWidth; float vmin = 0; @@ -5185,7 +5101,7 @@ void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strL widget->yAxis2->setVisible(false); //----------------------------------- - QString strUnit = ""; + QString strUnit = "(°)"; double width=2; QString strScaleType = ""; //道-对象 @@ -5193,8 +5109,59 @@ void FormDraw::initKedou(QMyCustomPlot *widget, QString strSlfName, QString strL //蝌蚪图 widget->Draw_Kedou(); +} +//杆状图 +void FormDraw::initGanzhuang(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(); + float vmax = iMyWidth; + float vmin = 0; + + widget->setScaleX(vmin, iMyWidth); + 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; + + m_LeftVal = 0; + m_RightVal = 90; + //隐藏刻度 + 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 = "(°)"; + double width=2; + QString strScaleType = ""; + if(!listOtherProperty.isEmpty()) + { + strUnit = listOtherProperty["Unit"].toString(); // 单位 + } + //道-对象 + FormInfo* pInfo = m_formTrack->AddGanzhuang(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty); + + //杆状图 + widget->Draw_Ganzhuang(); } void FormDraw::initWords(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty) @@ -6796,139 +6763,6 @@ void FormDraw::DrawDenv(QMyCustomPlot *widget, QString strSlfName) } } -void FormDraw::DrawStck(QMyCustomPlot *widget) -{ - float flWidth[50]; - int l; - float dep; - int m_nScaleThinGrid=10; - float lstk=2; - float dang,ddir; - float dg,dy,dx; - // 计算位置 - int iMyWidth = widget->axisRect(0)->width(); - float x1 = 0; - float x2 = iMyWidth; - float x=0,y=0; - int j=0,i=0,k=0; - float flTemp=0; - for(int i=0;i<50;i++) flWidth[i]=0; - CalcDipWidth(m_nScaleThinGrid, flWidth, 1.2, x1, x2, 1.); - - - QPen pPen(m_crTail,m_nTailWidth); - QBrush cBrushFill(m_crPointFill); - - float flDepthScale,tempf,flVal; - int nPointNum=0,tempi; - QRectF rt,rtRect; - float dgtord,dr; - for(int i=0;i<50;i++) flWidth[i]=0; - if(m_Value==0 || m_Value2==0) - { - Refurbish(); - } - if ( m_Value==0 || m_Value2==0 ) - return ; - - dgtord=3.14159265/180.; - - CalcDipWidth(9, flWidth, 1.2, 0, iMyWidth, 1); - - - while ( 1) - { - dep = m_SDep + k * m_Rlev; - if ( dep >m_EDep ) - break; - - if(dep m_RightVal || flVal < m_LeftVal ) - { - k++; - continue; - } - - tempi = (int)( flVal /10.); - - tempf = 0.; - for (j=0; jsetPen(pPen);// [5/22/2019 9:43 hxb] - // rtRect.setLeft(x - GetLineWidth(pDC,m_nRadius)); - // rtRect.setRight(x + GetLineWidth(pDC,m_nRadius)); - // rtRect.setBottom(y +GetLineWidth(pDC,m_nRadius)); - // rtRect.setTop(y -GetLineWidth(pDC,m_nRadius)); - // pDC->setPen(PenCircle); - // pDC->drawEllipse(rtRect.center(),m_nRadius,m_nRadius); - - // QCPItemEllipse *qcpItemEllipse = new QCPItemEllipse(widget); - // qcpItemEllipse->setPen(pPen); - // qcpItemEllipse->m_bCustom = true; - // qcpItemEllipse->m_nRadius = m_nRadius; - // qcpItemEllipse->topLeft->setCoords(y, x);//圆心位置 - // qcpItemEllipse->bottomRight->setCoords(y, x);//圆心位置 - // qcpItemEllipse->setBrush(cBrushFill);//填充圆的颜色 - - - //方位 - dang = GetData(m_Curve.RepCode,(char *)&m_Value[i*m_Curve.CodeLen]);//DDIR - dr=dang*dgtord; - //dx=abs(lstk*cos(dr)); - // dy=sqrt(lstk*lstk*(1-cos(dr)*cos(dr))); - // // 注意映射方式 - // x +=GetLineWidth(pDC,m_nRadius)*sin(dr); - // y -=GetLineWidth(pDC,m_nRadius)*cos(dr); - // float x1=x +GetLineWidth(pDC,m_nTailLen)*sin(dr); - // float y1=y -GetLineWidth(pDC,m_nTailLen)*cos(dr); - // pDC->setPen(pPen); - // pDC->drawLine(QPointF(x,y),QPointF(x1,y1)); - - QCPItemLine *qcpItemLine = new QCPItemLine(widget); - qcpItemLine->start->setCoords(y, x);//圆心位置 - qcpItemLine->end->setCoords(y, x);//圆心位置 - qcpItemLine->setPen(pPen); - qcpItemLine->m_bCustom = true; - qcpItemLine->m_nTailLen = m_nSltk; //杆长 - qcpItemLine->m_nRadius = 0; //半径 - qcpItemLine->m_dr = dr; - QCPItemLine *qcpItemLine1 = new QCPItemLine(widget); - qcpItemLine1->start->setCoords(y, x);//圆心位置 - qcpItemLine1->end->setCoords(y, x);//圆心位置 - qcpItemLine1->setPen(pPen); - qcpItemLine1->m_bCustom = true; - qcpItemLine1->m_nTailLen = m_nSltk; //杆长 - qcpItemLine1->m_nRadius = 0; //半径 - qcpItemLine1->m_dr = dr+PI; - - //移动对象 - // widget->mSizeHandleManager->addItem(qcpItemEllipse, true); - // widget->mSizeHandleManager->addItem(qcpItemLine, true); - - k++; - } -} - //read config file: FRAC.CFG,save info into m_FracDef void FormDraw::ReadFracDef() diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index 0bba313..c04a2d6 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -150,10 +150,12 @@ public: //表格曲线 void initKedou(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "蝌蚪图", QColor newlineColor=QColor(0,0,0), QJsonObject listOtherProperty={}); + void initGanzhuang(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);//曲线 - void DrawStck(QMyCustomPlot *widget); + void CalcDipWidth(int nColumn,float *flWidth,float factor,int x1,int x2,float flHoriRatio); void Refurbish(); void DrawJykt(QMyCustomPlot *widget, QString strSlfName); @@ -255,7 +257,7 @@ public slots: void s_handleRectRangeChange(QCPRange newRange); void s_selectionRectAccepted(const QRect &rect, QMouseEvent *event); - void s_addGanZuangTu(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);//杆状图 + void s_addGanZhuangTu(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);//杆状图 //井眼垮塌矢量图 void s_addJykt(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); //井斜方位图 diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 43679c8..71658ec 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -127,8 +127,8 @@ void FormInfo::initProperty_Kedou(QJsonObject obj) // 显示控制 this->m_pl_minInclination = 0; // 最小倾角 this->m_pl_maxInclination = 360; // 最大倾角 - this->m_flGrad1 = 10; // 可信度1 - this->m_flGrad2 = 50; // 可信度2 + this->m_flGrad1 = 1; // 可信度1 + this->m_flGrad2 = 5; // 可信度2 // 显示控制(数据表) this->m_crack_decimal_digits = 2; // 小数位数 @@ -212,6 +212,59 @@ void FormInfo::initProperty_Kedou(QJsonObject obj) } } +void FormInfo::initProperty_Ganzhuang(QJsonObject obj) +{ + if(obj.isEmpty()) + { + // 字体 + + // 曲线选择 + this->m_pl_azimuthCurve = "DDIR"; // 方位曲线 + this->m_pl_inclinationCurve = "DANG"; // 倾角曲线 + this->m_pl_GradCurve = "GRAD"; // 可信度曲线 + + //杆 + this->m_nTailLen = 15; // 尾线长度 + this->m_nTailWidth = 2; // 尾线宽度 + + // 显示控制 + this->m_pl_minInclination = 0; // 最小倾角 + this->m_pl_maxInclination = 90; // 最大倾角 + this->m_flGrad1 = 10; // 可信度1 + this->m_flGrad2 = 50; // 可信度2 + // + this->m_strUnit = "(°)"; + } + else + { + QString strType = obj.value("Type").toString(); + if ("tableObject" == strType) + { + // 字体 + // 名称 + this->m_curveNameFont.fromString(obj["curveNameFont"].toString()); + + // 曲线选择 + this->m_pl_azimuthCurve = obj["m_pl_azimuthCurve"].toString(); // 方位曲线 + this->m_pl_inclinationCurve = obj["m_pl_inclinationCurve"].toString(); // 倾角曲线 + this->m_pl_GradCurve = obj["m_pl_GradCurve"].toString(); // 可信度曲线 + + //杆 + this->m_nTailLen = obj["m_nTailLen"].toDouble(); // 尾线长度 + this->m_nTailWidth = obj["m_nTailWidth"].toDouble(); // 尾线宽度 + this->m_crTail.setNamedColor(obj["m_crTail"].toString());// 尾线颜色 + + // 显示控制 + this->m_pl_minInclination = obj["m_pl_minInclination"].toDouble(); // 最小倾角 + this->m_pl_maxInclination = obj["m_pl_maxInclination"].toDouble(); // 最大倾角 + this->m_flGrad1 = obj["m_flGrad1"].toDouble(); // 可信度1 + this->m_flGrad2 = obj["m_flGrad2"].toDouble(); // 可信度2 + // + this->m_strUnit = obj["Unit"].toString(); // 单位 + } + } +} + void FormInfo::initProperty(QJsonObject obj) { m_vmin = obj.value("vmin").toDouble(); @@ -484,7 +537,6 @@ QJsonObject FormInfo::makeJson() { //蝌蚪图 // 字体 - //rootObj["m_strAliasNameFont"] = this->m_strAliasNameFont.toString(); // 名称 rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 // 数据类型选择 @@ -530,6 +582,29 @@ QJsonObject FormInfo::makeJson() 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; + return rootObj; + } } else if (m_strType == "JiegutextObject") { @@ -1229,6 +1304,21 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.drawText(rect.left(), rect.top()+rect.height()*2/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, QString::number(m_vmin)+" ~ "+QString::number(m_vmax)); } + //蝌蚪图、杆状图 + if(m_strLineName == "FRAC_HOLE.TABLE" || m_strLineName=="GANZHUANG.LINE") + { + int nbay = rect.height() - 5; + + // 显示刻度 + if (m_bShowScale) + { + drawScale_Kedou(painter, rect); + } + QFontMetrics fm2(m_curveUnitFont); + QRect tRect = fm2.boundingRect(m_strUnit); + painter.drawText(rect.width()/2- tRect.width()/2, nbay - 6, m_strUnit); + } + if(m_strLineName == "深度") { QFont oldFont = painter.font(); @@ -1575,6 +1665,28 @@ void FormInfo::drawScale(QPainter& painter, const QRect& rect) } } +void FormInfo::drawScale_Kedou(QPainter& painter, const QRect& rect) +{ + int nbay = rect.height() - 5; + QVector vecScale; + + vecScale << QStringList({ QString::number(m_pl_minInclination) , QString::number(m_pl_maxInclination) }); + + painter.setFont(m_curveScaleFont); + QFontMetrics fm1(m_curveScaleFont); + QRect textRect = fm1.boundingRect(QString::number(m_pl_minInclination, 'f', 0)); + int ntxthei = textRect.height() - 4; + int nyy = nbay - ntxthei * vecScale.size() - 3; + for (int i = 0; i < vecScale.size(); i++) + { + const QStringList& slist = vecScale.at(i); + QRect textRect = fm1.boundingRect(slist.at(1)); + int y = nyy + (i + 1) * ntxthei; + painter.drawText(rect.x() + 3, y, slist.at(0)); + painter.drawText(rect.width() - textRect.width() - 3, y, slist.at(1)); + } +} + void FormInfo::paintClassify(QPainter &painter, int compassCenterY) { // 绘制分类 diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index ffdd2b3..795caef 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -27,6 +27,7 @@ public: void initProperty(QJsonObject obj); void initProperty_Kedou(QJsonObject obj); + void initProperty_Ganzhuang(QJsonObject obj); void paintClassify(QPainter &painter, int compassCenterY); private: @@ -37,6 +38,7 @@ protected: // 绘制刻度 void drawScale(QPainter& painter, const QRect& rect); + void drawScale_Kedou(QPainter& painter, const QRect& rect); public slots: void dragEnterEvent(QDragEnterEvent* event); diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 6b99167..a16cd8b 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -347,6 +347,45 @@ FormInfo* FormTrack::AddKedou(QString strSlfName, QString strWellName, QString s ui->tableWidget->setRowHeight(row, 100); // ui->tableWidget->setCellWidget(row, 0, formInfo); + return formInfo; +} + +FormInfo* FormTrack::AddGanzhuang(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) +{ + if(strLineName == "GANZHUANG.LINE") + { + + } + else + { + return nullptr; + } + + qDebug() << "FormTrack AddGanzhuang"; + + 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->m_strUnit = strUnit; + formInfo->initProperty_Ganzhuang(listOtherProperty); + formInfo->m_strAliasName = strAliasName; + formInfo->m_strScaleType = strScaleType; + formInfo->m_strType = "tableObject"; + 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::setDrawDt(QStringList listdt, QJsonObject obj) diff --git a/logPlus/formtrack.h b/logPlus/formtrack.h index 5bc18f1..2d248c3 100644 --- a/logPlus/formtrack.h +++ b/logPlus/formtrack.h @@ -45,6 +45,7 @@ public: 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* AddKedou(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* AddGanzhuang(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 e2a51bc..7457fe4 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -3667,7 +3667,7 @@ void MainWindowCurve::s_NewGanZhuangTu() QString strSlfName = sret.at(1); //新建道 - emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, "杆状图", "ganzhuangtuObject", nW); + emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, "GANZHUANG.LINE", "ganzhuangtuObject", nW); } void MainWindowCurve::s_roseAc() diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 30cbe69..18a7c58 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -215,6 +215,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeGuanD(QString, QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGuanD(QString, QString, QString, QString, QString, QString, double))); //改变蝌蚪图属性 connect(CallManage::getInstance(), SIGNAL(sig_changeKedouProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeKedouProperty(QString, QString, QString, QString, QString))); + //改变杆状图属性 + connect(CallManage::getInstance(), SIGNAL(sig_changeGanzhuangProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeGanzhuangProperty(QString, QString, QString, QString, QString))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, double fW) @@ -11977,10 +11979,6 @@ void QMyCustomPlot::Draw_Kedou() if (m_bTableData) { ReadFracDef_gaodaofeng(); -// for (int i = 0 ; i < iFracType ; i++) -// { -// m_bTypeDraw[i] = true; -// } ReadData(m_strSlfName, m_strLineName); } else @@ -12247,7 +12245,8 @@ void QMyCustomPlot::DrawDip_Kedou() } bool bFillBrush = true; - if ( m_Value3!=NULL)// && m_Value3 !=0xcdcdcdcd ) + //可信度 + if ( m_Value3!=NULL) { flVal = GetData(m_Curve3.RepCode,(char *)&m_Value3[i*m_Curve3.CodeLen]);//置信度 if ( flVal < m_flGrad1 ) @@ -12337,3 +12336,169 @@ void QMyCustomPlot::s_changeKedouProperty(QString strUuid, QString strSlfName, Q //绘制蝌蚪图 Draw_Kedou(); } + +//改变杆状图属性 +void QMyCustomPlot::s_changeGanzhuangProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) +{ + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + //绘制杆状图 + Draw_Ganzhuang(); +} + +void QMyCustomPlot::Draw_Ganzhuang() +{ + this->clearItems(); + + // + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + + //----------------------------------- + this->m_Value=NULL; + this->m_Value2=NULL; + this->m_Value3=NULL; + // 曲线选择 + this->m_csCurveDDIR = pInfo->m_pl_azimuthCurve; // 方位 曲线名 + this->m_csCurveDANG = pInfo->m_pl_inclinationCurve;//倾角 + this->m_csCurveGrad = pInfo->m_pl_GradCurve; // 可信度曲线 + //蝌蚪符号 + this->m_nTailLen = pInfo->m_nTailLen; // 尾线长度 + this->m_nTailWidth = pInfo->m_nTailWidth; // 尾线宽度 + this->m_crTail = pInfo->m_crTail; // 尾线颜色 + + // 显示控制 + this->m_pl_minInclination = pInfo->m_pl_minInclination; // 最小倾角 + this->m_pl_maxInclination = pInfo->m_pl_maxInclination; // 最大倾角 + this->m_flGrad1 = pInfo->m_flGrad1; //可信度1 + this->m_flGrad2 = pInfo->m_flGrad2; //可信度2 + + //读数据 + this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve); + this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2); + this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3); + + float flWidth[50]; + int l; + float dep; + int m_nScaleThinGrid=10; + float lstk=2; + float dang,ddir; + float dg,dy,dx; + // 计算位置 + int iMyWidth = this->axisRect(0)->width(); + float x1 = 0; + float x2 = iMyWidth; + float x=0,y=0; + int j=0,i=0,k=0; + float flTemp=0; + for(int i=0;i<50;i++) flWidth[i]=0; + CalcDipWidth(m_nScaleThinGrid, flWidth, 1.2, x1, x2, 1.); + + + QPen pPenTail(m_crTail,m_nTailWidth); + + float flDepthScale,tempf,flVal; + int nPointNum=0,tempi; + QRectF rt,rtRect; + float dgtord,dr; + for(int i=0;i<50;i++) flWidth[i]=0; + if(m_Value==0 || m_Value2==0) + { + Refurbish(); + } + if ( m_Value==0 || m_Value2==0 ) + return ; + + dgtord=3.14159265/180.; + + CalcDipWidth(9, flWidth, 1.2, 0, iMyWidth, 1); + + + while ( 1) + { + dep = m_SDep + k * m_Rlev; + if ( dep >m_EDep ) + break; + + if(dep m_flGrad2 ) + { + k++; + continue; + } + } + + flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[i*m_Curve2.CodeLen]);//DANG + if ( flVal > m_pl_maxInclination || flVal < m_pl_minInclination ) + { + k++; + continue; + } + + tempi = (int)( flVal /10.); + + tempf = 0.; + for (j=0; jstart->setCoords(y, x);//圆心位置 + qcpItemLine->end->setCoords(y, x);//圆心位置 + qcpItemLine->setPen(pPenTail); + qcpItemLine->m_bCustom = true; + qcpItemLine->m_nTailLen = m_nTailLen/2.0; //杆长 + qcpItemLine->m_nRadius = 0; //半径 + qcpItemLine->m_dr = dr; + // + QCPItemLine *qcpItemLine1 = new QCPItemLine(this); + qcpItemLine1->start->setCoords(y, x);//圆心位置 + qcpItemLine1->end->setCoords(y, x);//圆心位置 + qcpItemLine1->setPen(pPenTail); + qcpItemLine1->m_bCustom = true; + qcpItemLine1->m_nTailLen = m_nTailLen/2.0; //杆长 + qcpItemLine1->m_nRadius = 0; //半径 + qcpItemLine1->m_dr = dr+PI; + + k++; + } + this->replot(); +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index d09d6fc..d544d27 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -677,6 +677,9 @@ public slots: //改变蝌蚪图属性 void s_changeKedouProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //改变杆状图属性 + void s_changeGanzhuangProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + public: //蝌蚪图重绘网格线 bool mKedou = false; @@ -748,6 +751,9 @@ public: void ReadFracDef_gaodaofeng(); + //杆状图 + void Draw_Ganzhuang(); + private: };