From 5d860bd16b5df692272981e88faadbed2b588686 Mon Sep 17 00:00:00 2001 From: "DESKTOP-450PEFP\\mainc" Date: Fri, 13 Feb 2026 22:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E9=87=8A=E7=BB=93=E8=AE=BA=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=AD=97=E4=BD=93?= =?UTF-8?q?=EF=BC=8C=E9=A2=9C=E8=89=B2=EF=BC=8C=E7=BB=93=E8=AE=BA=E5=8D=A0?= =?UTF-8?q?=E6=AF=94=E7=AD=89=E6=95=B0=E6=8D=AE=E7=BC=96=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 57 ++- logPlus/PropertyWidget.h | 4 + logPlus/TransparentGroupResult.cpp | 2 +- logPlus/formdraw.cpp | 4 +- logPlus/forminfo.cpp | 595 +++++++++++++++-------------- logPlus/forminfo.h | 9 + logPlus/qmycustomplot.cpp | 2 +- 7 files changed, 387 insertions(+), 286 deletions(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 838272d..eb84d9a 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -92,8 +92,38 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant { if(m_strCurrentProperty == "") return; + if (m_strCurrentProperty == Table_Property) + { + bool bDraw = false; + QStringList slist; + slist << "显示名称" << "垂向绘制" << "旋转角度(°)" << "字体" << "颜色" + << "结论占比%" << "显示位置(cm)" << "显示层号" << "层号字体" << "层号旋转"; + for (int i = 0; i < slist.length(); i++) + { + if (slist.at(i) == m_propertyData[pProperty]) + { + bDraw = m_formInfo->setInfoProperty(m_propertyData[pProperty], variant); + break; + } + } - if(m_strCurrentProperty == Track_Property) + if (!slist.contains(m_propertyData[pProperty])) + bDraw = true; + + if (bDraw) + { + QVariantList listCond; + listCond << m_strUuid; + listCond << m_strSlfName; + listCond << m_strWellName; + listCond << m_strTrackName; + listCond << m_strLineName; + listCond << m_propertyData[pProperty]; + listCond << variant; + emit CallManage::getInstance()->sig_changeDrawProperty(listCond); + } + } + else if(m_strCurrentProperty == Track_Property) { if(m_fromTop == NULL) return; @@ -1178,6 +1208,25 @@ void PropertyWidget::initHeadProperty(FormHead *formHead, QTableWidget *tableWid } +void PropertyWidget::initTableProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + + _CreateVariantPropertyItem("名称", "显示名称", formInfo->m_strLineName, QVariant::String); + //_CreateVariantPropertyItem("名称", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); + //_CreateVariantPropertyItem("名称", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); + _CreateVariantPropertyItem("名称", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("名称", "颜色", formInfo->m_lineColor, QVariant::Color); + + _CreateVariantPropertyItem("显示", "结论占比%", formInfo->m_nConclusionProportion, QVariant::Int); + _CreateVariantPropertyItem("显示", "显示位置(cm)", formInfo->m_nShowPos, QVariant::Int); + _CreateVariantPropertyItem("显示", "显示层号", formInfo->m_bShowLayerNo, QVariant::Bool); + _CreateVariantPropertyItem("显示", "层号字体", formInfo->m_layerFont, QVariant::Font); + _CreateVariantPropertyItem("显示", "层号旋转", formInfo->m_fLayerRotate, QVariant::Double); + + m_strCurrentProperty = Table_Property; +} + void PropertyWidget::initDepthProperty(FormInfo *formInfo) { // @@ -1206,7 +1255,11 @@ void PropertyWidget::initProperty(FormInfo *formInfo) m_strTrackName = formInfo->m_strTrackName; m_strLineName = formInfo->m_strLineName; - if (formInfo->m_strType == "depthObject") + if (formInfo->m_strType == "tableObject") + { + this->initTableProperty(formInfo); + } + else if (formInfo->m_strType == "depthObject") { this->initDepthProperty(formInfo); } diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 666b463..1aeb4f6 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -29,6 +29,8 @@ #define Wave_Property "Wave_Property" //波列 #define Head_Property "Head_Property" //图头,单元格 +#define Table_Property "Table_Property" //解释结论 + #pragma execution_character_set("utf-8") /** @@ -111,6 +113,8 @@ public: //图头 void initHeadProperty(FormHead *formHead, QTableWidget *tableWidget, QTableWidgetItem* item, int row, int col); + void initTableProperty(FormInfo *formInfo); + void initDepthProperty(FormInfo *formInfo); void initProperty(FormInfo *formInfo); diff --git a/logPlus/TransparentGroupResult.cpp b/logPlus/TransparentGroupResult.cpp index af6144d..638e54f 100644 --- a/logPlus/TransparentGroupResult.cpp +++ b/logPlus/TransparentGroupResult.cpp @@ -156,7 +156,7 @@ void TransparentGroupResult::initRect() mDragRect->setVisible(false); mDragLine = new QCPItemStraightLine(mPlot); - mDragLine->setPen(QPen(Qt::red, 1, Qt::DashDotDotLine)); + mDragLine->setPen(QPen(Qt::red, 1)); mDragLine->setVisible(false); // 创建透明矩形 diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 40a83c7..1c3c6e1 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -602,9 +602,9 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri // QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strLineName); - curv->initGeometry(m_strUuid, m_iScale, g_iOneWidth); + curv->initGeometry(m_strUuid, m_iScale, m_nTrackW); curv->show(); - + if (strLineName == "FRAC_HOLE.TABLE") { //蝌蚪图 diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 292586a..9a19748 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -29,14 +29,14 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt m_lineStyle = Qt::SolidLine; m_newFillMode = "无填充"; m_newHeadFill = "不绘制"; -// // -// QPushButton *button = new QPushButton("Drag Me", this); -// QVBoxLayout *layout = new QVBoxLayout(this); -// layout->addWidget(button); -// setLayout(layout); -// // 设置拖拽功能 -// setWindowFlags(Qt::FramelessWindowHint | Qt::Window); -// setAttribute(Qt::WA_TranslucentBackground); + // // + // QPushButton *button = new QPushButton("Drag Me", this); + // QVBoxLayout *layout = new QVBoxLayout(this); + // layout->addWidget(button); + // setLayout(layout); + // // 设置拖拽功能 + // setWindowFlags(Qt::FramelessWindowHint | Qt::Window); + // setAttribute(Qt::WA_TranslucentBackground); //左刻度 connect(CallManage::getInstance(), SIGNAL(sig_ChangeLeftScale(QString, QString, QString, QString, QString, double)), this, SLOT(s_ChangeLeftScale(QString, QString, QString, QString, QString, double))); @@ -61,12 +61,13 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt //修改曲线选择状态 iSelect=0未知,1标准曲线,2主曲线,3从曲线 connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineStatus(QString, QString, QString, QString, QString, int, bool)), this, SLOT(s_ChangeLineStatus(QString, QString, QString, QString, QString, int, bool))); - QFont font1("微软雅黑", 10); - QFont font2("微软雅黑", 8); - m_curveNameFont = font1; // 曲线名称 - m_curveUnitFont = font2; // 曲线单位 - m_curveScaleFont = font2; // 曲线刻度 - m_bShowScale = true; + QFont font1("微软雅黑", 10); + QFont font2("微软雅黑", 8); + m_curveNameFont = font1; // 曲线名称 + m_curveUnitFont = font2; // 曲线单位 + m_curveScaleFont = font2; // 曲线刻度 + m_layerFont = font1; + m_bShowScale = true; } FormInfo::~FormInfo() @@ -76,27 +77,27 @@ FormInfo::~FormInfo() void FormInfo::initProperty(QJsonObject obj) { - m_vmin = obj.value("vmin").toDouble(); - m_vmax = obj.value("vmax").toDouble(); - m_strUnit = obj.value("Unit").toString(); + m_vmin = obj.value("vmin").toDouble(); + m_vmax = obj.value("vmax").toDouble(); + m_strUnit = obj.value("Unit").toString(); - QString strType = obj.value("Type").toString(); - if ("waveObject" == strType) - { - m_nDrawType = obj.value("DrawType").toInt(); - m_nFillType = obj.value("FillType").toInt(); - m_strAmp = obj.value("Amp").toString(); - m_fMaxAmp = obj.value("MaxAmp").toDouble(); - m_nSchemeIndex = obj.value("SchemeIndex").toInt(); - m_nColorNum = obj.value("ColorNum").toInt(); + QString strType = obj.value("Type").toString(); + if ("waveObject" == strType) + { + m_nDrawType = obj.value("DrawType").toInt(); + m_nFillType = obj.value("FillType").toInt(); + m_strAmp = obj.value("Amp").toString(); + m_fMaxAmp = obj.value("MaxAmp").toDouble(); + m_nSchemeIndex = obj.value("SchemeIndex").toInt(); + m_nColorNum = obj.value("ColorNum").toInt(); - m_bDrawDepth = obj.value("DrawDepth").toBool(); - m_bDrawBase = obj.value("DrawBase").toBool(); - m_bOddEven = obj.value("OddEven").toBool(); + m_bDrawDepth = obj.value("DrawDepth").toBool(); + m_bDrawBase = obj.value("DrawBase").toBool(); + m_bOddEven = obj.value("OddEven").toBool(); - m_nWaveJg = obj.value("WaveJg").toInt(); - m_fWaveHei = obj.value("WaveHei").toDouble(); - } + m_nWaveJg = obj.value("WaveJg").toInt(); + m_fWaveHei = obj.value("WaveHei").toDouble(); + } } QJsonObject FormInfo::makeJson() @@ -113,10 +114,10 @@ QJsonObject FormInfo::makeJson() } rootObj["SlfName"] = slffilename; rootObj["WellName"] = m_strWellName; -// rootObj["TrackName"] = m_strTrackName; + // rootObj["TrackName"] = m_strTrackName; rootObj["LineName"] = m_strLineName; - rootObj["AliasName"] = m_strAliasName; - rootObj["Unit"] = m_strUnit; + rootObj["AliasName"] = m_strAliasName; + rootObj["Unit"] = m_strUnit; rootObj["Type"] = m_strType; rootObj["lineColor"] = m_lineColor.name(); rootObj["Width"] = m_dWidth; @@ -124,42 +125,42 @@ QJsonObject FormInfo::makeJson() rootObj["vmax"] = m_vmax; rootObj["vmin"] = m_vmin; rootObj["ScaleType"] = m_strScaleType; - rootObj["ShowScale"] = m_bShowScale; + rootObj["ShowScale"] = m_bShowScale; - if (m_strType == "curveObject") - { - //岩性填充 - rootObj["newFillMode"] = m_newFillMode; - rootObj["newHeadFill"] = m_newHeadFill; - rootObj["newTargetLine"] = m_newTargetLine; - rootObj["newFillType"] = m_newFillType; - //填充颜色 + if (m_strType == "curveObject") + { + //岩性填充 + rootObj["newFillMode"] = m_newFillMode; + rootObj["newHeadFill"] = m_newHeadFill; + rootObj["newTargetLine"] = m_newTargetLine; + rootObj["newFillType"] = m_newFillType; + //填充颜色 rootObj["newColor"] = m_newColor.name(); - rootObj["newLithosImage"] = m_newLithosImage; - rootObj["new_vMax"] = m_new_vMax; - rootObj["new_vMin"] = m_new_vMin; - //岩性前景色 + rootObj["newLithosImage"] = m_newLithosImage; + rootObj["new_vMax"] = m_new_vMax; + rootObj["new_vMin"] = m_new_vMin; + //岩性前景色 rootObj["frontColor"] = m_frontColor.name(); - //岩性背景色 + //岩性背景色 rootObj["backColor"] = m_backColor.name(); - } - else if (m_strType == "waveObject") - { - rootObj["DrawType"] = m_nDrawType; - rootObj["FillType"] = m_nFillType; - rootObj["Amp"] = m_strAmp; - rootObj["MaxAmp"] = m_fMaxAmp; + } + else if (m_strType == "waveObject") + { + rootObj["DrawType"] = m_nDrawType; + rootObj["FillType"] = m_nFillType; + rootObj["Amp"] = m_strAmp; + rootObj["MaxAmp"] = m_fMaxAmp; - rootObj["DrawDepth"] = m_bDrawDepth; // 绘制波深度 - rootObj["DrawBase"] = m_bDrawBase; // 绘制波基线 - rootObj["OddEven"] = m_bOddEven; // 奇偶配色 + rootObj["DrawDepth"] = m_bDrawDepth; // 绘制波深度 + rootObj["DrawBase"] = m_bDrawBase; // 绘制波基线 + rootObj["OddEven"] = m_bOddEven; // 奇偶配色 - rootObj["WaveJg"] = m_nWaveJg; // 波形间隔 - rootObj["WaveHei"] = m_fWaveHei; // 波形高度 - - rootObj["SchemeIndex"] = m_nSchemeIndex; - rootObj["ColorNum"] = m_nColorNum; - } + rootObj["WaveJg"] = m_nWaveJg; // 波形间隔 + rootObj["WaveHei"] = m_fWaveHei; // 波形高度 + + rootObj["SchemeIndex"] = m_nSchemeIndex; + rootObj["ColorNum"] = m_nColorNum; + } return rootObj; } @@ -299,63 +300,63 @@ void FormInfo::paintEvent(QPaintEvent* event) if(m_strType=="waveObject") { - if (m_nDrawType == 0 || m_nDrawType == 1) - { - int nbot = rect.bottom()- rect.height() / 3.0; - QVector pts; - int i = 0; - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 15.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 12.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 9.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 6.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 3.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 9.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 15.0)); - pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot)); - pts.append(QPointF(rect.left() + rect.width() / 3.0, nbot)); + if (m_nDrawType == 0 || m_nDrawType == 1) + { + int nbot = rect.bottom()- rect.height() / 3.0; + QVector pts; + int i = 0; + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 15.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 12.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 9.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 6.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 3.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 9.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot - rect.height() / 15.0)); + pts.append(QPointF(rect.left() + rect.width() / 3.0 + (i++)*rect.width() / 3.0 / 8.0, nbot)); + pts.append(QPointF(rect.left() + rect.width() / 3.0, nbot)); - if (m_nDrawType == 1) { - QPolygonF cRgn; - for (int j = 0; j < pts.size(); j++) { - cRgn.push_back(pts[j]); - } - QPainterPath path; - path.addPolygon(cRgn); - painter.fillPath(path, QBrush(m_lineColor)); - } - else - { - painter.drawPolygon(pts); - } - } - else - { - QtColorTableData::getInstance()->SetCurrentSchemeIndex(m_nSchemeIndex); - //ColorTableIndex = ind; + if (m_nDrawType == 1) { + QPolygonF cRgn; + for (int j = 0; j < pts.size(); j++) { + cRgn.push_back(pts[j]); + } + QPainterPath path; + path.addPolygon(cRgn); + painter.fillPath(path, QBrush(m_lineColor)); + } + else + { + painter.drawPolygon(pts); + } + } + else + { + QtColorTableData::getInstance()->SetCurrentSchemeIndex(m_nSchemeIndex); + //ColorTableIndex = ind; - QtColorTableData::getInstance()->ChangeColorNum(m_nColorNum); - QList rgbList = QtColorTableData::getInstance()->GetRgb(); - int iColorNum = rgbList.size(); + QtColorTableData::getInstance()->ChangeColorNum(m_nColorNum); + QList rgbList = QtColorTableData::getInstance()->GetRgb(); + int iColorNum = rgbList.size(); - //头部绘制调色板 - float scale = (float)(rect.width() - 4) / (float)iColorNum; - QRectF rt7 = QRectF(rect.left() + 2, rect.top() + rect.height() / 3, rect.width() - 4, rect.height() / 3); - for (int i = 0; i < iColorNum; i++) - { - QColor acolor = rgbList.at(i); - float temp = (float)i * scale; - if (i)rt7.setLeft(rect.left() + 2 + temp); - else rt7.setLeft(rect.left() + 2 + temp + 1); - temp = (float)(i + 1) * scale; - rt7.setRight(rect.left() + 2 + temp); - QBrush HeadBrush = QBrush(acolor); - painter.fillRect(rt7, HeadBrush); - } - } + //头部绘制调色板 + float scale = (float)(rect.width() - 4) / (float)iColorNum; + QRectF rt7 = QRectF(rect.left() + 2, rect.top() + rect.height() / 3, rect.width() - 4, rect.height() / 3); + for (int i = 0; i < iColorNum; i++) + { + QColor acolor = rgbList.at(i); + float temp = (float)i * scale; + if (i)rt7.setLeft(rect.left() + 2 + temp); + else rt7.setLeft(rect.left() + 2 + temp + 1); + temp = (float)(i + 1) * scale; + rt7.setRight(rect.left() + 2 + temp); + QBrush HeadBrush = QBrush(acolor); + painter.fillRect(rt7, HeadBrush); + } + } } - painter.setFont(m_curveUnitFont); + painter.setFont(m_curveUnitFont); painter.setPen(m_lineColor); //painter.drawText(rect.left() + 20, 55, m_strUnit); //painter.drawText(rect.left() + 20, 80, QString::number(m_vmin)+" ~ "+QString::number(m_vmax)); @@ -401,7 +402,7 @@ void FormInfo::paintEvent(QPaintEvent* event) painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "蝌蚪图"); } else if(m_strLineName=="井眼垮塌矢量图" - || m_strLineName=="井斜方位图") + || m_strLineName=="井斜方位图") { painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3, Qt::AlignCenter, m_strUnit); 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)); @@ -409,27 +410,27 @@ void FormInfo::paintEvent(QPaintEvent* event) // if(m_strType=="tableObject" && (m_strLineName=="WORDS_RELUST" || m_strLineName == "RESULT" - || m_strLineName == "GEO_LITH"|| m_strLineName == "SWALL_CORE" - || m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT" - || m_strLineName == "CORE_PHYSICS") ) + || m_strLineName == "GEO_LITH"|| m_strLineName == "SWALL_CORE" + || m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT" + || m_strLineName == "CORE_PHYSICS") ) { } else { if(m_strType=="waveObject" - || m_strType=="curveObject") + || m_strType=="curveObject") { - painter.drawText(rect.left()+10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, m_strUnit); + painter.drawText(rect.left()+10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignCenter, m_strUnit); - // 显示刻度 - if (m_bShowScale) - { - painter.setFont(m_curveScaleFont); - QFontMetrics fm1(m_curveScaleFont); - QRect textRect = fm1.boundingRect(QString::number(m_vmax, 'f', 0)); - painter.drawText(rect.left() + 10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignLeft | Qt::AlignVCenter, QString::number(m_vmin));// +" ~ " + QString::number(m_vmax)); - painter.drawText(rect.left() + 10, rect.top() + rect.height() * 2 / 3, rect.width() - textRect.width(), rect.height() / 3, Qt::AlignRight | Qt::AlignVCenter, QString::number(m_vmax)); - } + // 显示刻度 + if (m_bShowScale) + { + painter.setFont(m_curveScaleFont); + QFontMetrics fm1(m_curveScaleFont); + QRect textRect = fm1.boundingRect(QString::number(m_vmax, 'f', 0)); + painter.drawText(rect.left() + 10, rect.top() + rect.height() * 2 / 3, rect.width(), rect.height() / 3, Qt::AlignLeft | Qt::AlignVCenter, QString::number(m_vmin));// +" ~ " + QString::number(m_vmax)); + painter.drawText(rect.left() + 10, rect.top() + rect.height() * 2 / 3, rect.width() - textRect.width(), rect.height() / 3, Qt::AlignRight | Qt::AlignVCenter, QString::number(m_vmax)); + } } } @@ -506,20 +507,20 @@ void FormInfo::dropEvent(QDropEvent* event) } else { - // 如果井名不正确,不接受拖拽事件 - event->ignore(); + // 如果井名不正确,不接受拖拽事件 + event->ignore(); } } else { - // 如果数据格式不正确,不接受拖拽事件 - event->ignore(); + // 如果数据格式不正确,不接受拖拽事件 + event->ignore(); } } else { - // 如果数据格式不正确,不接受拖拽事件 - event->ignore(); + // 如果数据格式不正确,不接受拖拽事件 + event->ignore(); } // 恢复鼠标光标 //QApplication::restoreOverrideCursor(); @@ -589,126 +590,160 @@ QColor FormInfo::getBackColor() bool FormInfo::setInfoProperty(QString strProName, QVariant val) { - bool bDraw = false; - if ("显示名称" == strProName) - { - this->m_strAliasName = val.toString(); - } - else if ("显示单位" == strProName) - { - this->m_strUnit = val.toString(); - } - else if ("曲线名称" == strProName) - { - this->m_curveNameFont = val.value(); - } - else if ("曲线单位" == strProName) - { - this->m_curveUnitFont = val.value(); - } - else if ("曲线刻度" == strProName) - { - this->m_curveScaleFont = val.value(); - } - else if ("类型" == strProName) - { - bDraw = true; - this->m_nDrawType = val.toInt(); - } - else if ("方式" == strProName) - { - bDraw = true; - this->m_nFillType = val.toInt(); - } - else if ("左刻度" == strProName) - { - bDraw = true; - this->m_vmin = val.toDouble(); - } - else if ("右刻度" == strProName) - { - bDraw = true; - this->m_vmax = val.toDouble(); - } - else if ("幅度刻度" == strProName) - { - this->m_strAmp = val.toString(); - } - else if ("最大振幅" == strProName) - { - bDraw = true; - this->m_fMaxAmp = val.toFloat(); - } - else if ("显示刻度" == strProName) - { - this->m_bShowScale = val.toBool(); - } - else if ("绘制波深度" == strProName) - { - bDraw = true; - this->m_bDrawDepth = val.toBool(); - } - else if ("绘制波基线" == strProName) - { - bDraw = true; - this->m_bDrawBase = val.toBool(); - } - else if ("奇偶配色" == strProName) - { - bDraw = true; - this->m_bOddEven = val.toBool(); - } - else if ("波列基值" == strProName) - { - bDraw = true; - this->m_fWaveBase = val.toFloat(); - } - else if ("波形间隔" == strProName) - { - bDraw = true; - this->m_nWaveJg = val.toInt(); - } - else if ("波形高度" == strProName) - { - bDraw = true; - this->m_fWaveHei = val.toInt(); - } - else if ("颜色" == strProName) - { - bDraw = true; - this->m_lineColor = val.value(); - } - else if ("线宽" == strProName) - { - this->m_dWidth = val.toInt(); - } - else if ("色板" == strProName) - { - this->m_nSchemeIndex = val.toInt(); - return true; - } - else if ("变密度颜色级数" == strProName) - { - this->m_nColorNum = val.toInt(); - return true; - } - this->update(); - return bDraw; + bool bDraw = false; + if ("显示名称" == strProName) + { + this->m_strAliasName = val.toString(); + } + else if ("显示单位" == strProName) + { + this->m_strUnit = val.toString(); + } + else if ("曲线名称" == strProName || "字体" == strProName) + { + this->m_curveNameFont = val.value(); + } + else if ("曲线单位" == strProName) + { + this->m_curveUnitFont = val.value(); + } + else if ("曲线刻度" == strProName) + { + this->m_curveScaleFont = val.value(); + } + else if ("类型" == strProName) + { + bDraw = true; + this->m_nDrawType = val.toInt(); + } + else if ("方式" == strProName) + { + bDraw = true; + this->m_nFillType = val.toInt(); + } + else if ("左刻度" == strProName) + { + bDraw = true; + this->m_vmin = val.toDouble(); + } + else if ("右刻度" == strProName) + { + bDraw = true; + this->m_vmax = val.toDouble(); + } + else if ("幅度刻度" == strProName) + { + this->m_strAmp = val.toString(); + } + else if ("最大振幅" == strProName) + { + bDraw = true; + this->m_fMaxAmp = val.toFloat(); + } + else if ("显示刻度" == strProName) + { + this->m_bShowScale = val.toBool(); + } + else if ("绘制波深度" == strProName) + { + bDraw = true; + this->m_bDrawDepth = val.toBool(); + } + else if ("绘制波基线" == strProName) + { + bDraw = true; + this->m_bDrawBase = val.toBool(); + } + else if ("奇偶配色" == strProName) + { + bDraw = true; + this->m_bOddEven = val.toBool(); + } + else if ("波列基值" == strProName) + { + bDraw = true; + this->m_fWaveBase = val.toFloat(); + } + else if ("波形间隔" == strProName) + { + bDraw = true; + this->m_nWaveJg = val.toInt(); + } + else if ("波形高度" == strProName) + { + bDraw = true; + this->m_fWaveHei = val.toInt(); + } + else if ("颜色" == strProName) + { + bDraw = true; + this->m_lineColor = val.value(); + } + else if ("线宽" == strProName) + { + this->m_dWidth = val.toInt(); + } + else if ("色板" == strProName) + { + this->m_nSchemeIndex = val.toInt(); + return true; + } + else if ("变密度颜色级数" == strProName) + { + this->m_nColorNum = val.toInt(); + return true; + } + else if ("垂向绘制" == strProName) + { + this->m_bVerticaDrawing = val.toBool(); + } + else if ("旋转角度(°)" == strProName) + { + this->m_nRotationAngle = val.toInt(); + } + else if ("结论占比%" == strProName) + { + bDraw = true; + this->m_nConclusionProportion = val.toInt(); + } + else if ("显示位置(cm)" == strProName) + { + bDraw = true; + this->m_nShowPos = val.toInt(); + } + else if ("显示层号" == strProName) + { + bDraw = true; + this->m_bShowLayerNo = val.toBool(); + } + else if ("层号字体" == strProName) + { + bDraw = true; + this->m_layerFont = val.value(); + } + else if ("层号旋转" == strProName) + { + bDraw = true; + this->m_fLayerRotate = val.toFloat(); + } + + this->update(); + return bDraw; } int FormInfo::getFillTypeIndex() { - return m_nFillType; + return m_nFillType; } //修改曲线选择状态 iSelect=0未知,1标准曲线,2主曲线,3从曲线 void FormInfo::s_ChangeLineStatus(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iSelect, bool bMerge) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_iSelect = iSelect; m_bMerge = bMerge; @@ -720,10 +755,10 @@ void FormInfo::s_ChangeLineStatus(QString strUuid, QString strSlfName, QString s void FormInfo::s_ChangeLeftScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newLeftScale) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_vmin = newLeftScale; update(); @@ -734,10 +769,10 @@ void FormInfo::s_ChangeLeftScale(QString strUuid, QString strSlfName, QString st void FormInfo::s_ChangeRightScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newRightScale) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_vmax = newRightScale; update(); @@ -748,10 +783,10 @@ void FormInfo::s_ChangeRightScale(QString strUuid, QString strSlfName, QString s void FormInfo::s_ChangeScaleType(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strScaleType) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_strScaleType = strScaleType; } @@ -761,10 +796,10 @@ void FormInfo::s_ChangeScaleType(QString strUuid, QString strSlfName, QString st void FormInfo::s_ChangeLineColor(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_lineColor = lineColor; update(); @@ -775,10 +810,10 @@ void FormInfo::s_ChangeLineColor(QString strUuid, QString strSlfName, QString st void FormInfo::s_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_dWidth = width; update(); @@ -789,10 +824,10 @@ void FormInfo::s_ChangeLineWidth(QString strUuid, QString strSlfName, QString st void FormInfo::s_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_lineStyle = lineStyle; update(); @@ -803,10 +838,10 @@ void FormInfo::s_ChangeLineStyle(QString strUuid, QString strSlfName, QString st void FormInfo::s_ClearFillMode(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) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_newFillMode = "无填充"; update(); @@ -819,10 +854,10 @@ void FormInfo::s_ChangeFillMode(QString strUuid, QString strSlfName, QString str float vMin, float vMax, QString strOtherScaleType, QColor frontColor, QColor backColor, QString newFillMode, bool bFillNow) { if(m_strUuid == strUuid && - m_strSlfName == strSlfName && - m_strWellName == strWellName && - m_strTrackName == strTrackName && - m_strLineName == strLineName) + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { m_newFillType = newFillType; m_newTargetLine = newTargetLine; diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 47f27dc..e6843fd 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -67,6 +67,8 @@ public: QString m_strAliasName;//显示名称 QString m_strUnit;//单位 + bool m_bVerticaDrawing = false; // 垂向绘制 + int m_nRotationAngle = 0; // 旋转角度 int m_iSelect=0; //iSelect=0未知,1标准曲线,2主曲线,3从曲线 bool m_bMerge = false;//是拼接状态,否代表校深状态。为了切换时做数据清理 QString m_strType;//类型:curve, wave @@ -116,6 +118,13 @@ public: int m_nColorNum = 256; // 调色板参数设置-变密度颜色级数 int m_nSchemeIndex = 1; // 调色板参数设置-色板 + // 解释结论 + int m_nConclusionProportion = 50; // 结论占比% + int m_nShowPos = 0; // 显示位置(cm) + bool m_bShowLayerNo = true; // 显示层号 + QFont m_layerFont; // 层号字体 + float m_fLayerRotate = 0.0f; // 层号旋转 + public: void setLineWidth(double dWidth); double getLineWidth(); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 7b76cea..5f7ae7e 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -129,7 +129,7 @@ void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW) //curv->setMaximumHeight((int)dHight); //curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184 - this->setGeometry(0, 0, nW-20, (int)dHight);//7500-3184 + this->setGeometry(0, 0, nW-1, (int)dHight);//7500-3184 } void QMyCustomPlot::changePropertyWaveUpdate()