From bf74027114f1d75395955a49b11dfdf15cf41644 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Wed, 28 Jan 2026 16:32:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=BF=BD=E5=8A=A0=E6=9B=B2=E7=BA=BF=E6=A0=A1?= =?UTF-8?q?=E6=AD=A3=E5=8A=9F=E8=83=BD=202.=E5=AE=9E=E6=97=B6=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=A0=A1=E6=AD=A3=E5=90=8E=E7=9A=84=E6=9B=B2=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 12 ++ common/geometryutils.cpp | 4 +- logPlus/TransparentDraggableLine.cpp | 3 + logPlus/TransparentDraggableLine.h | 2 +- logPlus/mainwindowcurve.cpp | 258 +++++++++++++++++++++++++-- logPlus/mainwindowcurve.h | 41 +++-- logPlus/qmycustomplot.cpp | 152 +++++++++++++++- logPlus/qmycustomplot.h | 11 ++ logPlus/qtprojectwidgets.cpp | 18 ++ 9 files changed, 455 insertions(+), 46 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index aeaa1ca..159e033 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -148,11 +148,23 @@ signals: //校深线段 void sig_AddShifLineToPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double left_Low, double right_Hight); + //右键--清除当前分段线 + void sig_DelSelectShiftLine(QString strUuid); + //清除当前分段线 + void sig_DelSelectShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //右键--清除全部分段线 void sig_DelAllShiftLine(QString strUuid); //清除全部分段线 void sig_DelAllShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //执行校正 + void sig_RuncorFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + void sig_Runcor_List(QString strUuid, QList left_Low_List, QList right_Hight_List); + + //Plot重新加载数据 + void sig_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/common/geometryutils.cpp b/common/geometryutils.cpp index c89d54a..e657263 100644 --- a/common/geometryutils.cpp +++ b/common/geometryutils.cpp @@ -96,7 +96,7 @@ QString GetProjectFolder() } // QString strProjectDir; - strProjectDir = applicationDirPath.mid(0,index+1) + "/project/"; + strProjectDir = applicationDirPath.mid(0,index+1) + "project/"; // QDir dir(strProjectDir); if( !dir.exists( strProjectDir ) ) @@ -120,7 +120,7 @@ QString GetLogdataPath() } // QString strImagePath; - strImagePath = applicationDirPath.mid(0,index+1) + "/Logdata/"; + strImagePath = applicationDirPath.mid(0,index+1) + "Logdata/"; // QDir dir(strImagePath); if( !dir.exists( strImagePath ) ) diff --git a/logPlus/TransparentDraggableLine.cpp b/logPlus/TransparentDraggableLine.cpp index d962347..8ffb681 100644 --- a/logPlus/TransparentDraggableLine.cpp +++ b/logPlus/TransparentDraggableLine.cpp @@ -34,6 +34,9 @@ void TransparentDraggableLine::setTitle(QString strTitle) // 设置矩形范围 void TransparentDraggableLine::setRange(double left_Low, double right_Hight) { + m_left_Low = left_Low; + m_right_Hight = right_Hight; + double lY1 = mPlot->yAxis->range().lower;//+10 double lY2 = mPlot->yAxis->range().upper; diff --git a/logPlus/TransparentDraggableLine.h b/logPlus/TransparentDraggableLine.h index b610282..9743cdb 100644 --- a/logPlus/TransparentDraggableLine.h +++ b/logPlus/TransparentDraggableLine.h @@ -47,7 +47,7 @@ private slots: void onMouseMove(QMouseEvent *event); void onMouseRelease(QMouseEvent *event); -private: +public: QMyCustomPlot *mPlot; QCPItemLine *qcpItemLine; diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index d541b6c..e219d66 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -118,9 +118,14 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) : connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString))); //右键--添加分段线 connect(CallManage::getInstance(), SIGNAL(sig_AddShiftLine(QString, double, double)), this, SLOT(s_AddShiftLine(QString, double, double))); + //右键--清除当前分段线 + connect(CallManage::getInstance(), SIGNAL(sig_DelSelectShiftLine(QString)), this, SLOT(s_DelSelectShiftLine(QString))); //右键--清除全部分段线 connect(CallManage::getInstance(), SIGNAL(sig_DelAllShiftLine(QString)), this, SLOT(s_DelAllShiftLine(QString))); + //执行校正 + connect(CallManage::getInstance(), SIGNAL(sig_Runcor_List(QString, QList, QList)), this, SLOT(s_Runcor_List(QString, QList, QList))); + //图头 m_dock1=new QDockWidget(tr(""),this); m_dock1->setFeatures(QDockWidget::NoDockWidgetFeatures);//QDockWidget::DockWidgetMovable @@ -494,7 +499,7 @@ void MainWindowCurve::initToolBar_2() connect(m_CorrectionAc, &QAction::triggered, this, &MainWindowCurve::s_Correction); // connect(m_ShiftotherAc, &QAction::triggered, this, &MainWindowCurve::s_Shiftother); connect(m_autocorAc, &QAction::triggered, this, &MainWindowCurve::s_autocor); -// connect(m_runcorAc, &QAction::triggered, this, &MainWindowCurve::s_runcor); + connect(m_runcorAc, &QAction::triggered, this, &MainWindowCurve::s_runcor); connect(m_ClearAllSetCurveAc, &QAction::triggered, this, &MainWindowCurve::s_ClearAllSetCurve); connect(m_ClearSetCurveAc, &QAction::triggered, this, &MainWindowCurve::s_ClearSetCurve); @@ -557,15 +562,10 @@ void MainWindowCurve::ApplyShiftDepth(QString strSlfName, QString strLineName, d logio->CorrectObjectDepth(curveindex, DepthOffset); isok=1; } -// Slf_CURVE acurveinfo; -// logio->GetCurveInfo(curveindex,&acurveinfo); delete logio; - //DepthOffset = 0; -// if(isRun&&isok) { -// isLoad=false; -// LoadFromSLF(); -// } + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot(m_strUuid, strSlfName, strLineName); } void MainWindowCurve::s_Shift() @@ -648,10 +648,9 @@ void MainWindowCurve::MoveShift(QString strSlfName, QString strLineName, float s WriteShiftMessage(*logio,szBuffer,strLineName); logio->CorrectObjectDepth(curveindex,delta); delete logio; -// if(isRun) { -// isLoad=false; -// LoadFromSLF(); -// } + + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot(m_strUuid, strSlfName, strLineName); return; } curveindex=logio->OpenChannel(strLineName.toStdString().c_str()); @@ -682,10 +681,9 @@ void MainWindowCurve::MoveShift(QString strSlfName, QString strLineName, float s } } delete logio; -// if(isRun) { -// isLoad=false; -// LoadFromSLF(); -// } + + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot(m_strUuid, strSlfName, strLineName); } void MainWindowCurve::slotRun() @@ -1063,6 +1061,38 @@ void MainWindowCurve::s_AddShiftLine(QString strUuid, double left_Low, double ri emit CallManage::getInstance()->sig_AddShifLineToPlot(m_strUuid, m_LeftCurve.m_strSlfName, m_LeftCurve.m_strWellName, m_LeftCurve.m_strTrackName, m_LeftCurve.m_strLineName, left_Low, right_Hight); } +//右键--清除当前分段线 +void MainWindowCurve::s_DelSelectShiftLine(QString strUuid) +{ + if(strUuid != m_strUuid) + { + return; + } + + //当前有标准曲线 + if(m_LeftCurve.m_iTableType==3 && m_LeftCurve.m_strFormInfoType=="curveObject") + { + } + else + { + QMessageBox::warning(this, "提示", "请先选择标准曲线!"); + return; + } + +// //当前有主校曲线 +// if(m_RightCurve.m_iTableType==3 && m_RightCurve.m_strFormInfoType=="curveObject") +// { +// } +// else +// { +// QMessageBox::warning(this, "提示", "请先选择校正曲线!"); +// return; +// } + + //通知界面,清除当前分段线 + emit CallManage::getInstance()->sig_DelSelectShiftLineFromPlot(m_strUuid, m_LeftCurve.m_strSlfName, m_LeftCurve.m_strWellName, m_LeftCurve.m_strTrackName, m_LeftCurve.m_strLineName); +} + //右键--清除全部分段线 void MainWindowCurve::s_DelAllShiftLine(QString strUuid) { @@ -1091,7 +1121,7 @@ void MainWindowCurve::s_DelAllShiftLine(QString strUuid) // return; // } - //通知界面,增加一条校深线段 + //通知界面,清除全部分段线 emit CallManage::getInstance()->sig_DelAllShiftLineFromPlot(m_strUuid, m_LeftCurve.m_strSlfName, m_LeftCurve.m_strWellName, m_LeftCurve.m_strTrackName, m_LeftCurve.m_strLineName); } @@ -1236,6 +1266,200 @@ void MainWindowCurve::s_autocor() } } +//执行校正 +void MainWindowCurve::s_runcor() +{ + //当前有标准曲线 + if(m_LeftCurve.m_iTableType==3 && m_LeftCurve.m_strFormInfoType=="curveObject") + { + } + else + { + QMessageBox::warning(this, "提示", "请先选择标准曲线!"); + return; + } + + //当前有主校曲线 + if(m_RightCurve.m_iTableType==3 && m_RightCurve.m_strFormInfoType=="curveObject") + { + } + else + { + QMessageBox::warning(this, "提示", "请先选择校正曲线!"); + return; + } + + //通知界面,执行校正 + emit CallManage::getInstance()->sig_RuncorFromPlot(m_strUuid, m_LeftCurve.m_strSlfName, m_LeftCurve.m_strWellName, m_LeftCurve.m_strTrackName, m_LeftCurve.m_strLineName); + +} + +void MainWindowCurve::s_Runcor_List(QString strUuid, QList left_Low_List, QList right_Hight_List) +{ + if(strUuid != m_strUuid) + { + return; + } + + //当前有标准曲线 + if(m_LeftCurve.m_iTableType==3 && m_LeftCurve.m_strFormInfoType=="curveObject") + { + } + else + { + QMessageBox::warning(this, "提示", "请先选择标准曲线!"); + return; + } + + //当前有主校曲线 + if(m_RightCurve.m_iTableType==3 && m_RightCurve.m_strFormInfoType=="curveObject") + { + } + else + { + QMessageBox::warning(this, "提示", "请先选择校正曲线!"); + return; + } + + m_mergeLineList.clear(); + // + int itemCount =left_Low_List.size(); + int m_nDepPairsNum=itemCount; + QList ShiftCurvesAll; + ShiftCurvesAll.append(m_RightCurve); + ShiftCurvesAll.append(m_ShiftCurves); + if(ShiftCurvesAll.size()<1) return; + + // + for(int i=0;iSetLeftDepth(left_Low_List[i]); + pLine->SetRightDepth(right_Hight_List[i]); + m_mergeLineList.append(pLine); + } + qsort(m_mergeLineList,0,m_mergeLineList.size()-1,0); + + if(itemCount==1) { + int flag = QMessageBox::information(NULL,"确认","确认要执行深度平移校正吗?",QMessageBox::Yes,QMessageBox::No); + if(flag==QMessageBox::No) return; + + float m_MoveDep=m_mergeLineList[0]->GetLeftDepth()-m_mergeLineList[0]->GetRightDepth(); + for(int i=0;i= 0) + { + CString szBuffer=""; + szBuffer=QString::number(m_MoveDep,'f',3)+"\r\n"; + WriteShiftMessage(mem,szBuffer,curve); + mem.CorrectObjectDepth(iIndex,m_MoveDep); + mem.Close(); + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot(m_strUuid, Filename1, curve); + } + else { + mem.Close(); + } + } + } + return; + } + else if(itemCount==3) { + QMessageBox box(QMessageBox::Warning,"确认","选择校深方式:"); + box.setStandardButtons (QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel); + box.setButtonText(QMessageBox::Yes,QString("压缩拉伸")); + box.setButtonText (QMessageBox::No,QString("平移")); + box.setButtonText (QMessageBox::Cancel,QString("放弃")); + int ret=box.exec(); + if(ret==QMessageBox::Cancel) return; + if(ret==QMessageBox::No) { + float sdep=m_mergeLineList[0]->GetLeftDepth(); + float edep=m_mergeLineList[2]->GetLeftDepth(); + float m_MoveDep=m_mergeLineList[1]->GetLeftDepth()-m_mergeLineList[1]->GetRightDepth(); + for(int i=0;i= 0) + { + Slf_CHANNEL mc; + mem.GetChannelInfo(iIndex,&mc); + if(m_MoveDep) { + CString szBuffer=""; + szBuffer.Format("%10.3f %10.3f %10.3f\r\n",sdep,edep,m_MoveDep); + WriteShiftMessage(mem,szBuffer,curve); + } + } + mem.Close(); + + //单条曲线校深 + MoveShift(Filename1, curve, sdep, edep, m_MoveDep); + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot(m_strUuid, Filename1, curve); + } + } + return; + } + } + else { + if(m_nDepPairsNum<1) + { + QMessageBox::warning(this, "提示", "无校正深度线或深度移动量!"); + return; + } + int flag = QMessageBox::information(NULL,"确认","确认要执行深度校正吗?",QMessageBox::Yes,QMessageBox::No); + if(flag != QMessageBox::Yes) return; + } + + float m_MoveDep=0; + CString szBuffer=""; + if(m_nDepPairsNum>0) { + CString szBuffer1=""; + for(int i=0;iGetLeftDepth(); + float edep=m_mergeLineList[i]->GetRightDepth()+m_MoveDep; + szBuffer1.Format("%g %g\r\n",sdep,edep); + szBuffer+=szBuffer1; + } + } + else if(m_MoveDep) { + szBuffer=QString::number(-m_MoveDep,'f',3)+"\r\n"; + } + for(int i=0;i= 0) { + WriteShiftMessage(mem,szBuffer,curve,"depth_inp"); + WriteShiftMessage(mem,szBuffer,curve); + if(m_MoveDep&&!m_nDepPairsNum) { + mem.CorrectObjectDepth(iIndex,-m_MoveDep); + } + else if(m_nDepPairsNum){ + mem.EShiftDepth((char *)curve.toStdString().c_str()); + } + } + mem.Close(); + + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot(m_strUuid, Filename1, curve); + } + } +} + //清除全部曲线设置 void MainWindowCurve::s_ClearAllSetCurve() { diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index b8479d9..0760a13 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -46,24 +46,6 @@ public: bool eventFilter(QObject* obj, QEvent* event); void onPasteExcelData(); -public slots: - void slot_time(); - //改变缩放比例 - void s_changeScale(QString strUuid, int iNewScale); - //改变深度 - void s_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2); - //改变道宽 - void s_changeWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, int iCurrentCol, int iNewWidth); - - void onItemClicked(QTableWidgetItem* item); - void mousePressEvent(QMouseEvent *event); - void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType); - - //右键--添加分段线 - void s_AddShiftLine(QString strUuid, double left_Low, double right_Hight); - //右键--清除全部分段线 - void s_DelAllShiftLine(QString strUuid); - public slots: void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent* event); @@ -145,6 +127,26 @@ signals: void sig_NewTrackChangeWidth(QString strWellName, int nW=0);//新建道后,改变井宽 void sig_NewWell(QString strWellName); +public slots: + void slot_time(); + //改变缩放比例 + void s_changeScale(QString strUuid, int iNewScale); + //改变深度 + void s_changeDepth(QString strUuid, QString strSlfName, QString strWellName, int iY1, int iY2); + //改变道宽 + void s_changeWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, int iCurrentCol, int iNewWidth); + + void onItemClicked(QTableWidgetItem* item); + void mousePressEvent(QMouseEvent *event); + void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType); + + //右键--添加分段线 + void s_AddShiftLine(QString strUuid, double left_Low, double right_Hight); + //右键--清除当前分段线 + void s_DelSelectShiftLine(QString strUuid); + //右键--清除全部分段线 + void s_DelAllShiftLine(QString strUuid); + public slots: void s_NewWell(QString strWellName, QString strSlfName);//新建井 void s_NewTrackChangeWidth(QString strWellName, int nW=0);//新建道后,改变井宽 @@ -192,6 +194,9 @@ public slots: void s_Correction(); //自动对比 void s_autocor(); + //执行校正 + void s_runcor(); + void s_Runcor_List(QString strUuid, QList left_Low_List, QList right_Hight_List); //清除全部曲线设置 void s_ClearAllSetCurve(); //清除全部从曲线设置 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 22b1565..c547646 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -79,9 +79,16 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel this, SLOT(s_ChangeFillMode(QString, QString, QString, QString, QString, QString, QString, QColor, QString, QString, float, float, QString, QColor, QColor, QString, bool))); //添加校深线段 connect(CallManage::getInstance(), SIGNAL(sig_AddShifLineToPlot(QString, QString, QString, QString, QString, double, double)), this, SLOT(s_AddShifLineToPlot(QString, QString, QString, QString, QString, double, double))); + //清除当前分段线 + connect(CallManage::getInstance(), SIGNAL(sig_DelSelectShiftLineFromPlot(QString, QString, QString, QString, QString)), this, SLOT(s_DelSelectShiftLineFromPlot(QString, QString, QString, QString, QString))); //清除全部分段线 connect(CallManage::getInstance(), SIGNAL(sig_DelAllShiftLineFromPlot(QString, QString, QString, QString, QString)), this, SLOT(s_DelAllShiftLineFromPlot(QString, QString, QString, QString, QString))); + //执行校正 + connect(CallManage::getInstance(), SIGNAL(sig_RuncorFromPlot(QString, QString, QString, QString, QString)), this, SLOT(s_RuncorFromPlot(QString, QString, QString, QString, QString))); + + //Plot重新加载数据 + connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString))); } //蝌蚪图,重绘网格线 @@ -343,6 +350,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) QMenu menu(this); menu.addAction("添加分段线", this, &QMyCustomPlot::onAddShiftLine); + menu.addAction("清除当前分段线", this, &QMyCustomPlot::onDelSelectShiftLine); menu.addAction("清除全部分段线", this, &QMyCustomPlot::onDelAllShiftLine); // QAction *resetAction = menu.addAction("添加框图"); @@ -366,6 +374,13 @@ void QMyCustomPlot::onAddShiftLine() emit CallManage::getInstance()->sig_AddShiftLine(m_strUuid, left_Low, right_Hight); } +//右键--清除当前分段线 +void QMyCustomPlot::onDelSelectShiftLine() +{ + //通知界面,清除当前分段线 + emit CallManage::getInstance()->sig_DelSelectShiftLine(m_strUuid); +} + //右键--清除全部分段线 void QMyCustomPlot::onDelAllShiftLine() { @@ -422,7 +437,30 @@ void QMyCustomPlot::s_AddShifLineToPlot(QString strUuid, QString strSlfName, QSt addLineToPlot(left_Low, right_Hight, ""); } -//校深线段 +//清除当前分段线 +void QMyCustomPlot::s_DelSelectShiftLineFromPlot(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) + { + + } + else + { + return; + } + + if(m_SelectShiftLine) + { + TransparentDraggableLine *pDraggableLine = (TransparentDraggableLine *)m_SelectShiftLine; + pDraggableLine->deleteRect(); + } +} + +//清除全部分段线 void QMyCustomPlot::s_DelAllShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) { if(m_strUuid == strUuid && @@ -439,17 +477,115 @@ void QMyCustomPlot::s_DelAllShiftLineFromPlot(QString strUuid, QString strSlfNam } TransparentDraggableLine *pDraggableLine =NULL; + QMap::Iterator it = m_mapDraggable_Line.begin(); + while( it != m_mapDraggable_Line.end() ) { - QMap::Iterator it = m_mapDraggable_Line.begin(); - while( it != m_mapDraggable_Line.end() ) - { - pDraggableLine = (TransparentDraggableLine*)it.value(); - it++; - pDraggableLine->deleteRect(); - } + pDraggableLine = (TransparentDraggableLine*)it.value(); + it++; + pDraggableLine->deleteRect(); } } +//执行校正 +void QMyCustomPlot::s_RuncorFromPlot(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) + { + + } + else + { + return; + } + + QList left_Low_List; + QList right_Hight_List; + + TransparentDraggableLine *pDraggableLine =NULL; + QMap::Iterator it = m_mapDraggable_Line.begin(); + while( it != m_mapDraggable_Line.end() ) + { + pDraggableLine = (TransparentDraggableLine*)it.value(); + left_Low_List.append(0-pDraggableLine->m_left_Low); + right_Hight_List.append(0-pDraggableLine->m_right_Hight); + + // + it++; + } + + if(left_Low_List.size()<=0) + { + QMessageBox::warning(this, "提示", "无校正深度线或深度移动量!"); + return; + } + + //执行校正 + emit CallManage::getInstance()->sig_Runcor_List(m_strUuid, left_Low_List, right_Hight_List); +} + +//Plot重新加载数据 +void QMyCustomPlot::s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName) +{ + if(m_strSlfName == strSlfName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + + //读取slf + CLogIO *logio=new CLogIO(); + logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead); + // + int index=logio->OpenCurve(strLineName.toStdString().c_str()); + if(index<0) { + delete logio; + return; + } + + Slf_CURVE curveinfo; + float *val; + DWORD count; + float sdep,edep,rlev; + // + logio->GetCurveInfo(index,&curveinfo); + sdep=curveinfo.StartDepth; + edep=curveinfo.EndDepth; + rlev=curveinfo.DepLevel; + // + count=(curveinfo.EndDepth-curveinfo.StartDepth)/curveinfo.DepLevel+1.5; + val=new float[count]; + logio->ReadCurve(index,curveinfo.StartDepth,count,&val[0]); + logio->CloseCurve(index); + delete logio; + + //slf文件读取曲线 + QVector x, y; + for(int i=0; idata()->clear(); + graph(0)->setData(m_x, m_y); + replot(QCustomPlot::rpQueuedReplot); //刷新曲线 +} + void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index bec7703..508dc24 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -148,11 +148,22 @@ public slots: //校深线段 void s_AddShifLineToPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double left_Low, double right_Hight); + //右键--清除当前分段线 + void onDelSelectShiftLine(); + //清除当前分段线 + void s_DelSelectShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //右键--清除全部分段线 void onDelAllShiftLine(); //清除全部分段线 void s_DelAllShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //执行校正 + void s_RuncorFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + + //Plot重新加载数据 + void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName); + void onAddRect(); //蝌蚪图重绘网格线 diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index 1c54235..5f0d0ca 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -864,6 +864,9 @@ void QtProjectWidgets::ApplyShiftDepth(QString strSlfName, QString strLineName, isok=1; } delete logio; + + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot("all", strSlfName, strLineName); } //表格数据查看 @@ -949,6 +952,21 @@ void QtProjectWidgets::onDepthShift_Well(bool checked) WriteShiftMessage(*logio,szBuffer,objname); } delete logio; + + //整口井重新加载数据 + logio=new CMemRdWt(); + if(!logio->Open(m_strSlfName.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + return ; + }; + Count=logio->GetObjectCount(); + for(int i=0;iGetObjectStatus(i)!=OBJECT_NORMAL) continue; + logio->GetObjectName(i,objname); + //Plot重新加载数据 + emit CallManage::getInstance()->sig_ReloadPlot("all", m_strSlfName, objname); + } } //创建新表