From df9db57d8c9e18ba77e1ad06167b2ff5937b0690 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Tue, 30 Dec 2025 11:18:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BA=95=E5=A3=81=E5=8F=96=E5=BF=83?= =?UTF-8?q?=E5=9B=BE=E5=83=8F=EF=BC=8C=E8=BF=BD=E5=8A=A0=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E5=B0=96=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/TransparentDraggableSwallCore.cpp | 44 +++++++++++++++++------ logPlus/TransparentDraggableSwallCore.h | 13 +++++++ logPlus/formdraw.cpp | 15 +++----- logPlus/formdraw.h | 1 + 4 files changed, 52 insertions(+), 21 deletions(-) diff --git a/logPlus/TransparentDraggableSwallCore.cpp b/logPlus/TransparentDraggableSwallCore.cpp index 8f02a0e..ea52c5d 100644 --- a/logPlus/TransparentDraggableSwallCore.cpp +++ b/logPlus/TransparentDraggableSwallCore.cpp @@ -94,10 +94,10 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight return; } - double x1 = mPlot->xAxis->coordToPixel(left_Low); + double x1 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)+m_fImageHeight; double x2 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2); - double y1 = mPlot->yAxis->coordToPixel(lY1); - double y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/5); + double y1 = mPlot->yAxis->coordToPixel(lY1)+(m_fLeftSpace+m_fTriangleLen); + double y2 = mPlot->yAxis->coordToPixel(lY1)+m_fImageWidth+(m_fLeftSpace+m_fTriangleLen); bool bWidthBig = false; double newWidth = y2-y1; @@ -253,9 +253,9 @@ void TransparentDraggableSwallCore::drawOil(double left_Low, double right_Hight, } double x1 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2); - double x2 = mPlot->xAxis->coordToPixel(right_Hight); - double y1 = mPlot->yAxis->coordToPixel(lY1); - double y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/5); + double x2 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)-m_fImageHeight; + double y1 = mPlot->yAxis->coordToPixel(lY1)+(m_fLeftSpace+m_fTriangleLen); + double y2 = mPlot->yAxis->coordToPixel(lY1)+m_fImageWidth+(m_fLeftSpace+m_fTriangleLen); bool bWidthBig = false; double newWidth = y2-y1; @@ -327,8 +327,8 @@ void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight double lY1 = mPlot->yAxis->range().lower;//+10 double lY2 = mPlot->yAxis->range().upper; - mRect->topLeft->setCoords(left_Low, lY1); - mRect->bottomRight->setCoords(right_Hight, lY1+(lY2-lY1)/3); + mRect->topLeft->setCoords(left_Low, lY1+(m_fLeftSpace+m_fTriangleLen)); + mRect->bottomRight->setCoords(right_Hight, lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen); // //位置与rect不一样,否则图像反转 // mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4); @@ -347,11 +347,21 @@ void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight // 设置父锚点,定位点 //mItemTitle->position->setParentAnchor(mRect->bottom); mItemTitle->position->setCoords(mRect->bottomRight->coords().x(), //(mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, - lY1+(lY2-lY1)/4); //(mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+20); //(mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); + //三角形2边 + m_qcpItemLine1->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace); + m_qcpItemLine1->end->setCoords(left_Low, lY1+(m_fLeftSpace+m_fTriangleLen)); + // + m_qcpItemLine2->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace); + m_qcpItemLine2->end->setCoords(right_Hight, lY1+(m_fLeftSpace+m_fTriangleLen)); + // + m_qcpItemLine3->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace); + m_qcpItemLine3->end->setCoords((left_Low+right_Hight)/2, lY1+(m_fLeftSpace+m_fTriangleLen)); + updateHandles(); mPlot->replot(); } @@ -389,6 +399,10 @@ void TransparentDraggableSwallCore::deleteRect() mPlot->removeItem(mPixmap_Oil); //mPlot->removeItem(mPixmap_Color); mPlot->removeItem(mItemTitle); + //三角形2边 + mPlot->removeItem(m_qcpItemLine1); + mPlot->removeItem(m_qcpItemLine2); + mPlot->removeItem(m_qcpItemLine3); mPlot->replot(); this->deleteLater(); @@ -411,7 +425,7 @@ void TransparentDraggableSwallCore::initRect() mRect = new QCPItemRect(mPlot); mRect->setLayer("overlay"); // 确保在最上层 mRect->setBrush(QBrush(QColor(255, 255, 255, 50))); // 半透明蓝色100, 100, 255, 50 - mRect->setPen(QPen(QColor(70, 70, 255, 200))); + mRect->setPen(QPen(QColor(0, 0, 0, 200))); // // 创建左右边界控制点 // mLeftHandle = new QCPItemRect(mPlot); @@ -458,6 +472,16 @@ void TransparentDraggableSwallCore::initRect() //mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio); mItemTitle->position->setCoords(0.5, 0); mItemTitle->setLayer("overlay"); + + //三角形2边 + m_qcpItemLine1 = new QCPItemLine(mPlot); + m_qcpItemLine1->setPen(QPen(QColor(0, 0, 0, 200))); + // + m_qcpItemLine2 = new QCPItemLine(mPlot); + m_qcpItemLine2->setPen(QPen(QColor(0, 0, 0, 200))); + // + m_qcpItemLine3 = new QCPItemLine(mPlot); + m_qcpItemLine3->setPen(QPen(QColor(0, 0, 0, 200))); } void TransparentDraggableSwallCore::updateHandles() diff --git a/logPlus/TransparentDraggableSwallCore.h b/logPlus/TransparentDraggableSwallCore.h index f0e8835..a2faa41 100644 --- a/logPlus/TransparentDraggableSwallCore.h +++ b/logPlus/TransparentDraggableSwallCore.h @@ -76,6 +76,10 @@ private: QCPItemText *mItemTitle; QString mstrTitle=""; QString m_strUuid = ""; + //三角形2边 + QCPItemLine *m_qcpItemLine1; + QCPItemLine *m_qcpItemLine2; + QCPItemLine *m_qcpItemLine3; QString m_Lith; QString m_Oil; @@ -92,6 +96,15 @@ private: // 添加最小宽度成员变量 double mMinWidth; + + // + float m_fLeftSpace=0; //左侧空白长度 + float m_fTriangleLen=40;//三角形长度 + // + float m_fImageWidth=70;//图片长度 + float m_fImageHeight=20;//图片高度 + // + float m_fColorWordLen=40;//颜色文字长度 }; #endif // TRANSPARENTDRAGGABLESWALLCORE_H diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 7ad3dc3..e6bf640 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -1194,14 +1194,6 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe //图像 成像 DrawImageNew_NoFilter(curv, strSlfName, ""); - //道-对象 - QString strAliasName = "井斜方位图"; - QString strUnit = "(°)"; - QColor newlineColor=QColor(0,0,0); - double width=2; - QString strScaleType = ""; - //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "DrawImageObject"); // connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); @@ -2066,7 +2058,7 @@ void FormDraw::DrawImageNew_NoFilter(QMyCustomPlot *widget, QString strSlfName, // 重新缩放键(x)和值(y)轴,以便可以看到整个颜色图: //widget->rescaleAxes(); - QString strAliasName = ""; + QString strAliasName = "成图"; QString strUnit = ""; QColor newlineColor=QColor(0,0,0); double width=2; @@ -4054,9 +4046,10 @@ void FormDraw::DrawDenv(QMyCustomPlot *widget, QString strSlfName) m_csCurveAZIM=("AZIM"); m_csCurveDEVI=("DEVI"); + m_nCircleLineWidth = 2 ; m_nTailWidth=2; m_TailColor=qRgb(255,0,0); - m_crPointFill=qRgb(0,255,0); + m_crPointFillDenv=qRgb(0,0,0); m_crCirCleColor = qRgb(0,0,255); m_nRadius = 4; m_nTailLen=8; @@ -4099,7 +4092,7 @@ void FormDraw::DrawDenv(QMyCustomPlot *widget, QString strSlfName) // QPen pPen(m_TailColor,m_nTailWidth); QPen pPen2(m_crCirCleColor,m_nCircleLineWidth); - QBrush cBrush(m_crPointFill); + QBrush cBrush(m_crPointFillDenv); float tempf,flVal; int i,j,nPointNum=0,tempi; diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index 5bdc6ba..f1041be 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -155,6 +155,7 @@ public: //井斜方位图 QString m_csCurveAZIM, m_csCurveDEVI; // 方位/倾角/可信度 曲线名 QColor m_TailColor,m_crCirCleColor;// add m_crCirCleColor圆线颜色 + QColor m_crPointFillDenv; //文字结论 void initWords(QMyCustomPlot *widget, QString strSlfName, QString strLineName); From fcd9c3a6859230067319103df18844fe850038fa Mon Sep 17 00:00:00 2001 From: jiayulong Date: Tue, 30 Dec 2025 15:30:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=AF=E8=A7=86=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E4=BA=95=E5=90=8E=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BB=8E=E8=8E=B7=E5=8F=96=E5=88=B0=E5=BD=93=E5=89=8D=E4=BA=95?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84slf=E6=96=87=E4=BB=B6=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formwell.cpp | 10 ++ logPlus/formwell.h | 1 + logPlus/mainwindowcurve.cpp | 226 ++++++++++++++++++++++-------------- logPlus/mainwindowcurve.h | 2 +- 4 files changed, 149 insertions(+), 90 deletions(-) diff --git a/logPlus/formwell.cpp b/logPlus/formwell.cpp index a133663..247d421 100644 --- a/logPlus/formwell.cpp +++ b/logPlus/formwell.cpp @@ -368,10 +368,20 @@ void FormWell::s_NewCol(QStringList listdt) QJsonObject FormWell::makeJson() { + // + QString slffilename=QString(""); + int ind=m_strSlfName.lastIndexOf('\\'); + int ind2=m_strSlfName.lastIndexOf('/'); + if(ind2>ind) ind=ind2; + if(ind>-1) { + slffilename=m_strSlfName.mid(ind+1); + } + // 创建根对象 QJsonObject rootObj; // rootObj["WellName"] = m_strWellName; + rootObj["SlfName"] = slffilename; // 创建JSON数组并填充数据 QJsonArray subcaseArray; diff --git a/logPlus/formwell.h b/logPlus/formwell.h index e5cadda..11bbe19 100644 --- a/logPlus/formwell.h +++ b/logPlus/formwell.h @@ -28,6 +28,7 @@ private: public: QString m_strUuid; QString m_strWellName; + QString m_strSlfName=""; public: QJsonObject makeJson(); diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 61b3a2d..38f3e37 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -103,7 +103,7 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) : connect(this, SIGNAL(sig_NewTrackChangeWidth(QString)), this, SLOT(s_NewTrackChangeWidth(QString))); - connect(this, SIGNAL(sig_NewWell(QString)), this, SLOT(s_NewWell(QString))); + //connect(this, SIGNAL(sig_NewWell(QString, QString)), this, SLOT(s_NewWell(QString, QString))); connect(CallManage::getInstance(), SIGNAL(sig_mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); connect(CallManage::getInstance(), SIGNAL(sig_changeScale(int)), this, SLOT(s_changeScale(int))); @@ -524,7 +524,7 @@ QJsonObject MainWindowCurve::makeJson() return rootObj; } -void MainWindowCurve::s_NewWell(QString strWellName) +void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName) { //因为tableWidget需要提前规定好行数与列数 int rowcount = 2; //总行数 @@ -561,6 +561,7 @@ void MainWindowCurve::s_NewWell(QString strWellName) ui->tableWidget_2->setRowHeight(i, 100); // QTableWidgetItem* item = new QTableWidgetItem(strWellName); + item->setData(Qt::UserRole + 1, strSlfName); item->setFlags(item->flags() & (~Qt::ItemIsEditable)); item->setTextAlignment(Qt::AlignCenter); //设置文本居中 ui->tableWidget_2->setItem(i, columnCount, item); @@ -585,6 +586,7 @@ void MainWindowCurve::s_NewWell(QString strWellName) // FormWell *widgetWell = new FormWell(this, strWellName); widgetWell->m_strUuid = m_strUuid; + widgetWell->m_strSlfName = strSlfName; ui->tableWidget_2->setCellWidget(i, columnCount, widgetWell); // @@ -613,15 +615,25 @@ void MainWindowCurve::mousePressEvent(QMouseEvent *event) void MainWindowCurve::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) { - //选中了曲线置顶 - //取消表格选中状态 - ui->tableWidget_2->clearSelection(); + if(m_strUuid == strUuid) + { + // + } + else { + //选中了曲线置顶 + //取消表格选中状态 + ui->tableWidget_2->clearSelection(); + } } void MainWindowCurve::onItemClicked(QTableWidgetItem* item) { qDebug() << "MainWindowCurve onItemClicked"; + //曲线 + QString strWellName = item->text(); + //QString strSlfName = item->data(Qt::UserRole+1).toString(); + PropertyService()->initWellProperty(); //取消所有选中单元格 emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", ""); @@ -664,29 +676,29 @@ void MainWindowCurve::s_NewDepth() { int column = -1; int nW = 100; - QString strSlfName = ""; - QString strLeft = m_leftWidgets->getLeftTreeString(); - if(strLeft.length() > 0) - { - QStringList list = strLeft.split("#@@#");//QString字符串分割函数 - if (list.size() > 3) - { - strSlfName = list[0]; - QString strWellName = list[1]; - // QString strLineName = list[2]; - // QString strType = list[3]; +// QString strSlfName = ""; +// QString strLeft = m_leftWidgets->getLeftTreeString(); +// if(strLeft.length() > 0) +// { +// QStringList list = strLeft.split("#@@#");//QString字符串分割函数 +// if (list.size() > 3) +// { +// strSlfName = list[0]; +// QString strWellName = list[1]; +// // QString strLineName = list[2]; +// // QString strType = list[3]; - if(!m_listWell.contains(strWellName)) - { - //井没创建,创建井+道+曲线 - //新建井 - s_NewWell(strWellName); - m_listWell.push_back(strWellName); +// if(!m_listWell.contains(strWellName)) +// { +// //井没创建,创建井+道+曲线 +// //新建井 +// s_NewWell(strWellName, strSlfName); +// m_listWell.push_back(strWellName); - column= 0; - } - } - } +// column= 0; +// } +// } +// } if(ui->tableWidget_2->columnCount()==0) { @@ -716,6 +728,8 @@ void MainWindowCurve::s_NewDepth() } QString strWellName = ui->tableWidget_2->item(0, column)->text(); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = ui->tableWidget_2->item(0, column)->data(Qt::UserRole+1).toString(); //设置列宽 ui->tableWidget_2->setColumnWidth(column, iWidth+nW+8); @@ -735,29 +749,29 @@ void MainWindowCurve::s_pinLvAc() { int column = -1; int nW = 160; - QString strSlfName = ""; - QString strLeft = m_leftWidgets->getLeftTreeString(); - if(strLeft.length() > 0) - { - QStringList list = strLeft.split("#@@#");//QString字符串分割函数 - if (list.size() > 3) - { - strSlfName = list[0]; - QString strWellName = list[1]; - // QString strLineName = list[2]; - // QString strType = list[3]; +// QString strSlfName = ""; +// QString strLeft = m_leftWidgets->getLeftTreeString(); +// if(strLeft.length() > 0) +// { +// QStringList list = strLeft.split("#@@#");//QString字符串分割函数 +// if (list.size() > 3) +// { +// strSlfName = list[0]; +// QString strWellName = list[1]; +// // QString strLineName = list[2]; +// // QString strType = list[3]; - if(!m_listWell.contains(strWellName)) - { - //井没创建,创建井+道+曲线 - //新建井 - s_NewWell(strWellName); - m_listWell.push_back(strWellName); +// if(!m_listWell.contains(strWellName)) +// { +// //井没创建,创建井+道+曲线 +// //新建井 +// s_NewWell(strWellName, strSlfName); +// m_listWell.push_back(strWellName); - column= 0; - } - } - } +// column= 0; +// } +// } +// } if(ui->tableWidget_2->columnCount()==0) { @@ -787,6 +801,8 @@ void MainWindowCurve::s_pinLvAc() } QString strWellName = ui->tableWidget_2->item(0, column)->text(); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = ui->tableWidget_2->item(0, column)->data(Qt::UserRole+1).toString(); //设置列宽 ui->tableWidget_2->setColumnWidth(column, iWidth+nW+8); @@ -804,16 +820,16 @@ void MainWindowCurve::s_pinLvAc() void MainWindowCurve::s_NewGanZhuangTu() { - QString strSlfName = ""; - QString strLeft = m_leftWidgets->getLeftTreeString(); - if(strLeft.length() > 0) - { - QStringList list = strLeft.split("#@@#");//QString字符串分割函数 - if (list.size() > 3) - { - strSlfName = list[0]; - } - } +// QString strSlfName = ""; +// QString strLeft = m_leftWidgets->getLeftTreeString(); +// if(strLeft.length() > 0) +// { +// QStringList list = strLeft.split("#@@#");//QString字符串分割函数 +// if (list.size() > 3) +// { +// strSlfName = list[0]; +// } +// } if(ui->tableWidget_2->columnCount()==0) { @@ -837,6 +853,9 @@ void MainWindowCurve::s_NewGanZhuangTu() } QString strWellName = ui->tableWidget_2->item(0, column)->text(); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = ui->tableWidget_2->item(0, column)->data(Qt::UserRole+1).toString(); + int iWidth = ui->tableWidget_2->columnWidth(column); int nW = 320; @@ -850,16 +869,16 @@ void MainWindowCurve::s_NewGanZhuangTu() //井眼垮塌矢量图 void MainWindowCurve::s_Jykt() { - QString strSlfName = ""; - QString strLeft = m_leftWidgets->getLeftTreeString(); - if(strLeft.length() > 0) - { - QStringList list = strLeft.split("#@@#");//QString字符串分割函数 - if (list.size() > 3) - { - strSlfName = list[0]; - } - } +// QString strSlfName = ""; +// QString strLeft = m_leftWidgets->getLeftTreeString(); +// if(strLeft.length() > 0) +// { +// QStringList list = strLeft.split("#@@#");//QString字符串分割函数 +// if (list.size() > 3) +// { +// strSlfName = list[0]; +// } +// } if(ui->tableWidget_2->columnCount()==0) { @@ -885,6 +904,9 @@ void MainWindowCurve::s_Jykt() } QString strWellName = ui->tableWidget_2->item(0, column)->text(); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = ui->tableWidget_2->item(0, column)->data(Qt::UserRole+1).toString(); + int iWidth = ui->tableWidget_2->columnWidth(column); int nW = 320; @@ -898,16 +920,16 @@ void MainWindowCurve::s_Jykt() //井斜方位图 void MainWindowCurve::s_Denv() { - QString strSlfName = ""; - QString strLeft = m_leftWidgets->getLeftTreeString(); - if(strLeft.length() > 0) - { - QStringList list = strLeft.split("#@@#");//QString字符串分割函数 - if (list.size() > 3) - { - strSlfName = list[0]; - } - } +// QString strSlfName = ""; +// QString strLeft = m_leftWidgets->getLeftTreeString(); +// if(strLeft.length() > 0) +// { +// QStringList list = strLeft.split("#@@#");//QString字符串分割函数 +// if (list.size() > 3) +// { +// strSlfName = list[0]; +// } +// } if(ui->tableWidget_2->columnCount()==0) { @@ -933,6 +955,9 @@ void MainWindowCurve::s_Denv() } QString strWellName = ui->tableWidget_2->item(0, column)->text(); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = ui->tableWidget_2->item(0, column)->data(Qt::UserRole+1).toString(); + int iWidth = ui->tableWidget_2->columnWidth(column); int nW = 320; @@ -946,16 +971,16 @@ void MainWindowCurve::s_Denv() //图像 成图 void MainWindowCurve::s_DrawImage() { - QString strSlfName = ""; - QString strLeft = m_leftWidgets->getLeftTreeString(); - if(strLeft.length() > 0) - { - QStringList list = strLeft.split("#@@#");//QString字符串分割函数 - if (list.size() > 3) - { - strSlfName = list[0]; - } - } +// QString strSlfName = ""; +// QString strLeft = m_leftWidgets->getLeftTreeString(); +// if(strLeft.length() > 0) +// { +// QStringList list = strLeft.split("#@@#");//QString字符串分割函数 +// if (list.size() > 3) +// { +// strSlfName = list[0]; +// } +// } if(ui->tableWidget_2->columnCount()==0) { @@ -981,6 +1006,9 @@ void MainWindowCurve::s_DrawImage() } QString strWellName = ui->tableWidget_2->item(0, column)->text(); + //直接从选中的井获取,data记录slf路径 + QString strSlfName = ui->tableWidget_2->item(0, column)->data(Qt::UserRole+1).toString(); + int iWidth = ui->tableWidget_2->columnWidth(column); int nW = 320; @@ -1046,7 +1074,7 @@ void MainWindowCurve::NewWellAndTrack(QString strWellName, QString strSlfName, Q { //井没创建,创建井+道+曲线 //新建井 - s_NewWell(strWellName); + s_NewWell(strWellName, strSlfName); m_listWell.push_back(strWellName); //新建道+曲线 @@ -1676,6 +1704,7 @@ void MainWindowCurve::DisplayWells(QJsonArray wellsArray) void MainWindowCurve::DisplayWell_One(QJsonObject wellObjInfo) { QString strWellName = ""; + QString strSlfName = ""; QJsonArray tracksArray; if (wellObjInfo.contains("WellName")) @@ -1687,10 +1716,29 @@ void MainWindowCurve::DisplayWell_One(QJsonObject wellObjInfo) //新建井 //mainWindowCurve->s_NewWell(strWellName); - s_NewWell(strWellName); + //s_NewWell(strWellName); } } + if (wellObjInfo.contains("SlfName")) + { + QJsonValue value = wellObjInfo.value("SlfName"); + if (value.isString()) { + strSlfName = value.toString(); + qDebug() << "strSlfName:" << strSlfName; + + //新建井 + //mainWindowCurve->s_NewWell(strWellName); + //s_NewWell(strWellName); + } + } + + //新建井 + QString folderPath = GetLogdataPath(); + folderPath = folderPath + g_prjname; + strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; + s_NewWell(strWellName, strSlfName); + // if (wellObjInfo.contains("formTracks")) { diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 5790ce0..7f47155 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -98,7 +98,7 @@ signals: void sig_NewWell(QString strWellName); public slots: - void s_NewWell(QString strWellName);//新建井 + void s_NewWell(QString strWellName, QString strSlfName);//新建井 void s_NewTrackChangeWidth(QString strWellName);//新建道后,改变井宽 void s_NewTrack_No_Line(QString strWellName, QString strTrackName);//新建空白道,没有曲线 void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,