From 1287c199a0211b64af982e2906c3e5b67c84404e Mon Sep 17 00:00:00 2001 From: "DESKTOP-450PEFP\\mainc" Date: Wed, 15 Apr 2026 15:18:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=81=93=E5=AE=BD=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formdraw.cpp | 4 +- logPlus/formwell.cpp | 16 +- logPlus/formwell.h | 2 +- logPlus/mainwindowcurve.cpp | 342 +----------------------------------- logPlus/mainwindowcurve.h | 9 - logPlus/qmycustomplot.cpp | 4 +- logPlus/qmycustomplot.h | 2 +- 7 files changed, 20 insertions(+), 359 deletions(-) diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index f033378..67bec2e 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -117,7 +117,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) QString strSlfName = listdt.at(2); QString strLineName = listdt.at(3); QString strType = listdt.at(4); - int nW = listdt.at(5).toInt(); + double dW = listdt.at(5).toDouble(); m_strSlfName = strSlfName; if(m_listLineName.contains(strLineName)) @@ -152,7 +152,7 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo) curv->m_bColGridVisible = false; } curv->setDepthY(m_iY1, m_iY2); - curv->initGeometry(m_strUuid, m_iScale, nW); + curv->initGeometry(m_strUuid, m_iScale, dW); curv->show(); if ("waveObject" == strType) diff --git a/logPlus/formwell.cpp b/logPlus/formwell.cpp index 4b0e462..fc1cc46 100644 --- a/logPlus/formwell.cpp +++ b/logPlus/formwell.cpp @@ -84,12 +84,12 @@ void FormWell::resizeEvent(QResizeEvent *event) //重设表格高度 } -int FormWell::insertColumn(int nw) +int FormWell::insertColumn(double dw) { auto table = ui->tableWidget; int ncolCount = table->columnCount(); table->insertColumn(ncolCount); - table->setColumnWidth(ncolCount, nw * g_dPixelPerCm); + table->setColumnWidth(ncolCount, dw * g_dPixelPerCm); table->setHorizontalHeaderItem(ncolCount, new QTableWidgetItem("")); // ncolCount = table->columnCount(); @@ -126,7 +126,7 @@ QVector FormWell::new_track(QStringList listdt, QString strTrackName) QString strSlfName = listdt.at(2); QString strLineName = listdt.at(3); QString strType = listdt.at(4); - double nW = listdt.at(5).toDouble(); + double dW = listdt.at(5).toDouble(); //判断当前井是否与自己同名 if(strUuid != m_strUuid || strWellName != m_strWellName) @@ -134,11 +134,11 @@ QVector FormWell::new_track(QStringList listdt, QString strTrackName) return vec; } - if(nW <= 0) - nW = g_iOneWidth; + if(dW <= 0) + dW = g_iOneWidth; //增加1列 - int columnCount = this->insertColumn(nW); + int columnCount = this->insertColumn(dW); if(strTrackName.length() <= 0) { @@ -208,7 +208,7 @@ QVector FormWell::new_track(QStringList listdt, QString strTrackName) // trackTop->setFixedWidth(nW/2); vec << trackTop; trackTop->m_strUuid = m_strUuid; - trackTop->m_nTrackW = nW;// / static_cast(g_dPixelPerCm); + trackTop->m_nTrackW = dW;// / static_cast(g_dPixelPerCm); ui->tableWidget->setCellWidget(i, columnCount, trackTop); } else if(i==1) @@ -259,7 +259,7 @@ QVector FormWell::new_track(QStringList listdt, QString strTrackName) formDraw->m_strSlfName = strSlfName; formDraw->m_formTrack = formTrack; formDraw->m_iScale = m_iScale; - formDraw->m_nTrackW = nW; + formDraw->m_nTrackW = dW; ui->tableWidget->setCellWidget(i, columnCount, formDraw);//默认用formDraw填充满 } diff --git a/logPlus/formwell.h b/logPlus/formwell.h index ce4adc5..761e0a9 100644 --- a/logPlus/formwell.h +++ b/logPlus/formwell.h @@ -31,7 +31,7 @@ public: ~FormWell(); // 插入列,返回列索引 - int insertColumn(int nw); + int insertColumn(double dw); QVector new_track(QStringList listdt, QString strTrackName = ""); diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 8e2f3ed..d8edd78 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -4467,8 +4467,8 @@ void MainWindowCurve::DisplayTracks(QJsonArray tracksArray) QJsonValue trackValue = tracksArray[iNum]; QJsonObject trackObj = trackValue.toObject(); // - QString strTrackName = ""; - double nTrackW = 0; + //QString strTrackName = ""; + //double nTrackW = 0; if (trackObj.contains("topinfo") && trackObj.contains("info")) { QJsonValue topVal = trackObj.value("topinfo"); @@ -4480,8 +4480,8 @@ void MainWindowCurve::DisplayTracks(QJsonArray tracksArray) //展示其中一道 DisplayTrack_Top(id, topObj, infoObj); - strTrackName = topObj.value("TrackName").toString(); - nTrackW = topObj.value("TrackW").toDouble(); + //strTrackName = topObj.value("TrackName").toString(); + //nTrackW = topObj.value("TrackW").toDouble(); } } // if (trackObj.contains("info")) @@ -4522,346 +4522,16 @@ void MainWindowCurve::DisplayTrack_Top(int id, QJsonObject trackTop, QJsonObject if(id==0) { //第一道,默认减掉空井宽g_iOneWidth - s_NewTrackChangeWidth(strWellName, nW * g_dPixelPerCm - g_iOneWidth * g_dPixelPerCm); + s_NewTrackChangeWidth(strWellName, nW - g_iOneWidth); } else { - s_NewTrackChangeWidth(strWellName, nW * g_dPixelPerCm); + s_NewTrackChangeWidth(strWellName, nW); } //mainWindowCurve->s_NewTrackChangeWidth(strWellName); } } -//展示其中一道 -void MainWindowCurve::DisplayTrack_One(QJsonObject trackObjInfo, QString strTrackName, int nW) -{ - // - if (trackObjInfo.contains("formInfos")) - { - QJsonValue value = trackObjInfo.value("formInfos"); - if (value.isArray()) { - QJsonArray linesArray = value.toArray(); - qDebug() << "linesArray number:" << QString::number(linesArray.size()); - //展示所有曲线 - DisplayLines(linesArray, strTrackName, nW); - } - } -} - -//展示所有曲线 -void MainWindowCurve::DisplayLines(QJsonArray linesArray, QString strTrackName, int nW) -{ - QMap mapLines; - - int id = 0; - int iCount = linesArray.size(); - for(int i=0; iind) ind=ind2; - if(ind>-1) { - slffilename = strSlfName.mid(ind+1); - strSlfName = slffilename; - } - } - } - if (lineObjInfo.contains("WellName")) - { - QJsonValue value = lineObjInfo.value("WellName"); - if (value.isString()) { - strWellName = value.toString(); - //qDebug() << "WellName:" << strWellName; - } - } -// if (lineObjInfo.contains("TrackName")) -// { -// QJsonValue value = lineObjInfo.value("TrackName"); -// if (value.isString()) { -// strTrackName = value.toString(); -// //qDebug() << "TrackName:" << strTrackName; -// } -// } - if (lineObjInfo.contains("LineName")) - { - QJsonValue value = lineObjInfo.value("LineName"); - if (value.isString()) { - strLineName = value.toString(); - //qDebug() << "LineName:" << strLineName; - } - } - if (lineObjInfo.contains("AliasName")) - { - QJsonValue value = lineObjInfo.value("AliasName"); - if (value.isString()) { - strAliasName = value.toString(); - //qDebug() << "strAliasName:" << strAliasName; - } - } - if (lineObjInfo.contains("Unit")) - { - QJsonValue value = lineObjInfo.value("Unit"); - if (value.isString()) { - strUnit = value.toString(); - //qDebug() << "strUnit:" << strUnit; - } - } - - if (lineObjInfo.contains("vmin")) - { - QJsonValue value = lineObjInfo.value("vmin"); - if (value.isDouble()) { - newLeftScale = value.toDouble(); - //qDebug() << "vmin:" << QString::number(newLeftScale); - } - } - if (lineObjInfo.contains("vmax")) - { - QJsonValue value = lineObjInfo.value("vmax"); - if (value.isDouble()) { - newRightScale = value.toDouble(); - //qDebug() << "vmax:" << QString::number(newRightScale); - } - } - if (lineObjInfo.contains("ScaleType")) - { - QJsonValue value = lineObjInfo.value("ScaleType"); - if (value.isString()) { - strScaleType = value.toString(); - //qDebug() << "ScaleType:" << strScaleType; - } - } - if (lineObjInfo.contains("Width")) - { - QJsonValue value = lineObjInfo.value("Width"); - if (value.isDouble()) { - width = value.toDouble(); - //qDebug() << "Width:" << QString::number(width); - } - } - - if (lineObjInfo.contains("lineStyle")) - { - QJsonValue value = lineObjInfo.value("lineStyle"); - if (value.isDouble()) { - lineStyle = (Qt::PenStyle)value.toInt(); - //qDebug() << "lineStyle:" << QString::number(lineStyle); - } - } - // - if (lineObjInfo.contains("lineColor")) - { - lineColor.setNamedColor(lineObjInfo.value("lineColor").toString()); - } - - QString folderPath = GetLogdataPath(); - folderPath = folderPath + g_prjname; - strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; - - if(strLineName!="") - { - QStringList listOtherProperty; - listOtherProperty.append(strAliasName); - listOtherProperty.append(strUnit); - //新建曲线 - s_AddLine_Property(strSlfName, strWellName, strTrackName, strLineName, - newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); - } - - //--------------- - if (lineObjInfo.contains("newHeadFill")) - { - QJsonValue value = lineObjInfo.value("newHeadFill"); - if (value.isString()) { - newHeadFill = value.toString(); - //qDebug() << "newHeadFill:" << newHeadFill; - } - } - if (lineObjInfo.contains("newTargetLine")) - { - QJsonValue value = lineObjInfo.value("newTargetLine"); - if (value.isString()) { - newTargetLine = value.toString(); - //qDebug() << "newTargetLine:" << newTargetLine; - } - } - if (lineObjInfo.contains("newFillType")) - { - QJsonValue value = lineObjInfo.value("newFillType"); - if (value.isString()) { - newFillType = value.toString(); - //qDebug() << "newFillType:" << newFillType; - } - } - if (lineObjInfo.contains("newFillMode")) - { - QJsonValue value = lineObjInfo.value("newFillMode"); - if (value.isString()) { - newFillMode = value.toString(); - //qDebug() << "newFillMode:" << newFillMode; - } - } - - // - if (lineObjInfo.contains("newColor")) - { - newColor.setNamedColor(lineObjInfo.value("newColor").toString()); - } - - if (lineObjInfo.contains("newLithosImage")) - { - QJsonValue value = lineObjInfo.value("newLithosImage"); - if (value.isString()) { - newLithosImage = value.toString(); - //qDebug() << "newLithosImage:" << newLithosImage; - } - } - if (lineObjInfo.contains("new_vMin")) - { - QJsonValue value = lineObjInfo.value("new_vMin"); - if (value.isDouble()) { - new_vMin = value.toDouble(); - //qDebug() << "new_vMin:" << QString::number(new_vMin); - } - } - if (lineObjInfo.contains("new_vMax")) - { - QJsonValue value = lineObjInfo.value("new_vMax"); - if (value.isDouble()) { - new_vMax = value.toDouble(); - //qDebug() << "new_vMax:" << QString::number(new_vMax); - } - } - // - if (lineObjInfo.contains("frontColor")) - { - frontColor.setNamedColor(lineObjInfo.value("frontColor").toString()); - } - - // - if (lineObjInfo.contains("backColor")) - { - backColor.setNamedColor(lineObjInfo.value("backColor").toString()); - } - - // - if(newFillMode=="无填充") - { - //emit CallManage::getInstance()->sig_ClearFillMode(m_strUuid, strSlfName, strWellName, strTrackName, strLineName); - } - else //if(newFillMode=="填充") - { - //模板不立刻填充,bFillNow=false - emit CallManage::getInstance()->sig_ChangeFillMode(m_strUuid, strSlfName, strWellName, strTrackName, strLineName, - newFillType, newTargetLine, newColor, newLithosImage, newHeadFill, - new_vMin, new_vMax, strOtherScaleType, frontColor, backColor, newFillMode, false); - } -} - -void MainWindowCurve::DisplayType_One(QJsonObject lineObjInfo, QString strTrackName, int nW) -{ - //nW = nW * static_cast(g_dPixelPerCm); - QStringList sret = this->insertCol(nW); - if(sret.length() <= 0) - return; - - QStringList dt; - dt << m_strUuid; - dt << sret.at(0); - dt << sret.at(1); - dt << ""; - dt << "roseObject"; - dt << QString::number(nW); - //新建道 - emit CallManage::getInstance()->sig_NewCol(dt); -} - void MainWindowCurve::resizeItem(QString strWellName, double colWidth, double rowHight) { int column = ui->tableWidget_2->columnCount(); diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 8b3e470..d4c5879 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -100,15 +100,6 @@ public: void DisplayTrack_Top(int id, QJsonObject trackTop, QJsonObject trackInfo); - //展示其中一道 - void DisplayTrack_One(QJsonObject trackObjInfo, QString strTrackName, int nW); - //展示所有曲线 - void DisplayLines(QJsonArray linesArray, QString strTrackName, int nW); - //展示其中一条曲线 - void DisplayLine_One(QJsonObject lineObjInfo, QString strTrackName); - - void DisplayType_One(QJsonObject lineObjInfo, QString strTrackName, int nW); - void Open(QString fileFull);//打开 public: diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index b30db1d..14289f5 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -210,7 +210,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeGuanD(QString, QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGuanD(QString, QString, QString, QString, QString, QString, double))); } -void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW) +void QMyCustomPlot::initGeometry(QString strUuid, int nscale, double fW) { this->m_strUuid = strUuid; @@ -227,7 +227,7 @@ void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW) dHight = 32767; } - int ntmpw = nW * g_dPixelPerCm; + int ntmpw = fW * g_dPixelPerCm; this->setGeometry(0, 0, ntmpw - 2, (int)dHight); } diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index f2b30a3..af1caec 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -58,7 +58,7 @@ public: { } - void initGeometry(QString strUuid, int nscale, int nW); + void initGeometry(QString strUuid, int nscale, double fW); void changePropertyWaveUpdate(); // 绘图类型-变密度(成像)