From a46d3e9ba69c3ebb3e4f164bec6764300ff140b1 Mon Sep 17 00:00:00 2001 From: crqiqi77 Date: Wed, 8 Apr 2026 16:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AB=E7=91=B0=E5=9B=BE=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 4 +- logPlus/PropertyWidget.cpp | 112 +++++- logPlus/formdraw.cpp | 794 +++++++++++++------------------------ logPlus/formdraw.h | 8 +- logPlus/forminfo.cpp | 141 +++++-- logPlus/forminfo.h | 35 +- logPlus/qmycustomplot.cpp | 559 ++++++++++++++++++++++++-- logPlus/qmycustomplot.h | 18 +- 8 files changed, 1041 insertions(+), 630 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 71c9567..7c47da5 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -182,8 +182,10 @@ signals: //改变深度属性 void sig_changeDepthProperty(QVariantList vlist); - //改变频率统计图属性 + // 改变频率统计图属性 void sig_changePlObjectProperty(QVariantMap variantMap); + // 改变玫瑰图属性 + void sig_changeRoseProperty(QVariantMap variantMap); //改变岩心分析 void sig_changeCorePhysicsProperty(QVariantMap variantMap); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 69d1a37..4a60479 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -165,7 +165,7 @@ void PropertyWidget::changedYxzpProperty(QtProperty *qtProperty, const QVariant } } } - else if("例区高度" == m_propertyData[qtProperty]) + else if("例区高度(cm)" == m_propertyData[qtProperty]) { int temp = variant.toInt(); this->m_formInfo->m_headHeight = temp; @@ -292,7 +292,7 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV m_formInfo->m_curveNameFont = newFont; m_formInfo->update(); } - else if("例区高度" == m_propertyData[qtProperty]) + else if("例区高度(cm)" == m_propertyData[qtProperty]) { int temp = variant.toInt(); this->m_formInfo->m_headHeight = temp; @@ -3454,7 +3454,7 @@ void PropertyWidget::initImageProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int); + _CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int); _CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); _CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font); @@ -3488,7 +3488,7 @@ void PropertyWidget::initImageItemProperty(TransparentDraggableImage* tdImage, d _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); - _CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int); + _CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int); _CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); _CreateVariantPropertyItem("通常", "字体", formInfo->m_curveNameFont, QVariant::Font); @@ -3547,7 +3547,7 @@ void PropertyWidget::initGeoLithProperty(FormInfo *formInfo) void PropertyWidget::initCorePhysicsProperty(FormInfo *formInfo, bool isItem) { _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); - _CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int); + _CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int); _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); _CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -3633,9 +3633,9 @@ void PropertyWidget::initCorePhysicsItemProperty(TransparentDraggableCorePhysics this->initCorePhysicsProperty(formInfo, true); - _CreateVariantPropertyItem("当前项", "序号", tdImage->getCpOrder(), QVariant::Int); - _CreateVariantPropertyItem("当前项", "深度", tdImage->getCpDepth(), QVariant::Double); - _CreateVariantPropertyItem("当前项", "校正深度", tdImage->getCpCorrDepth(), QVariant::Double); + _CreateVariantPropertyItem("当前项", "序号", qAbs(tdImage->getCpOrder()), QVariant::Int); + _CreateVariantPropertyItem("当前项", "深度", qAbs(tdImage->getCpDepth()), QVariant::Double); + _CreateVariantPropertyItem("当前项", "校正深度", qAbs(tdImage->getCpCorrDepth()), QVariant::Double); _CreateVariantPropertyItem("当前项", "数值", tdImage->getCpCoreValue(), QVariant::Double); } // 当前属性类型 @@ -4181,7 +4181,7 @@ void PropertyWidget::initPlObjectProperty(FormInfo *formInfo) _CreateVariantPropertyItem("数据", "方位曲线", formInfo->m_pl_azimuthCurve, QVariant::String); _CreateVariantPropertyItem("数据", "倾角曲线", formInfo->m_pl_inclinationCurve, QVariant::String); - _CreateVariantPropertyItem("通常", "例区高度", formInfo->m_headHeight, QVariant::Int); + _CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int); _CreateVariantPropertyItem("字体", "名称", formInfo->m_strAliasNameFont, QVariant::Font); _CreateVariantPropertyItem("字体", "单位", formInfo->m_strUnitFont, QVariant::Font); @@ -4243,6 +4243,7 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa else if ("数据类型" == strProperty) { this->m_formInfo->m_pl_dataType = varVal.toInt(); + flag = true; } else if ("显示单位" == strProperty) { @@ -4252,10 +4253,12 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa else 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 ("例区高度(cm)" == strProperty) { @@ -4446,6 +4449,13 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa 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_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; @@ -4550,6 +4560,7 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal) else if ("数据类型" == strProperty) { this->m_formInfo->m_pl_dataType = varVal.toInt(); + flag = true; } else if ("显示单位" == strProperty) { @@ -4559,10 +4570,12 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal) else 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 ("例区高度(cm)" == strProperty) @@ -4684,11 +4697,89 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal) { this->m_formInfo->m_pl_custom2 = varVal.toBool(); } + // 表数据 + else if ("深度字段" == strProperty) + { + this->m_formInfo->m_rose_depth_field = varVal.toString(); + } + else if ("方位字段" == strProperty) + { + this->m_formInfo->m_rose_azimuth_field = varVal.toString(); + } + else if ("倾角字段" == strProperty) + { + this->m_formInfo->m_rose_dip_field = varVal.toString(); + } + else if ("属性字段" == strProperty) + { + this->m_formInfo->m_rose_attribute_field = varVal.toString(); + } // 玫瑰图 + else if ("扇形" == strProperty) + { + this->m_formInfo->m_rose_sector_enabled = varVal.toInt(); + } + else if ("圆半径(cm)" == strProperty) + { + this->m_formInfo->m_rose_circle_radius_cm = varVal.toInt(); + } + else if ("辐射圈" == strProperty) + { + this->m_formInfo->m_rose_radiation_circle_enabled = varVal.toInt(); + } + else if ("方位打印间隔" == strProperty) + { + this->m_formInfo->m_rose_azimuth_print_interval = varVal.toInt(); + } + else if ("圆线颜色" == strProperty) + { + this->m_formInfo->m_rose_circle_line_color = varVal.value(); + } + else if ("圆线宽度" == strProperty) + { + this->m_formInfo->m_rose_circle_line_width = varVal.toInt(); + } + else if ("应力线颜色" == strProperty) + { + this->m_formInfo->m_rose_stress_line_color = varVal.value(); + } + else if ("垮塌线颜色" == strProperty) + { + this->m_formInfo->m_rose_collapse_line_color = varVal.value(); + } + else if ("绘制辐射线?" == strProperty) + { + this->m_formInfo->m_rose_draw_radiation_line = varVal.toBool(); + } + else if ("绘制井眼垮塌" == strProperty) + { + this->m_formInfo->m_rose_draw_wellbore_collapse = varVal.toBool(); + } + else if ("是否填充" == strProperty) + { + this->m_formInfo->m_rose_fill_enabled = varVal.toBool(); + } + else if ("是否绘制标注?" == strProperty) + { + this->m_formInfo->m_rose_draw_annotation = varVal.toBool(); + } 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; @@ -4713,7 +4804,6 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal) variantMap["m_pl_maxInclination"] = this->m_formInfo->m_pl_maxInclination; variantMap["m_strUuid"] = this->m_formInfo->m_strUuid; - variantMap["m_strTrackName"] = this->m_formInfo->m_strTrackName; - emit CallManage::getInstance()->sig_changePlObjectProperty(variantMap); + emit CallManage::getInstance()->sig_changeRoseProperty(variantMap); } } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index a55a1e5..40ff124 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -311,28 +311,34 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) } else if("plObject" == strType) // 频率统计图 { - initFgrq(curv); - // 读json后 重新设置样式 // 设置左侧显示属性 设置界面样式 if(pInfo->m_strUnit.isEmpty()){ pInfo->m_strUnit = "(°)"; pInfo->m_strUnitFont = QFont("微软雅黑", 8); } - // 例区高度 - pInfo->setFixedHeight(pInfo->m_headHeight); + this->initFgrq(curv); + + // 数据 + int dataType = pInfo->m_pl_dataType; // 数据类型 + QString azimuthCurve = pInfo->m_pl_azimuthCurve; // 方位曲线 + QString inclinationCurve = pInfo->m_pl_inclinationCurve; // 倾角曲线 + // 通常 + pInfo->setFixedHeight(pInfo->m_headHeight); // 例区高度 + // 控制曲线 QString csCurveGrad = pInfo->m_pl_controlCurveName; double LeftVal3 = pInfo->m_pl_controlMinValue; double RightVal3 = pInfo->m_pl_controlMaxValue; + // 方位频率 int nArc = pInfo->m_pl_sectorCount; double nR = pInfo->m_pl_circleRadius; QColor crArc = pInfo->m_pl_circleColor; int nArcLineWidth = pInfo->m_pl_circleLineWidth; bool bFill = pInfo->m_pl_isFillEnabled; QColor crFill = pInfo->m_pl_fillColor; - // 线数 - int lineNumber = pInfo->m_pl_lineNumber; + // 倾角频率 + int lineNumber = pInfo->m_pl_lineNumber; // 线数 // 统计线高度 double lineHeight = pInfo->m_pl_lineHeight; // 线粗细 @@ -350,7 +356,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) int statInterval = pInfo->m_pl_statInterval; // 统计间隔 double minInclination = pInfo->m_pl_minInclination; // 最小倾角 double maxInclination = pInfo->m_pl_maxInclination; // 最大倾角 - curv->fgrqDraw(csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill, + curv->drawFgrq(dataType, azimuthCurve, inclinationCurve, csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill, lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram, baselineWidth, baselineColor, statInterval, minInclination, maxInclination); } @@ -358,7 +364,20 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) { pInfo->m_pl_azimuthCurve = "STRDIR"; // 方位曲线 pInfo->m_pl_inclinationCurve = "CALM"; // 倾角曲线 - initRose(curv); + if(pInfo->m_strUnit.isEmpty()){ + pInfo->m_strUnit = "(°)"; + pInfo->m_strUnitFont = QFont("微软雅黑", 8); + } + + this->initRose(curv); + + // 数据 + int dataType = pInfo->m_pl_dataType; // 数据类型 + QString azimuthCurve = pInfo->m_pl_azimuthCurve; // 方位曲线 + QString inclinationCurve = pInfo->m_pl_inclinationCurve; // 倾角曲线 + +// curv->drawRose(dataType, azimuthCurve, inclinationCurve); + } else if("dcaObject" == strType) @@ -502,20 +521,16 @@ void FormDraw::DisplayLines(QJsonArray linesArray) //套管组件 DisplayTubing_One(lineObjInfo); } - else if (strType == "depthObject") - { - // 深度 - DisplayDepth_One(lineObjInfo); - } else if (strType == "SantuyibiaoObject") { // 斜井三图一表属性 DisplayTvd_One(lineObjInfo); } - else if (strType == "plObject") + // 深度 频率统计图 玫瑰图 + else if (strType == "depthObject" || strType == "plObject" || strType == "roseObject") { // 频率统计图 - displayPlObject(lineObjInfo); + DisplayType_One(lineObjInfo); } else { @@ -527,37 +542,6 @@ void FormDraw::DisplayLines(QJsonArray linesArray) } } -void FormDraw::displayPlObject(QJsonObject objInfo) -{ - QString strType = objInfo.value("Type").toString(); - QString strLineName = objInfo.value("LineName").toString(); - - QStringList dt; - dt << m_strUuid; - dt << m_strWellName; - dt << m_strSlfName; - dt << strLineName; - dt << strType; - dt << QString::number(m_nTrackW); - this->setDrawData(dt, objInfo); -} - -// 深度 -void FormDraw::DisplayDepth_One(QJsonObject objInfo) -{ - QString strType = objInfo.value("Type").toString(); - QString strLineName = objInfo.value("LineName").toString(); - - QStringList dt; - dt << m_strUuid; - dt << m_strWellName; - dt << m_strSlfName; - dt << strLineName; - dt << strType; - dt << QString::number(m_nTrackW); - this->setDrawData(dt, objInfo); -} - // 岩心分析 void FormDraw::displayCorePhysics(QJsonObject jsonObject) { @@ -5983,16 +5967,32 @@ void FormDraw::initFgrq(QMyCustomPlot *widget) widget->yAxis = xAxis; } -void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_RightVal3) + +void FormDraw::initRose(QMyCustomPlot *widget) { -// widget->clearGraphs(); -// widget->clearItems(); + widget->m_iX1 = 0; + widget->m_iX2 = 1024; + widget->m_iY1 = m_iY1; + widget->m_iY2 = m_iY2; + // + widget->xAxis->setRange(widget->m_iX1, widget->m_iX2); + widget->yAxis->setRange(m_iY1, m_iY2); + + //对调XY轴,在最前面设置 + QCPAxis *yAxis = widget->yAxis; + QCPAxis *xAxis = widget->xAxis; + widget->xAxis = yAxis; + widget->yAxis = xAxis; + + + + // // if(m_Value == NULL) // { // m_bTableData = false; // 表格 曲线 -// m_csCurveDDIR = "DDIR"; // 方位 曲线名 -// m_csCurveDANG = "DANG";//倾角 +// m_csCurveDDIR = "STRDIR"; // 方位 曲线名 +// m_csCurveDANG = "CALM";//倾角 // m_csCurveGrad = "GRAD"; // m_qsTable="FRAC_HOLE.TABLE"; @@ -6004,7 +6004,7 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right // Refurbish(); // } -// double nR = 50; +// double nR = 40; // QPen wPen(Qt::black, 2); // double centerX = widget->m_iX2/2; @@ -6013,6 +6013,8 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right // float x,y,x1,y1,x2,y2; // float ifdir[360]; // int m_nArc = 36; +// float m_LeftVal3 = 0; +// float m_RightVal3 = 100.0; // m_LeftVal = 0.0f; // m_RightVal = 90.0f; // float mind=min(m_RightVal , m_LeftVal); @@ -6021,7 +6023,7 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right // float deps; -// float ftmpSdep = m_SDep; +// float ftmpSdep = 2890;//m_SDep; // float ftmpEdep = m_EDep; // if (m_bTableData) // { @@ -6041,6 +6043,15 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right // int tmp = ftmpSdep / nstep; // float flDep = tmp * nstep; +// double pi = 3.1415926535; +// // 射线 +// bool m_bGrid = true; +// // 井眼垮塌 +// bool m_bJykt = true; +// // 标注 +// bool m_bHint = true; +// int m_nAzimStep = 3; + // m_Curve.DepLevel = 0.5; // while ( 1) // { @@ -6049,6 +6060,8 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right // double tempf = flDep+(float)(nstep)/2.; // double centerY = tempf * -1.0; +// wPen.setWidth(2); +// wPen.setColor(Qt::black); // QCPItemEllipse* pEse = new QCPItemEllipse(widget); // pEse->setPen(wPen); // pEse->m_bCustom = true; @@ -6068,517 +6081,248 @@ void FormDraw::fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_Right // pLine1->end->setCoords(centerY,centerX); // } +// // 写标注 +// if ( m_bHint ) +// { +// int psize = 10; +// flVal = m_nAzimStep*360./m_nArc; +// for (int i=0 ;i<360; i+=(int)(flVal)) +// { +// QCPItemText* mItemTitle = new QCPItemText(widget); +// mItemTitle->position->setCoords(centerY,centerX); +// mItemTitle->setText(QString::number(i)); +// //mItemTitle->setBrush(QBrush(Qt::red)); +// mItemTitle->setFont(QFont("Arial", 10)); +// mItemTitle->setColor(Qt::black); + +// dr = i*2* 3.1415926535/ 360.; +// mItemTitle->m_fx = (nR+psize*0.85)*sin(dr); +// mItemTitle->m_fy = (nR+psize*0.85)*cos(dr); +// mItemTitle->m_bCustom = true; +// } + +// } + +// if(m_bGrid) +// { +// wPen.setWidth(1); + +// double st = 360/m_nArc; +// for(int i = 0; i < m_nArc; i++) +// { +// int ntmp = i % 9; +// if(ntmp != 0) +// { +// QCPItemLine* pLine = new QCPItemLine(widget); +// pLine->m_bCustom = true; +// pLine->m_dr = qDegreesToRadians(i * st); +// pLine->m_nRadius = 0; +// pLine->m_nTailLen=nR; +// pLine->setPen(wPen); +// pLine->start->setCoords(centerY,centerX); +// pLine->end->setCoords(centerY,centerX); +// } +// } +// } + // for(int i=0;i<=m_nArc;i++) ifdir[i]=0.; // x1 = 360./m_nArc; // int i = 0; -// if (m_bTableData) +// while ( 1 ) // { -// int m_nLine = 9; -// y1 = (maxd-mind)/m_nLine;//线数 -// for (i=0; i= ftmpEdep|| +// deps > m_Curve.EndDepth|| +// deps >=( flDep + nstep)) +// break; +// if(tempf<0) // { -// const FRAC_TABLE& frac = m_FracTabList.at(i); -// if ( frac.DEP < 0 ) continue; -// bool bDraw = false; -// for (int j=0; j= flDep &&deps < (flDep+ nstep) ) -// { -// flVal = frac.DIR;//方位 -// int j = flVal/x1; -// if ( j >= 0 && j< m_nArc+1 ) -// ifdir[j] ++; - -// flVal = frac.DIPorS;//倾角 -// //按倾角范围统计 -// if(flVal> maxd || flVal < mind) -// { -// //i++; -// continue; -// } -// // j = (flVal-mind)/y1;//j = flVal/y1+1; -// // if ( j >= 0 && j< m_nLine+1 ) -// // ifdir[j] ++; -// } +// i++; +// continue; // } -// } -// else -// { -// while ( 1 ) -// { -// deps = flDep + i * m_Curve.DepLevel; -// tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5; -// if (deps >= ftmpEdep|| -// deps > m_Curve.EndDepth|| -// deps >=( flDep + nstep)) -// break; -// if(tempf<0) +// if (m_Value3 !=NULL )// for 控制曲线 +// { +// float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5; +// if(tempf3<0) // { // i++; // continue; // } - -// if (m_Value3 !=NULL )// for 控制曲线 -// { -// float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5; -// if(tempf3<0) -// { -// i++; -// continue; -// } -// double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]); -// if(gradm_RightVal3){i++;continue;} -// } - -// flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]); -// flVal=fmod(flVal,360.f); -// int j = flVal/x1; -// if ( j >= 0 && j< m_nArc+1 ) -// ifdir[j] ++; - +// double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]); +// if(gradm_RightVal3){i++;continue;} +// } +// if (m_Value2 !=NULL ) // 倾角控制 +// { // tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5; -// if(tempf<0 ) -// { -// i++; -// continue; -// } - +// flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]); // //按倾角范围统计 -// if(flVal> maxd || flVal < mind) +// if(flVal > maxd || flVal < mind) // { // i++; // continue; // } -// i ++; // } + +// tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5; +// flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]); +// if(flVal<0) +// { +// i++; +// continue; +// } +// flVal=fmod(flVal,360.f); +// int j = flVal/x1; +// if ( j >= 0 && j< m_nArc+1 ) +// ifdir[j] ++; +// i ++; // } -// flVal = 3.1415926535 *2./ m_nArc ; -// dirmax=0; dipmax=0; +// dirmax=0; +// int iIndex = -1; // for(i=0;i<=m_nArc;i++) -// if (dirmax=m_nArc ) +// dr=0.; +// else +// dr=(i+1)*flVal; + +// dr=(i+1)*flVal; +// float x2 = ifdir[i]*nR*sin(dr)/dirmax; +// float y2 = ifdir[i]*nR*cos(dr)/dirmax; + +// if(oldx != x2 || oldy != y2) +// { +// myPolygon << QPointF(x2, y2); +// oldx = x2; +// oldy = y2; +// } +// } +// // pt[2*m_nArc+2] = pt[0]; + +// if (iIndex >=0/*&&m_bFill*/ ) +// { +// x = centerY; +// y = centerX; // QCPItemPolygon* pol = new QCPItemPolygon(widget); // pol->topLeft->setCoords(x, y); // pol->bottomRight->setCoords(x, y); - -// // pol->setPloyVal(i,flVal, ifdir[i]); - -// float dr=i*flVal; -// float x1 = ifdir[i]*sin(dr); -// float y1 = ifdir[i]*cos(dr); -// dr=(i+1)*flVal; -// float x2 = ifdir[i]*sin(dr); -// float y2 = ifdir[i]*cos(dr); - -// QPolygonF myPolygon; -// myPolygon << QPointF(0, 0); -// myPolygon << QPointF(x1, y1); -// myPolygon << QPointF(x2, y2); -// myPolygon << QPointF(0, 0); // pol->setPoints(myPolygon); +// pol->setBrushColor(QColor(255,170,0)); +// } -// // QCPItemRect* prt = new QCPItemRect(widget); -// // prt->topLeft->setCoords(x, y); -// // prt->bottomRight->setCoords(x, y); +// myPolygon.clear(); +// tempf = m_nArc/2.; +// for (i=0 ;i<=m_nArc; i++) +// { +// dr=i*flVal; +// dr = dr-tempf*flVal; +// float x1 = ifdir[i]*nR*sin(dr)/dirmax; +// float y1 = ifdir[i]*nR*cos(dr)/dirmax; + +// if(oldx != x1 || oldy != y1) +// { +// myPolygon << QPointF(x1, y1); +// oldx = x1; +// oldy = y1; +// } + +// if ( i >=m_nArc ) +// dr=0.; +// else +// dr=(i+1)*flVal; +// dr = dr-tempf*flVal; +// float x2 = ifdir[i]*nR*sin(dr)/dirmax; +// float y2 = ifdir[i]*nR*cos(dr)/dirmax; +// if(oldx != x2 || oldy != y2) +// { +// myPolygon << QPointF(x2, y2); +// oldx = x2; +// oldy = y2; +// } +// } +// if (iIndex >=0/*&&m_bFill*/ ) +// { +// x = centerY; +// y = centerX; +// QCPItemPolygon* pol = new QCPItemPolygon(widget); +// pol->topLeft->setCoords(x, y); +// pol->bottomRight->setCoords(x, y); +// pol->setPoints(myPolygon); +// pol->setBrushColor(QColor(255,170,0)); +// } + + +// if ( m_bJykt && iIndex >=0 ) +// { +// // 绘制垮塌方向 +// dr=iIndex*flVal; +// dr = dr-pi/2;//9*flVal; +// x1 = ifdir[iIndex]*nR*sin(dr)/dirmax; +// y1 = ifdir[iIndex]*nR*cos(dr)/dirmax; + +// dr=iIndex*flVal; +// dr = dr+pi/2; +// x2 = ifdir[iIndex]*nR*sin(dr)/dirmax; +// y2 = ifdir[iIndex]*nR*cos(dr)/dirmax; + +// wPen.setWidth(2); +// wPen.setColor(QColor(0,85,255)); +// this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen); + +// dr=iIndex*flVal; +// float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax; +// float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax; +// this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen); +// this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen); + +// dr=iIndex*flVal; +// dr = dr-pi;//18*flVal;//m1_nArc*flVal/2; +// x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax; +// y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax; + +// this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen); +// this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen); -// // if(m_bFill) -// // { -// // QPainterPath myPath; -// // myPath.addPolygon(myPolygon); -// // pDC->fillPath(myPath,textBrushFill); -// // } -// // if(m_nArcLineWidth>=1) -// // { -// // pDC->setPen(pPenArc); -// // // pDC->drawPolygon(myPolygon); -// // } // } // flDep += nstep; // } -} - - -void FormDraw::initRose(QMyCustomPlot *widget) -{ - widget->m_iX1 = 0; - widget->m_iX2 = 1024; - widget->m_iY1 = m_iY1; - widget->m_iY2 = m_iY2; - // - widget->xAxis->setRange(widget->m_iX1, widget->m_iX2); - widget->yAxis->setRange(m_iY1, m_iY2); - - //对调XY轴,在最前面设置 - QCPAxis *yAxis = widget->yAxis; - QCPAxis *xAxis = widget->xAxis; - widget->xAxis = yAxis; - widget->yAxis = xAxis; - - - // if(m_Value == NULL) - { - m_bTableData = false; // 表格 曲线 - m_csCurveDDIR = "STRDIR"; // 方位 曲线名 - m_csCurveDANG = "CALM";//倾角 - m_csCurveGrad = "GRAD"; - - m_qsTable="FRAC_HOLE.TABLE"; - m_qsDIR=("DDIR"); // 方位 曲线名 - m_qsDIP=("DANG");//倾角 - m_qsDepth="DEPT"; - m_qsID = "ID"; - - Refurbish(); - } - - double nR = 40; - - QPen wPen(Qt::black, 2); - double centerX = widget->m_iX2/2; - - float flVal = 0.0f; - float x,y,x1,y1,x2,y2; - float ifdir[360]; - int m_nArc = 36; - float m_LeftVal3 = 0; - float m_RightVal3 = 100.0; - m_LeftVal = 0.0f; - m_RightVal = 90.0f; - float mind=min(m_RightVal , m_LeftVal); - float maxd=max(m_RightVal , m_LeftVal); - float dirmax,dipmax,dr; - - float deps; - - float ftmpSdep = 2890;//m_SDep; - float ftmpEdep = m_EDep; - if (m_bTableData) - { - ReadFracDef(); - for (int i = 0 ; i < iFracType ; i++) - { - m_bTypeDraw[i] = true; - } - - ftmpSdep = -m_iY2; - ftmpEdep = -m_iY1; - } - - int nPointNum = m_FracTabList.count(); - int n = m_FracDefList.count(); - int nstep = 5; - int tmp = ftmpSdep / nstep; - float flDep = tmp * nstep; - - double pi = 3.1415926535; - // 射线 - bool m_bGrid = true; - // 井眼垮塌 - bool m_bJykt = true; - // 标注 - bool m_bHint = true; - int m_nAzimStep = 3; - - m_Curve.DepLevel = 0.5; - while ( 1) - { - if((flDep>=ftmpEdep+nstep)||flDep>=ftmpEdep)break; - - double tempf = flDep+(float)(nstep)/2.; - double centerY = tempf * -1.0; - - wPen.setWidth(2); - wPen.setColor(Qt::black); - QCPItemEllipse* pEse = new QCPItemEllipse(widget); - pEse->setPen(wPen); - pEse->m_bCustom = true; - pEse->m_nRadius = nR; - pEse->topLeft->setCoords(centerY, centerX); - pEse->bottomRight->setCoords(centerY, centerX); - - for(int k = 0; k < 4; k++) - { - QCPItemLine* pLine1 = new QCPItemLine(widget); - pLine1->m_bCustom = true; - pLine1->m_dr = qDegreesToRadians(k*90.0); - pLine1->m_nRadius = 0; - pLine1->m_nTailLen=nR; - pLine1->setPen(wPen); - pLine1->start->setCoords(centerY,centerX); - pLine1->end->setCoords(centerY,centerX); - } - - // 写标注 - if ( m_bHint ) - { - int psize = 10; - flVal = m_nAzimStep*360./m_nArc; - for (int i=0 ;i<360; i+=(int)(flVal)) - { - QCPItemText* mItemTitle = new QCPItemText(widget); - mItemTitle->position->setCoords(centerY,centerX); - mItemTitle->setText(QString::number(i)); - //mItemTitle->setBrush(QBrush(Qt::red)); - mItemTitle->setFont(QFont("Arial", 10)); - mItemTitle->setColor(Qt::black); - - dr = i*2* 3.1415926535/ 360.; - mItemTitle->m_fx = (nR+psize*0.85)*sin(dr); - mItemTitle->m_fy = (nR+psize*0.85)*cos(dr); - mItemTitle->m_bCustom = true; - } - - } - - if(m_bGrid) - { - wPen.setWidth(1); - - double st = 360/m_nArc; - for(int i = 0; i < m_nArc; i++) - { - int ntmp = i % 9; - if(ntmp != 0) - { - QCPItemLine* pLine = new QCPItemLine(widget); - pLine->m_bCustom = true; - pLine->m_dr = qDegreesToRadians(i * st); - pLine->m_nRadius = 0; - pLine->m_nTailLen=nR; - pLine->setPen(wPen); - pLine->start->setCoords(centerY,centerX); - pLine->end->setCoords(centerY,centerX); - } - } - } - - for(int i=0;i<=m_nArc;i++) ifdir[i]=0.; - x1 = 360./m_nArc; - - int i = 0; - while ( 1 ) - { - deps = flDep + i * m_Curve.DepLevel; - - tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5; - if (deps >= ftmpEdep|| - deps > m_Curve.EndDepth|| - deps >=( flDep + nstep)) - break; - if(tempf<0) - { - i++; - continue; - } - - if (m_Value3 !=NULL )// for 控制曲线 - { - float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5; - if(tempf3<0) - { - i++; - continue; - } - double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]); - if(gradm_RightVal3){i++;continue;} - } - if (m_Value2 !=NULL ) // 倾角控制 - { - tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5; - flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]); - //按倾角范围统计 - if(flVal > maxd || flVal < mind) - { - i++; - continue; - } - } - - tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5; - flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]); - if(flVal<0) - { - i++; - continue; - } - flVal=fmod(flVal,360.f); - int j = flVal/x1; - if ( j >= 0 && j< m_nArc+1 ) - ifdir[j] ++; - i ++; - } - - dirmax=0; - int iIndex = -1; - for(i=0;i<=m_nArc;i++) - { - if (dirmax=m_nArc ) - dr=0.; - else - dr=(i+1)*flVal; - - dr=(i+1)*flVal; - float x2 = ifdir[i]*nR*sin(dr)/dirmax; - float y2 = ifdir[i]*nR*cos(dr)/dirmax; - - if(oldx != x2 || oldy != y2) - { - myPolygon << QPointF(x2, y2); - oldx = x2; - oldy = y2; - } - } - // pt[2*m_nArc+2] = pt[0]; - - if (iIndex >=0/*&&m_bFill*/ ) - { - x = centerY; - y = centerX; - QCPItemPolygon* pol = new QCPItemPolygon(widget); - pol->topLeft->setCoords(x, y); - pol->bottomRight->setCoords(x, y); - pol->setPoints(myPolygon); - pol->setBrushColor(QColor(255,170,0)); - } - - myPolygon.clear(); - tempf = m_nArc/2.; - for (i=0 ;i<=m_nArc; i++) - { - dr=i*flVal; - dr = dr-tempf*flVal; - float x1 = ifdir[i]*nR*sin(dr)/dirmax; - float y1 = ifdir[i]*nR*cos(dr)/dirmax; - - if(oldx != x1 || oldy != y1) - { - myPolygon << QPointF(x1, y1); - oldx = x1; - oldy = y1; - } - - if ( i >=m_nArc ) - dr=0.; - else - dr=(i+1)*flVal; - dr = dr-tempf*flVal; - float x2 = ifdir[i]*nR*sin(dr)/dirmax; - float y2 = ifdir[i]*nR*cos(dr)/dirmax; - if(oldx != x2 || oldy != y2) - { - myPolygon << QPointF(x2, y2); - oldx = x2; - oldy = y2; - } - } - if (iIndex >=0/*&&m_bFill*/ ) - { - x = centerY; - y = centerX; - QCPItemPolygon* pol = new QCPItemPolygon(widget); - pol->topLeft->setCoords(x, y); - pol->bottomRight->setCoords(x, y); - pol->setPoints(myPolygon); - pol->setBrushColor(QColor(255,170,0)); - } - - - if ( m_bJykt && iIndex >=0 ) - { - // 绘制垮塌方向 - dr=iIndex*flVal; - dr = dr-pi/2;//9*flVal; - x1 = ifdir[iIndex]*nR*sin(dr)/dirmax; - y1 = ifdir[iIndex]*nR*cos(dr)/dirmax; - - dr=iIndex*flVal; - dr = dr+pi/2; - x2 = ifdir[iIndex]*nR*sin(dr)/dirmax; - y2 = ifdir[iIndex]*nR*cos(dr)/dirmax; - - wPen.setWidth(2); - wPen.setColor(QColor(0,85,255)); - this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen); - - dr=iIndex*flVal; - float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax; - float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax; - this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen); - this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen); - - dr=iIndex*flVal; - dr = dr-pi;//18*flVal;//m1_nArc*flVal/2; - x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax; - y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax; - - this->addQCPItemLine(widget, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen); - this->addQCPItemLine(widget, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen); - - } - - flDep += nstep; - } } + + void FormDraw::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen) { QPolygonF myPolygon; diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index bed757e..e79f050 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -60,14 +60,11 @@ public: void DisplayLine_One(QJsonObject lineObjInfo); //波列 void DisplayType_One(QJsonObject objInfo); - // 深度 - void DisplayDepth_One(QJsonObject lineObjInfo); + // 岩心分析 void displayCorePhysics(QJsonObject lineObjInfo); // 岩心照片 void displayImageData(QJsonObject lineObjInfo); - // 频率统计图 - void displayPlObject(QJsonObject lineObjInfo); //表格:固井结论等 void DisplayTable_One(QJsonObject lineObjInfo); @@ -235,12 +232,11 @@ public: //深度 void initDepth(QMyCustomPlot *widget); - //频率统计图 void initFgrq(QMyCustomPlot *widget); - void fgrqDraw(QMyCustomPlot *widget, double m_LeftVal3, double m_RightVal3); //玫瑰图 void initRose(QMyCustomPlot *widget); + void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen); // DCA检测 diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 2c7112c..8c2ccf4 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -165,45 +165,6 @@ void FormInfo::initProperty(QJsonObject obj) } else if ("plObject" == strType) { - // 数据名称 - 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_headHeight = obj["m_headHeight"].toInt(); // 例区高度 - - // 名称 - { - QStringList fontParts = obj["m_strAliasNameFont"].toString().split(","); // 按逗号拆分 - if (fontParts.size() >= 2) { - this->m_strAliasNameFont.setFamily(fontParts[0]); // 设置字体名称 - this->m_strAliasNameFont.setPointSize(fontParts[1].toInt()); // 设置字号 - } - } - // 单位 - { - QStringList fontParts = obj["m_strUnitFont"].toString().split(","); // 按逗号拆分 - if (fontParts.size() >= 2) { - this->m_strUnitFont.setFamily(fontParts[0]); // 设置字体名称 - this->m_strUnitFont.setPointSize(fontParts[1].toInt()); // 设置字号 - } - } - // 刻度 - { - QStringList fontParts = obj["m_pl_fontScale"].toString().split(","); // 按逗号拆分 - if (fontParts.size() >= 2) { - this->m_pl_fontScale.setFamily(fontParts[0]); // 设置字体名称 - this->m_pl_fontScale.setPointSize(fontParts[1].toInt()); // 设置字号 - } - } - // this->m_strAliasNameFont = obj["m_strAliasNameFont"]; // 曲线名称 - - this->m_pl_controlCurveName = obj["m_pl_controlCurveName"].toString(); // 曲线名 - this->m_pl_controlMinValue = obj["m_pl_controlMinValue"].toDouble(); // 最小值 - this->m_pl_controlMaxValue = obj["m_pl_controlMaxValue"].toDouble(); // 最大值 - this->m_pl_sectorCount = obj["m_pl_sectorCount"].toInt(); // 扇形 this->m_pl_circleRadius = obj["m_pl_circleRadius"].toDouble(); // 圆半径 this->m_pl_circleColor = QColor(obj["m_pl_circleColor"].toString()); // 圆线颜色 @@ -220,11 +181,63 @@ void FormInfo::initProperty(QJsonObject obj) this->m_pl_baselineWidth = obj["m_pl_baselineWidth"].toInt(); // 宽度 this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色 + } + else if ("roseObject" == strType) + { +// this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色 + } + if ("plObject" == strType || ("roseObject" == strType)) + { + // 数据 + // 数据名称 + 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_headHeight = obj["m_headHeight"].toInt(); // 例区高度 + + // 字体 + { + // 名称 + QStringList fontParts = obj["m_strAliasNameFont"].toString().split(","); // 按逗号拆分 + if (fontParts.size() >= 2) { + this->m_strAliasNameFont.setFamily(fontParts[0]); // 设置字体名称 + this->m_strAliasNameFont.setPointSize(fontParts[1].toInt()); // 设置字号 + } + } + { + // 单位 + QStringList fontParts = obj["m_strUnitFont"].toString().split(","); // 按逗号拆分 + if (fontParts.size() >= 2) { + this->m_strUnitFont.setFamily(fontParts[0]); // 设置字体名称 + this->m_strUnitFont.setPointSize(fontParts[1].toInt()); // 设置字号 + } + } + { + // 刻度 + QStringList fontParts = obj["m_pl_fontScale"].toString().split(","); // 按逗号拆分 + if (fontParts.size() >= 2) { + this->m_pl_fontScale.setFamily(fontParts[0]); // 设置字体名称 + this->m_pl_fontScale.setPointSize(fontParts[1].toInt()); // 设置字号 + } + } + // this->m_strAliasNameFont = obj["m_strAliasNameFont"]; // 曲线名称 + + // 控制曲线 + this->m_pl_controlCurveName = obj["m_pl_controlCurveName"].toString(); // 曲线名 + this->m_pl_controlMinValue = obj["m_pl_controlMinValue"].toDouble(); // 最小值 + this->m_pl_controlMaxValue = obj["m_pl_controlMaxValue"].toDouble(); // 最大值 + + // 统计参数 this->m_pl_statInterval = obj["m_pl_statInterval"].toInt(); // 统计间隔 this->m_pl_minInclination = obj["m_pl_minInclination"].toDouble(); // 最小倾角 this->m_pl_maxInclination = obj["m_pl_maxInclination"].toDouble(); // 最大倾角 + // 分类 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(); // 网状缝 @@ -864,7 +877,7 @@ void FormInfo::paintEvent(QPaintEvent* event) //蝌蚪图,不绘制左右范围 strShowTxt = "蝌蚪图"; } - if(this->m_strType == "plObject") + if(this->m_strType == "plObject" || this->m_strType == "roseObject") { strShowTxt = " "; } @@ -1024,7 +1037,7 @@ void FormInfo::paintEvent(QPaintEvent* event) } // 频率统计图 - if(this->m_strType == "plObject") + if(this->m_strType == "roseObject") { painter.setRenderHint(QPainter::Antialiasing); @@ -1068,6 +1081,52 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.setFont(oldFont); currentY += UNIT_HEIGHT + SPACING; + painter.setFont(oldFont); + } + + if(this->m_strType == "plObject") + { + QRect rect = this->rect(); + int width = rect.width(); + int height = rect.height(); + + // ========== 固定距离配置 ========== + const int NAME_HEIGHT = 30; // 名称区域高度 + const int UNIT_HEIGHT = 25; // 单位区域高度 + const int COMPASS_SIZE = 50; // 指南针区域高度 + const int SPACING = 15; // 元素之间的间距 + + // 计算总占用高度 + int totalContentHeight = NAME_HEIGHT + SPACING + UNIT_HEIGHT + SPACING + COMPASS_SIZE; + + // 垂直居中起始位置 + int startY = (height - totalContentHeight) / 2; + if (startY < 0) startY = 0; + + int currentY = startY; + int centerX = width / 2; + + // ========== 1. 绘制名称(最上面)========== + QFont oldFont = painter.font(); + painter.setFont(this->m_strAliasNameFont); + + QRect nameRect(0, currentY, width, NAME_HEIGHT); + painter.drawText(nameRect, Qt::AlignCenter, this->m_strAliasName); + + painter.setFont(oldFont); + currentY += NAME_HEIGHT + SPACING; + + // ========== 2. 绘制单位(中间)========== + oldFont = painter.font(); + painter.setFont(this->m_strUnitFont); + + QRect unitRect(0, currentY, width, UNIT_HEIGHT); + painter.drawText(unitRect, Qt::AlignCenter, this->m_strUnit); + + painter.setFont(oldFont); + currentY += UNIT_HEIGHT + SPACING; + + // ========== 3. 绘制指南针(最下面)========== oldFont = painter.font(); painter.setFont(this->m_pl_fontScale); diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 8625b30..ade66df 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -298,24 +298,23 @@ public: // 玫瑰图 // 表数据字段 - QString m_rose_depth_field; // 深度字段 - QString m_rose_azimuth_field; // 方位字段 - QString m_rose_dip_field; // 倾角字段 - QString m_rose_attribute_field; // 属性字段 - - // 玫瑰图核心配置 - int m_rose_sector_enabled; // 扇形(启用开关) - int m_rose_circle_radius_cm; // 圆半径(cm) - int m_rose_radiation_circle_enabled; // 辐射圈(启用开关) - int m_rose_azimuth_print_interval; // 方位打印间隔 - QColor m_rose_circle_line_color; // 圆线颜色 - int m_rose_circle_line_width; // 圆线宽度 - QColor m_rose_stress_line_color; // 应力线颜色 - QColor m_rose_collapse_line_color; // 垮塌线颜色 - bool m_rose_draw_radiation_line; // 绘制辐射线? - bool m_rose_draw_wellbore_collapse; // 绘制井眼垮塌 - bool m_rose_fill_enabled; // 是否填充 - bool m_rose_draw_annotation; // 是否绘制标注? + QString m_rose_depth_field = "DEP"; // 深度字段 + QString m_rose_azimuth_field = "DIR"; // 方位字段 + QString m_rose_dip_field = "DIPorS"; // 倾角字段 + QString m_rose_attribute_field = "ID"; // 属性字段 + // 玫瑰图 + int m_rose_sector_enabled = 36; // 扇形(启用开关) + int m_rose_circle_radius_cm = 1; // 圆半径(cm) + int m_rose_radiation_circle_enabled = 9; // 辐射圈(启用开关) + int m_rose_azimuth_print_interval = 3; // 方位打印间隔 + QColor m_rose_circle_line_color = Qt::black; // 圆线颜色 + int m_rose_circle_line_width = 2; // 圆线宽度 + QColor m_rose_stress_line_color = Qt::black; // 应力线颜色 + QColor m_rose_collapse_line_color = Qt::black; // 垮塌线颜色 + bool m_rose_draw_radiation_line = true; // 绘制辐射线? + bool m_rose_draw_wellbore_collapse = true; // 绘制井眼垮塌 + bool m_rose_fill_enabled = true; // 是否填充 + bool m_rose_draw_annotation = true; // 是否绘制标注? int cpLineWidth() const; void setCpLineWidth(int cpLineWidth); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index abf537c..891df09 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -142,8 +142,12 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel // 深度属性修改 connect(CallManage::getInstance(), SIGNAL(sig_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList))); - // 深度属性修改 + // 频率统计图属性修改 connect(CallManage::getInstance(), SIGNAL(sig_changePlObjectProperty(QVariantMap)), this, SLOT(s_changePlObjectProperty(QVariantMap))); + + // 玫瑰图属性修改 + connect(CallManage::getInstance(), SIGNAL(sig_changeRoseProperty(QVariantMap)), this, SLOT(s_changeRoseProperty(QVariantMap))); + connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList))); // 岩心分析 @@ -10040,6 +10044,16 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap) { return; } + // 数据 + int dataType = variantMap["m_pl_dataType"].toInt(); + bool bTableData = false; + if(dataType == 1) + { + bTableData = true; + } + QString azimuthCurve = variantMap["m_pl_azimuthCurve"].toString(); + QString inclinationCurve = variantMap["m_pl_inclinationCurve"].toString(); + // 控制曲线 QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString(); double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble(); double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble(); @@ -10071,13 +10085,14 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap) double maxInclination = variantMap["m_pl_maxInclination"].toDouble(); - this->fgrqDraw(csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill, + this->drawFgrq(dataType, azimuthCurve, inclinationCurve, csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill, lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram, baselineWidth, baselineColor, statInterval, minInclination, maxInclination); } -void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightVal3, int nArc, +void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCurveDANG, + QString csCurveGrad, double LeftVal3, double RightVal3, int nArc, double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill, int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram, int baselineWidth, QColor baselineColor, int nstep, double LeftVal, double RightVal) @@ -10085,11 +10100,12 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV this->clearGraphs(); this->clearItems(); + bool flag = true; // if(m_Value == NULL) { - m_bTableData = false; // 表格 曲线 - m_csCurveDDIR = "DDIR"; // 方位 曲线名 - m_csCurveDANG = "DANG";//倾角 + m_bTableData = bTableData; // 表格 曲线 + this->m_csCurveDDIR = csCurveDDIR; // 方位 曲线名 + this->m_csCurveDANG = csCurveDANG;//倾角 this->m_csCurveGrad = csCurveGrad; m_qsTable="FRAC_HOLE.TABLE"; @@ -10098,7 +10114,11 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV m_qsDepth="DEPT"; m_qsID = "ID"; - Refurbish(); + flag = Refurbish(); + if(!flag) + { + return; + } } // double nR = 50; @@ -10238,7 +10258,6 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]); if(gradRightVal3){i++;continue;} } - flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]); flVal=fmod(flVal,360.f); int j = flVal/x1; @@ -10323,7 +10342,7 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV if(drawAnnotation) { - this->drawDipAngle(centerX, centerY, ifdir, iIndex, dirmax, lineNumber, lineHeight, lineThickness, lineColor, + this->drawDipAngle(centerX, centerY, ifdir, dirmax, lineNumber, lineHeight, lineThickness, lineColor, drawHistogram, baselineWidth, baselineColor, LeftVal, RightVal); } @@ -10334,7 +10353,7 @@ void QMyCustomPlot::fgrqDraw(QString csCurveGrad, double LeftVal3, double RightV this->replot(); } -void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360], int iIndex, float dirmax, +void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360], float dirmax, int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawHistogram, int baselineWidth, QColor baselineColor, double minInclination, double maxInclination) { @@ -10376,35 +10395,39 @@ void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360 scaleLine->start->setCoords(startY, currY); scaleLine->end->setCoords(startY + dynamicLen, currY); // 每个刻度长度不同 } - - - // QRect rect = this->axisRect()->rect(); // qDebug() << centerY << "--==--=-=-=" << centerX << "-----------" << rect; } -void QMyCustomPlot::Refurbish() +bool QMyCustomPlot::Refurbish() { + bool flag = true; if (m_bTableData) { -// ReadData(m_strSlfName, ""); + ReadData(m_strSlfName, ""); } else { - 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); + flag = this->ReadData(m_strSlfName, m_csCurveDDIR, 0, &m_Curve); + if(!flag) + { + return flag; + } + flag = this->ReadData(m_strSlfName, m_csCurveDANG, 1, &m_Curve2); + flag = this->ReadData(m_strSlfName, m_csCurveGrad, 2, &m_Curve3); } + return flag; } -//曲线 -//read curve -void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve) +//曲线 //read curve +bool QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve) { + bool flag = true; // if(strSlfName.isEmpty()) { - return; + flag = false; + return flag; } // 读曲线数值 @@ -10433,7 +10456,11 @@ void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve if (iIndex >= 0) { mrw.GetCurveInfo(iIndex,curve); - if(curve->DepLevel==0) return; + if(curve->DepLevel==0) + { + flag = false; + return flag; + } m_PointNum = (float)(fabs((curve->EndDepth - curve->StartDepth)/curve->DepLevel+0.5)); m_SDep=curve->StartDepth; m_EDep=curve->EndDepth; @@ -10466,7 +10493,493 @@ void QMyCustomPlot::ReadData(QString strSlfName, QString strLineName, int iCurve } mrw.CloseCurve(iIndex); } + else + { + flag = false; + } mrw.Close(); //关闭井文件 } + return flag; +} + +//表格 //for table dip ,read FRAC_HOLE.TABLE +bool QMyCustomPlot::ReadData(QString strSlfName, QString strLineName) +{ + bool flag = true; + QString cs; + int nField,len; + FRAC_TABLE frac; + CMemRdWt mrw; + m_PointNum = 0 ; + char strFracTable[256]; + int i,j,iIndex,nCount,iType=1; + char wellname2[512]; + char *buffer; + Slf_TABLE_FIELD *Table_Field; + char bufField[1024]; + float val; + // + m_FracTabList.clear(); + if(m_qsTable=="AC"|| m_qsTable=="") + { + m_qsTable="FRAC_HOLE.TABLE"; + } + // + if(strSlfName.isEmpty()) + { + flag = false; + return flag; + } + //CString wellname(strSlfName); + if ( mrw.Open(strSlfName.toStdString().c_str()) ) // 打开井文件 + { + //CString strFracTable(m_qsTable); + iIndex = mrw.OpenTable(m_qsTable.toStdString().c_str()); + if (iIndex >= 0) + { + nField = mrw.GetTableFieldCount(iIndex); + Table_Field = new Slf_TABLE_FIELD[nField+1]; + // 读取字段信息 + mrw.GetTableFieldInfo(iIndex, Table_Field); + + // 读取数据记录 + nCount = mrw.GetTableRecordCount(iIndex); + i = mrw.GetTableRecordLength(iIndex); + buffer = new char[i+2]; + m_PointNum = nCount; + + for(i=0; im_strTrackName != strTrackName) + { + return; + } + // 数据 + int dataType = variantMap["m_pl_dataType"].toInt(); + bool bTableData = false; + if(dataType == 1) + { + dataType = true; + } + QString azimuthCurve = variantMap["m_pl_azimuthCurve"].toString(); + QString inclinationCurve = variantMap["m_pl_inclinationCurve"].toString(); + // 表数据 + QString m_rose_depth_field = variantMap["m_rose_depth_field"].toString(); + QString m_rose_azimuth_field = variantMap["m_rose_azimuth_field"].toString(); + QString m_rose_dip_field = variantMap["m_rose_dip_field"].toString(); + QString m_rose_attribute_field = variantMap["m_rose_attribute_field"].toString(); + + this->drawRose(bTableData, azimuthCurve, inclinationCurve, + m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field); +} +void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG, + QString qsDepth, QString qsDIR, QString qsDIP, QString qsID) +{ + bool flag = true; + + this->clearGraphs(); + this->clearItems(); + + double m_LeftVal = 0.0f; + double m_RightVal = 90.0f; + + // if(m_Value == NULL) + { + m_bTableData = bTableData; // 表格 曲线 + m_csCurveDDIR = csCurveDDIR; // 方位曲线 + m_csCurveDANG = csCurveDANG; //倾角曲线 + m_csCurveGrad = "GRAD"; + + m_qsDepth="DEPT"; // 深度字段 + m_qsDIR="DDIR"; // 方位字段 + m_qsDIP="DANG";// 倾角字段 + m_qsID = "ID"; + + m_qsTable="FRAC_HOLE.TABLE"; + + + + + + flag = Refurbish(); + if(!flag) + { + return; + } + } + + double nR = 40; + + QPen wPen(Qt::black, 2); + double centerX = this->m_iX2/2; + + float flVal = 0.0f; + float x,y,x1,y1,x2,y2; + float ifdir[360]; + int m_nArc = 36; + float m_LeftVal3 = 0; + float m_RightVal3 = 100.0; + m_LeftVal = 0.0f; + m_RightVal = 90.0f; + float mind=min(m_RightVal , m_LeftVal); + float maxd=max(m_RightVal , m_LeftVal); + float dirmax,dipmax,dr; + + float deps; + + float ftmpSdep = 2890;//m_SDep; + float ftmpEdep = m_EDep; + if (m_bTableData) + { + ReadFracDef(); + for (int i = 0 ; i < iFracType ; i++) + { + m_bTypeDraw[i] = true; + } + + ftmpSdep = -m_iY2; + ftmpEdep = -m_iY1; + } + + int nPointNum = m_FracTabList.count(); + int n = m_FracDefList.count(); + int nstep = 5; + int tmp = ftmpSdep / nstep; + float flDep = tmp * nstep; + + double pi = 3.1415926535; + // 射线 + bool m_bGrid = true; + // 井眼垮塌 + bool m_bJykt = true; + // 标注 + bool m_bHint = true; + int m_nAzimStep = 3; + + m_Curve.DepLevel = 0.5; + while ( 1) + { + if((flDep>=ftmpEdep+nstep)||flDep>=ftmpEdep)break; + + double tempf = flDep+(float)(nstep)/2.; + double centerY = tempf * -1.0; + + wPen.setWidth(2); + wPen.setColor(Qt::black); + QCPItemEllipse* pEse = new QCPItemEllipse(this); + pEse->setPen(wPen); + pEse->m_bCustom = true; + pEse->m_nRadius = nR; + pEse->topLeft->setCoords(centerY, centerX); + pEse->bottomRight->setCoords(centerY, centerX); + + for(int k = 0; k < 4; k++) + { + QCPItemLine* pLine1 = new QCPItemLine(this); + pLine1->m_bCustom = true; + pLine1->m_dr = qDegreesToRadians(k*90.0); + pLine1->m_nRadius = 0; + pLine1->m_nTailLen=nR; + pLine1->setPen(wPen); + pLine1->start->setCoords(centerY,centerX); + pLine1->end->setCoords(centerY,centerX); + } + + // 写标注 + if ( m_bHint ) + { + int psize = 10; + flVal = m_nAzimStep*360./m_nArc; + for (int i=0 ;i<360; i+=(int)(flVal)) + { + QCPItemText* mItemTitle = new QCPItemText(this); + mItemTitle->position->setCoords(centerY,centerX); + mItemTitle->setText(QString::number(i)); + //mItemTitle->setBrush(QBrush(Qt::red)); + mItemTitle->setFont(QFont("Arial", 10)); + mItemTitle->setColor(Qt::black); + + dr = i*2* 3.1415926535/ 360.; + mItemTitle->m_fx = (nR+psize*0.85)*sin(dr); + mItemTitle->m_fy = (nR+psize*0.85)*cos(dr); + mItemTitle->m_bCustom = true; + } + + } + + if(m_bGrid) + { + wPen.setWidth(1); + + double st = 360/m_nArc; + for(int i = 0; i < m_nArc; i++) + { + int ntmp = i % 9; + if(ntmp != 0) + { + QCPItemLine* pLine = new QCPItemLine(this); + pLine->m_bCustom = true; + pLine->m_dr = qDegreesToRadians(i * st); + pLine->m_nRadius = 0; + pLine->m_nTailLen=nR; + pLine->setPen(wPen); + pLine->start->setCoords(centerY,centerX); + pLine->end->setCoords(centerY,centerX); + } + } + } + + for(int i=0;i<=m_nArc;i++) ifdir[i]=0.; + x1 = 360./m_nArc; + + int i = 0; + while ( 1 ) + { + deps = flDep + i * m_Curve.DepLevel; + + tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5; + if (deps >= ftmpEdep|| + deps > m_Curve.EndDepth|| + deps >=( flDep + nstep)) + break; + if(tempf<0) + { + i++; + continue; + } + + if (m_Value3 !=NULL )// for 控制曲线 + { + float tempf3 = (deps-m_Curve3.StartDepth)/m_Curve3.DepLevel+0.5; + if(tempf3<0) + { + i++; + continue; + } + double grad = GetData(m_Curve3.RepCode,(char *)&m_Value3[(int)(tempf3)*m_Curve3.CodeLen]); + if(gradm_RightVal3){i++;continue;} + } + if (m_Value2 !=NULL ) // 倾角控制 + { + tempf = (deps-m_Curve2.StartDepth)/m_Curve2.DepLevel+0.5; + flVal = GetData(m_Curve2.RepCode,(char *)&m_Value2[(int)(tempf)*m_Curve2.CodeLen]); + //按倾角范围统计 + if(flVal > maxd || flVal < mind) + { + i++; + continue; + } + } + + tempf = (deps-m_Curve.StartDepth)/m_Curve.DepLevel+0.5; + flVal = GetData(m_Curve.RepCode,(char *)&m_Value[(int)(tempf)*m_Curve.CodeLen]); + if(flVal<0) + { + i++; + continue; + } + flVal=fmod(flVal,360.f); + int j = flVal/x1; + if ( j >= 0 && j< m_nArc+1 ) + ifdir[j] ++; + i ++; + } + + dirmax=0; + int iIndex = -1; + for(i=0;i<=m_nArc;i++) + { + if (dirmax=m_nArc ) + dr=0.; + else + dr=(i+1)*flVal; + + dr=(i+1)*flVal; + float x2 = ifdir[i]*nR*sin(dr)/dirmax; + float y2 = ifdir[i]*nR*cos(dr)/dirmax; + + if(oldx != x2 || oldy != y2) + { + myPolygon << QPointF(x2, y2); + oldx = x2; + oldy = y2; + } + } + // pt[2*m_nArc+2] = pt[0]; + + if (iIndex >=0/*&&m_bFill*/ ) + { + x = centerY; + y = centerX; + QCPItemPolygon* pol = new QCPItemPolygon(this); + pol->topLeft->setCoords(x, y); + pol->bottomRight->setCoords(x, y); + pol->setPoints(myPolygon); + pol->setBrushColor(QColor(255,170,0)); + } + + myPolygon.clear(); + tempf = m_nArc/2.; + for (i=0 ;i<=m_nArc; i++) + { + dr=i*flVal; + dr = dr-tempf*flVal; + float x1 = ifdir[i]*nR*sin(dr)/dirmax; + float y1 = ifdir[i]*nR*cos(dr)/dirmax; + + if(oldx != x1 || oldy != y1) + { + myPolygon << QPointF(x1, y1); + oldx = x1; + oldy = y1; + } + + if ( i >=m_nArc ) + dr=0.; + else + dr=(i+1)*flVal; + dr = dr-tempf*flVal; + float x2 = ifdir[i]*nR*sin(dr)/dirmax; + float y2 = ifdir[i]*nR*cos(dr)/dirmax; + if(oldx != x2 || oldy != y2) + { + myPolygon << QPointF(x2, y2); + oldx = x2; + oldy = y2; + } + } + if (iIndex >=0/*&&m_bFill*/ ) + { + x = centerY; + y = centerX; + QCPItemPolygon* pol = new QCPItemPolygon(this); + pol->topLeft->setCoords(x, y); + pol->bottomRight->setCoords(x, y); + pol->setPoints(myPolygon); + pol->setBrushColor(QColor(255,170,0)); + } + + + if ( m_bJykt && iIndex >=0 ) + { + // 绘制垮塌方向 + dr=iIndex*flVal; + dr = dr-pi/2;//9*flVal; + x1 = ifdir[iIndex]*nR*sin(dr)/dirmax; + y1 = ifdir[iIndex]*nR*cos(dr)/dirmax; + + dr=iIndex*flVal; + dr = dr+pi/2; + x2 = ifdir[iIndex]*nR*sin(dr)/dirmax; + y2 = ifdir[iIndex]*nR*cos(dr)/dirmax; + + wPen.setWidth(2); + wPen.setColor(QColor(0,85,255)); + this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen); + + dr=iIndex*flVal; + float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax; + float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax; + this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen); + this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen); + + dr=iIndex*flVal; + dr = dr-pi;//18*flVal;//m1_nArc*flVal/2; + x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax; + y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax; + + this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen); + this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen); + + } + + flDep += nstep; + } } +void QMyCustomPlot::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen) +{ + QPolygonF myPolygon; + myPolygon << p1; + myPolygon << p2; + + QCPItemLine* pLine = new QCPItemLine(widget); + pLine->setPen(wPen); + pLine->start->setCoords(cx,cy); + pLine->end->setCoords(cx,cy); + pLine->setPoints(myPolygon); +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 69ef4c6..1bf9589 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -555,6 +555,9 @@ public slots: // 频率统计图 void s_changePlObjectProperty(QVariantMap variantMap); + // 玫瑰图 + void s_changeRoseProperty(QVariantMap variantMap); + // 岩心分析 void s_changeCorePhysicsProperty(QVariantMap variantMap); @@ -636,20 +639,25 @@ public: QString m_qsWellName,m_qsTable; QString m_qsDepth,m_qsDIP,m_qsDIR,m_qsID,m_qsProperty; // 控制曲线 float m_SDep,m_EDep,m_Rlev; - // csCurveGrad曲线名 LeftVal3最小值 RightVal3最大值 nArc扇形 nR圆半径 crArc圆颜色 nArcLineWidth圆线宽度 bFill是否填充 - void fgrqDraw(QString csCurveGrad, double LeftVal3, double RightVal3, int nArc, double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill, + // 频率统计图 csCurveGrad曲线名 LeftVal3最小值 RightVal3最大值 nArc扇形 nR圆半径 crArc圆颜色 nArcLineWidth圆线宽度 bFill是否填充 + void drawFgrq(bool bTableData, QString csCurveDDIR, QString csCurveDANG, QString csCurveGrad, double LeftVal3, double RightVal3, int nArc, double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill, int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram, int baselineWidth, QColor baselineColor, int nstep, double minInclination, double maxInclination); // 绘制倾角 - void drawDipAngle(double centerX, double centerY, float ifdir[360], int iIndex, float dirmax, + void drawDipAngle(double centerX, double centerY, float ifdir[360], float dirmax, int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawHistogram, int baselineWidth, QColor baselineColor, double minInclination, double maxInclination); - void Refurbish(); + bool Refurbish(); int m_PointNum; char *m_Value = NULL,*m_Value2 = NULL,*m_Value3 = NULL; - void ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve); + bool ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve); + bool ReadData(QString strSlfName, QString strLineName); + + void drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG, + QString qsDepth, QString qsDIR, QString qsDIP, QString qsID); + void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen); private: };