diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index a8ce640..918172a 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -2294,8 +2294,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } else if(m_strCurrentProperty == CRACK_PROPERTY) // 裂缝 { - CommonPropertyChanged(pProperty, variant); - changedCrackProperty(m_propertyData[pProperty], variant); + this->CommonPropertyChanged(pProperty, variant); + this->changedCrackProperty(m_propertyData[pProperty], variant); } @@ -4287,62 +4287,77 @@ void PropertyWidget::changedCrackProperty(QString strProperty, QVariant varVal) else if ("高导缝" == strProperty) { this->m_formInfo->m_pl_highGap = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("高阻缝" == strProperty) { this->m_formInfo->m_pl_highReservoir = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("网状缝" == strProperty) { this->m_formInfo->m_pl_reticularFracture = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("诱导缝" == strProperty) { this->m_formInfo->m_pl_inducedFracture = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("层理" == strProperty) { this->m_formInfo->m_pl_bedLayer = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("侵蚀面" == strProperty) { this->m_formInfo->m_pl_erosionSurface = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("孔洞" == strProperty) { this->m_formInfo->m_pl_pore = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("气孔" == strProperty) { this->m_formInfo->m_pl_vesicle = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("砾石" == strProperty) { this->m_formInfo->m_pl_gravel = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("结核" == strProperty) { this->m_formInfo->m_pl_nodule = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("团块" == strProperty) { this->m_formInfo->m_pl_lumps = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("断层" == strProperty) { this->m_formInfo->m_pl_fault = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("垂直缝" == strProperty) { this->m_formInfo->m_pl_verticalFracture = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("自定义1" == strProperty) { this->m_formInfo->m_pl_custom1 = varVal.toBool(); + this->m_formInfo->repaint(); } else if ("自定义2" == strProperty) { this->m_formInfo->m_pl_custom2 = varVal.toBool(); + this->m_formInfo->repaint(); } if(flag) diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index b9ea970..533f5e9 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -414,6 +414,12 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) m_rose_fill_enabled, m_rose_draw_annotation, m_pl_statInterval, m_pl_minInclination, m_pl_maxInclination); } + else if("CrackObject" == strType) // 裂缝 + { + qDebug() << "==================== number:" << pInfo; + pInfo; + curv; + } else if("dcaObject" == strType) { initDCA(curv); @@ -561,7 +567,7 @@ void FormDraw::DisplayLines(QJsonArray linesArray) DisplayTvd_One(lineObjInfo); } // 深度 频率统计图 玫瑰图 - else if (strType == "depthObject" || strType == "plObject" || strType == "roseObject") + else if (strType == "depthObject" || strType == "plObject" || strType == "roseObject" || strType == "CrackObject") { // 频率统计图 DisplayType_One(lineObjInfo); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index b0b4bb2..88370a1 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -203,6 +203,68 @@ void FormInfo::initProperty(QJsonObject obj) this->m_rose_fill_enabled = obj["m_rose_fill_enabled"].toBool(); // 是否填充 this->m_rose_draw_annotation = obj["m_rose_draw_annotation"].toBool(); // 是否绘制标注? } + else if ("CrackObject" == strType) + { + // 数据 + // 井文件 m_strSlfName + // 显示名称 m_strAliasName + this->m_crack_boreholeDiameter = obj["m_crack_boreholeDiameter"].toDouble(); // 井眼直径 + this->m_crack_drawName = obj["m_crack_drawName"].toInt(); // 绘制裂缝名称 + this->m_crack_drawAngle = obj["m_crack_drawAngle"].toInt(); // 绘制裂缝角度 + this->m_crack_inclinationCurveName = obj["m_crack_inclinationCurveName"].toString(); // 井斜角曲线名 + this->m_crack_azimuthCurveName = obj["m_crack_azimuthCurveName"].toString(); // 方位角曲线名 + // 通常 + // 例区高度 m_headHeight + // 字体 + { + // 名称 + 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_crack_fontScaleSize"].toString().split(","); // 按逗号拆分 + if (fontParts.size() >= 2) { + this->m_crack_fontScaleSize.setFamily(fontParts[0]); // 设置字体名称 + this->m_crack_fontScaleSize.setPointSize(fontParts[1].toInt()); // 设置字号 + } + } + { + // 标注 + QStringList fontParts = obj["m_crack_fontAnnotationSize"].toString().split(","); // 按逗号拆分 + if (fontParts.size() >= 2) { + this->m_crack_fontAnnotationSize.setFamily(fontParts[0]); // 设置字体名称 + this->m_crack_fontAnnotationSize.setPointSize(fontParts[1].toInt()); // 设置字号 + } + } + // 显示控制 + this->m_crack_decimal_digits = obj["m_crack_decimal_digits"].toInt(); // 小数位数 + } + + if ("plObject" == strType || ("roseObject" == strType) || "CrackObject" == strType) + { + // 通常 + this->m_headHeight = obj["m_headHeight"].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 + } if ("plObject" == strType || ("roseObject" == strType)) { @@ -213,10 +275,6 @@ void FormInfo::initProperty(QJsonObject obj) // 井文件名称 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(); // 例区高度 - // 字体 { // 名称 @@ -253,23 +311,6 @@ void FormInfo::initProperty(QJsonObject obj) 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(); // 网状缝 - 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 } } @@ -529,57 +570,17 @@ QJsonObject FormInfo::makeJson() // 通常 // 例区高度 m_headHeight // 字体 - // 名称 m_strAliasNameFont + rootObj["m_strAliasNameFont"] = this->m_strAliasNameFont.toString(); // 名称 rootObj["m_crack_fontScaleSize"] = this->m_crack_fontScaleSize.toString(); // 刻度 rootObj["m_crack_fontAnnotationSize"] = this->m_crack_fontAnnotationSize.toString(); // 标注 // 显示控制 rootObj["m_crack_decimal_digits"] = this->m_crack_decimal_digits; // 小数位数 - -// _CreateVariantPropertyItem("数据", "井文件", formInfo->m_strSlfName, QVariant::String); -// _CreateVariantPropertyItem("数据", "显示名称", formInfo->m_strAliasName, QVariant::String); -// _CreateVariantPropertyItem("数据", "井眼直径", formInfo->m_crack_boreholeDiameter, QVariant::Double); -// QStringList listType; -// listType.append("否"); -// listType.append("是"); -// _CreateEnumPropertyItem("数据", "绘制裂缝名称", formInfo->m_crack_drawName, listType); -// _CreateEnumPropertyItem("数据", "绘制裂缝角度", formInfo->m_crack_drawAngle, listType); -// _CreateVariantPropertyItem("数据", "井斜角曲线名", formInfo->m_crack_inclinationCurveName, QVariant::String); -// _CreateVariantPropertyItem("数据", "方位角曲线名", formInfo->m_crack_azimuthCurveName, QVariant::String); - -// _CreateVariantPropertyItem("通常", "例区高度(cm)", formInfo->m_headHeight, QVariant::Int); - -// _CreateVariantPropertyItem("字体", "名称", formInfo->m_strAliasNameFont, QVariant::Font); -// _CreateVariantPropertyItem("字体", "刻度", formInfo->m_crack_fontScaleSize, QVariant::Font); -// _CreateVariantPropertyItem("字体", "标注", formInfo->m_crack_fontAnnotationSize, QVariant::Font); - -// _CreateVariantPropertyItem("显示控制", "小数位数", formInfo->m_crack_decimal_digits, QVariant::Int); - } - if (m_strType == "plObject" || m_strType == "roseObject") + if(m_strType == "CrackObject" || m_strType == "plObject" || m_strType == "roseObject") { - // 数据 - // 数据名称 - 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_headHeight"] = this->m_headHeight; // 例区高度 - // 字体 - 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_strAliasNameFont"] = this->m_strAliasNameFont; // 曲线名称 - // 控制曲线 - rootObj["m_pl_controlCurveName"] = this->m_pl_controlCurveName; // 曲线名 - rootObj["m_pl_controlMinValue"] = this->m_pl_controlMinValue; // 最小值 - rootObj["m_pl_controlMaxValue"] = this->m_pl_controlMaxValue; // 最大值 - // 统计参数 - rootObj["m_pl_statInterval"] = this->m_pl_statInterval; // 统计间隔 - rootObj["m_pl_minInclination"] = this->m_pl_minInclination; // 最小倾角 - rootObj["m_pl_maxInclination"] = this->m_pl_maxInclination; // 最大倾角 // 分类 rootObj["m_pl_highGap"] = this->m_pl_highGap; // 高导缝 rootObj["m_pl_highReservoir"] = this->m_pl_highReservoir; // 高阻缝 @@ -597,6 +598,29 @@ QJsonObject FormInfo::makeJson() rootObj["m_pl_custom1"] = this->m_pl_custom1; // 自定义1 rootObj["m_pl_custom2"] = this->m_pl_custom2; // 自定义2 } + if (m_strType == "plObject" || m_strType == "roseObject") + { + // 数据 + // 数据名称 + 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_strAliasNameFont"] = this->m_strAliasNameFont.toString(); // 名称 + rootObj["m_strUnitFont"] = this->m_strUnitFont.toString(); // 单位 + rootObj["m_pl_fontScale"] = this->m_pl_fontScale.toString(); // 刻度 + // rootObj["m_strAliasNameFont"] = this->m_strAliasNameFont; // 曲线名称 + // 控制曲线 + rootObj["m_pl_controlCurveName"] = this->m_pl_controlCurveName; // 曲线名 + rootObj["m_pl_controlMinValue"] = this->m_pl_controlMinValue; // 最小值 + rootObj["m_pl_controlMaxValue"] = this->m_pl_controlMaxValue; // 最大值 + // 统计参数 + rootObj["m_pl_statInterval"] = this->m_pl_statInterval; // 统计间隔 + rootObj["m_pl_minInclination"] = this->m_pl_minInclination; // 最小倾角 + rootObj["m_pl_maxInclination"] = this->m_pl_maxInclination; // 最大倾角 + } return rootObj; } @@ -932,7 +956,7 @@ void FormInfo::paintEvent(QPaintEvent* event) //蝌蚪图,不绘制左右范围 strShowTxt = "蝌蚪图"; } - if(this->m_strType == "plObject" || this->m_strType == "roseObject") + if(this->m_strType == "plObject" || this->m_strType == "roseObject" || this->m_strType == "CrackObject") { strShowTxt = " "; } @@ -1114,7 +1138,6 @@ void FormInfo::paintEvent(QPaintEvent* event) if (startY < 0) startY = 0; int currentY = startY; - int centerX = width / 2; // ========== 1. 绘制名称(最上面)========== QFont oldFont = painter.font(); @@ -1208,7 +1231,6 @@ void FormInfo::paintEvent(QPaintEvent* event) // ========== 方向文字位置根据字体精确计算 ========== int nWidth = fm.horizontalAdvance("N"); - int eWidth = fm.horizontalAdvance("E"); int sWidth = fm.horizontalAdvance("S"); int wWidth = fm.horizontalAdvance("W"); @@ -1238,9 +1260,222 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.setFont(oldFont); } + if(this->m_strType == "CrackObject") + { + QRect rect = this->rect(); + int width = rect.width(); + int height = rect.height(); + // ========== 固定距离配置 ========== + const int COMPASS_SIZE = 50; // 指南针区域高度 + + // 计算总占用高度 + int totalContentHeight = COMPASS_SIZE; + + // 垂直居中起始位置 + int startY = (height - totalContentHeight) / 2; + if (startY < 0) startY = 0; + + int currentY = startY; + int centerX = width / 2; + + // ========== 1. 绘制名称(最上面)========== + QFont oldFont = painter.font(); + // ========== 3. 绘制指南针(最下面)========== + oldFont = painter.font(); + painter.setFont(this->m_crack_fontAnnotationSize); + + // 指南针在COMPASS_SIZE区域内垂直居中 + int compassCenterY = currentY + COMPASS_SIZE / 2; + + // ========== 根据字体大小计算十字线长度 ========== + QFontMetrics fm(this->m_crack_fontAnnotationSize); + int fontHeight = fm.height(); // 字体高度 + int fontAscent = fm.ascent(); // 字体上延 + int lineLen = fontHeight * 0.6; // 十字线长度为字体高度的60% + + // 确保不超出区域并留边距 + int maxLineLen = (COMPASS_SIZE - fontHeight) / 2 - 4; + if (lineLen > maxLineLen) lineLen = maxLineLen; + if (lineLen < 8) lineLen = 8; // 最小长度保护 + + painter.setPen(QPen(Qt::black, 1)); + + // 画十字(根据字体大小调整长度) + painter.drawLine(centerX, compassCenterY - lineLen, centerX, compassCenterY + lineLen); + painter.drawLine(centerX - lineLen, compassCenterY, centerX + lineLen, compassCenterY); + + // ========== 方向文字位置根据字体精确计算 ========== + int nWidth = fm.horizontalAdvance("N"); + int sWidth = fm.horizontalAdvance("S"); + int wWidth = fm.horizontalAdvance("W"); + // 文字与十字的间隙 + int textGap = qMax(4, fontHeight / 5); + // N(上):紧贴十字上方 + painter.drawText(centerX - nWidth / 2, + compassCenterY - lineLen - textGap, + "N"); + // E(右):垂直居中于右侧横线 + painter.drawText(centerX + lineLen + textGap, + compassCenterY + fontAscent / 2 - 1, + "E"); + // S(下):紧贴十字下方 + painter.drawText(centerX - sWidth / 2, + compassCenterY + lineLen + fontAscent + textGap, + "S"); + // W(左):垂直居中于左侧横线 + painter.drawText(centerX - lineLen - textGap - wWidth, + compassCenterY + fontAscent / 2 - 1, + "W"); + + painter.setFont(oldFont); + + this->paintClassify(painter, compassCenterY); + } + QWidget::paintEvent(event); } +void FormInfo::paintClassify(QPainter &painter, int compassCenterY) +{ + // 绘制分类 + if(this->m_pl_highGap) + { + QString drawText = "高导缝"; + painter.setBrush(QBrush(QColor("#FF0000"))); + painter.setPen(QPen(QColor("#FF0000"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_highReservoir) + { + QString drawText = "高阻缝"; + painter.setBrush(QBrush( QColor("#400040"))); + painter.setPen(QPen( QColor("#400040"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_reticularFracture) + { + QString drawText = "网状缝"; + painter.setBrush(QBrush( QColor("#808000"))); + painter.setPen(QPen( QColor("#808000"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_inducedFracture) + { + QString drawText = "诱导缝"; + painter.setBrush(QBrush( QColor("#00FFFF"))); + painter.setPen(QPen( QColor("#00FFFF"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_bedLayer) + { + QString drawText = "层理"; + painter.setBrush(QBrush( QColor("#00FF00"))); + painter.setPen(QPen( QColor("#00FF00"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_erosionSurface) + { + QString drawText = "侵蚀面"; + painter.setBrush(QBrush( QColor("#409600"))); + painter.setPen(QPen( QColor("#409600"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_pore) + { + QString drawText = "孔洞"; + painter.setBrush(QBrush( QColor("#FF8064"))); + painter.setPen(QPen( QColor("#FF8064"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_vesicle) + { + QString drawText = "气孔"; + painter.setBrush(QBrush( QColor("#FFFF00"))); + painter.setPen(QPen( QColor("#FFFF00"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_gravel) + { + QString drawText = "砾石"; + painter.setBrush(QBrush( QColor("#000096"))); + painter.setPen(QPen( QColor("#000096"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_nodule) + { + QString drawText = "结核"; + painter.setBrush(QBrush( QColor("#A65300"))); + painter.setPen(QPen( QColor("#A65300"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_lumps) + { + QString drawText = "团块"; + painter.setBrush(QBrush( QColor("#000000"))); + painter.setPen(QPen( QColor("#000000"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_fault) + { + QString drawText = "断层"; + painter.setBrush(QBrush( QColor("#A65300"))); + painter.setPen(QPen( QColor("#A65300"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_verticalFracture) + { + QString drawText = "垂直缝"; + painter.setBrush(QBrush( QColor("#FF0000"))); + painter.setPen(QPen( QColor("#FF0000"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_custom1) + { + QString drawText = "自定义1"; + painter.setBrush(QBrush( QColor("#000000"))); + painter.setPen(QPen( QColor("#000000"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + if(this->m_pl_custom2) + { + QString drawText = "自定义2"; + painter.setBrush(QBrush( QColor("#000000"))); + painter.setPen(QPen( QColor("#000000"), 1)); + painter.drawLine(0, compassCenterY + 20, 30, compassCenterY + 25); + painter.drawEllipse(25, compassCenterY + 20, 10, 10); + painter.drawText(40, compassCenterY + 30, drawText); + } + +} + void FormInfo::dragEnterEvent(QDragEnterEvent* event) { qDebug() << "FormInfo dragEnterEvent"; diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index ccb74b8..797d6dc 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -26,6 +26,8 @@ public: ~FormInfo(); void initProperty(QJsonObject obj); + + void paintClassify(QPainter &painter, int compassCenterY); private: Ui::FormInfo *ui; @@ -295,8 +297,6 @@ public: // 显示控制 int m_crack_decimal_digits = 2; // 小数位数 - - // 频率统计图 // 方位频率绘图参数 int m_pl_sectorCount = 36; // 扇形数量