From ce681f8da69d683e078308c1e687bb79da54e70c Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Sun, 17 May 2026 11:24:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?linux=E8=A1=A8=E6=A0=BC=E6=B1=89=E5=AD=97?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WellLogUI/src/griddataadapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WellLogUI/src/griddataadapter.cpp b/WellLogUI/src/griddataadapter.cpp index 78012ec..71f202b 100644 --- a/WellLogUI/src/griddataadapter.cpp +++ b/WellLogUI/src/griddataadapter.cpp @@ -2775,7 +2775,7 @@ void GridDataAdapter::updatetTableWellLogData() QString Qbug = digDec(/*QString::fromLocal8Bit*/(buf)); lstData< Date: Sun, 17 May 2026 11:32:22 +0800 Subject: [PATCH 2/6] =?UTF-8?q?linux=E7=BC=96=E8=AF=91=E4=B8=8D=E8=BF=87?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Slfio/src/slf.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Slfio/src/slf.cpp b/Slfio/src/slf.cpp index 21f6772..dfe78f7 100644 --- a/Slfio/src/slf.cpp +++ b/Slfio/src/slf.cpp @@ -113,12 +113,10 @@ bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name) 0, // low offset: beginning 0); // default: map entire file #else - HANDLE hMapFile = open(slf1.toStdString().c_str(),O_RDONLY)); - if((hMapFile < 0) - { - return false; - } - *hMem = (LPSTR)mmap(0,0,PROT_READ,MAP_SHARED,hMapFile,0)); + int hMapFile = open(slf1.toStdString().c_str(), O_RDONLY); + if (hMapFile<0) + return FALSE; + *hMem = (LPSTR )mmap(0, 0,PROT_READ,MAP_SHARED,hMapFile,0); #endif if (*hMem == NULL) return FALSE; return TRUE; @@ -130,7 +128,7 @@ void CloseView(HANDLE hMapObject,LPVOID lpvMem) if(lpvMem)UnmapViewOfFile(lpvMem); if(hMapObject)CloseHandle(hMapObject); #else - if(lpvMem)munmap(m_rbuf, m_mapsize); + if(lpvMem)munmap(lpvMem,0); if(hMapObject)close(hMapObject); return; #endif From 8ee53acc58914069b22d583a15361eb86661ceb5 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 18 May 2026 10:50:09 +0800 Subject: [PATCH 3/6] =?UTF-8?q?1.=E6=9B=B2=E7=BA=BF=E7=9A=84=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E7=AD=89=E5=9F=BA=E7=A1=80=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E6=8B=96=E6=8B=BD=E5=88=B0=E5=85=B6=E5=AE=83=E9=81=93=E5=90=8E?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=8D=E5=8F=98=E3=80=82=202.=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=98=BE=E7=A4=BA=E7=9A=84=E9=A1=B5=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E9=85=8D=E7=BD=AE=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=BD=8E=E4=BA=8E=E5=88=86=E8=BE=A8=E7=8E=87=EF=BC=8C=E6=80=8E?= =?UTF-8?q?=E9=87=87=E7=94=A8=E5=88=86=E8=BE=A8=E7=8E=87=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/formdraw.cpp | 54 +++++++++++++++++-- logPlus/mainwindow.cpp | 15 ++++++ logPlus/preqtablewidget.cpp | 102 ++++++++++++++++++++++++++++++++++-- 3 files changed, 164 insertions(+), 7 deletions(-) diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 69c88cd..4d03ff4 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -7369,8 +7369,44 @@ void FormDraw::dropEvent(QDropEvent* event) { if(strType=="curveObject") { - //新建曲线 - emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + if (list.size() > 5) + { + QString strListPropertyText = list[4]; + QStringList listOtherProperty = strListPropertyText.split(", "); // 以逗号加空格为分隔符分割字符串 + // + QString strListPropertyMain = list[5]; + QStringList listMainProperty = strListPropertyMain.split(", "); // 以逗号加空格为分隔符分割字符串 + + // + if (listMainProperty.size() > 5) + { + double newLeftScale; + double newRightScale; + QString strScaleType; + QColor lineColor; + double width; + Qt::PenStyle lineStyle; + // + newLeftScale = listMainProperty[0].toDouble(); + newRightScale = listMainProperty[1].toDouble(); + strScaleType = listMainProperty[2]; + lineColor.setNamedColor(listMainProperty[3]); + width = listMainProperty[4].toDouble(); + lineStyle = (Qt::PenStyle)listMainProperty[5].toInt(); + + //新建曲线 + emit CallManage::getInstance()->sig_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } } else if(strType=="waveObject") { @@ -7430,8 +7466,18 @@ void FormDraw::dropEvent(QDropEvent* event) } else if(strType=="LogfaceObject") { - //沉积相 - emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + if (list.size() > 4) + { + QString strListPropertyText = list[4]; + QStringList listOtherProperty = strListPropertyText.split(", "); // 以逗号加空格为分隔符分割字符串 + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); + } + else + { + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } } else if(strType=="MCalsObject") { diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index 8fe9fdd..098a6e5 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -179,6 +179,21 @@ void MainWindow::ReadConfig() int iHeight = 10000; //读取,MyCustom界面高度 qtCommon->readHeight(configPath, iHeight); + if(iHeight == 0) + { + } + else if(iHeight == 1) + { + } + else + { + if(iHeight < QApplication::desktop()->height()) + { + //不能低于分辨率 + iHeight = QApplication::desktop()->height(); + } + } + g_iHeight_MyCustom = iHeight; //Debug模式 diff --git a/logPlus/preqtablewidget.cpp b/logPlus/preqtablewidget.cpp index 54e8619..3feb147 100644 --- a/logPlus/preqtablewidget.cpp +++ b/logPlus/preqtablewidget.cpp @@ -113,7 +113,45 @@ void PreQTableWidget::dropEvent(QDropEvent *event) if(strType=="curveObject") { //新建曲线 - emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + if (list.size() > 5) + { + QString strListPropertyText = list[4]; + QStringList listOtherProperty = strListPropertyText.split(", "); // 以逗号加空格为分隔符分割字符串 + // + QString strListPropertyMain = list[5]; + QStringList listMainProperty = strListPropertyMain.split(", "); // 以逗号加空格为分隔符分割字符串 + + // + if (listMainProperty.size() > 5) + { + double newLeftScale; + double newRightScale; + QString strScaleType; + QColor lineColor; + double width; + Qt::PenStyle lineStyle; + // + newLeftScale = listMainProperty[0].toDouble(); + newRightScale = listMainProperty[1].toDouble(); + strScaleType = listMainProperty[2]; + lineColor.setNamedColor(listMainProperty[3]); + width = listMainProperty[4].toDouble(); + lineStyle = (Qt::PenStyle)listMainProperty[5].toInt(); + + //新建曲线 + emit CallManage::getInstance()->sig_AddLine_Property(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, listOtherProperty); + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + } + else + { + emit CallManage::getInstance()->sig_AddLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName); + } + } else if(strType=="waveObject") { @@ -361,10 +399,61 @@ void PreQTableWidget::performDrag() //属性信息 QString strListPropertyText = ""; + QString strListPropertyMain = ""; if(strType=="curveObject") { //曲线 + //此处属性注意顺序,后续使用按照顺序 + QStringList listOtherProperty; + listOtherProperty.append(formInfo->m_strAliasName); + listOtherProperty.append(formInfo->m_strUnit); + listOtherProperty.append(formInfo->m_curveNameFont.toString());//曲线名称字体 + if(formInfo->m_bDrawLine) + { + listOtherProperty.append("DrawLine"); + } + else{ + listOtherProperty.append("0"); + } + // + if(formInfo->m_bDrawGan) + { + listOtherProperty.append("DrawGan"); + } + else{ + listOtherProperty.append("0"); + } + // + if(formInfo->m_bDrawPoint) + { + listOtherProperty.append("DrawPoint"); + } + else{ + listOtherProperty.append("0"); + } + // + if(formInfo->m_bDrawSymmetry) + { + listOtherProperty.append("DrawSymmetry"); + } + else{ + listOtherProperty.append("0"); + } + // + listOtherProperty.append(QString::number(formInfo->m_pointStyle)); + // + strListPropertyText = listOtherProperty.join(", "); // 合并成一个字符串,元素之间用逗号加空格分隔 + // + QStringList listMainProperty; + listMainProperty.append(QString::number(formInfo->m_vmin)); + listMainProperty.append(QString::number(formInfo->m_vmax)); + listMainProperty.append(formInfo->m_strScaleType); + listMainProperty.append(formInfo->m_lineColor.name()); + listMainProperty.append(QString::number(formInfo->m_dWidth)); + listMainProperty.append(QString::number(formInfo->m_lineStyle)); + // + strListPropertyMain = listMainProperty.join(", "); // 合并成一个字符串,元素之间用逗号加空格分隔 } else if(strType=="waveObject") { @@ -473,12 +562,19 @@ void PreQTableWidget::performDrag() // 这里需要根据你的item数据来设置mimeData,例如: if(strListPropertyText == "") { - mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType); } else { - mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType + "#@@#" + strListPropertyText); + if(strListPropertyMain == "") + { + mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType + "#@@#" + strListPropertyText); + } + else + { + //曲线额外补充属性 + mimeData->setText(formInfo->m_strSlfName + "#@@#"+ formInfo->m_strWellName + "#@@#" +formInfo->m_strLineName + "#@@#" + strType + "#@@#" + strListPropertyText+ "#@@#" + strListPropertyMain); + } } // 创建QDrag对象 QDrag *drag = new QDrag(this); From bb3b9a971ba4af33951b8da7909a404ea00cbdd0 Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Mon, 18 May 2026 14:49:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=A1=A8=E5=90=8D=E6=B1=89=E5=AD=97?= =?UTF-8?q?=E6=97=B6=E4=BF=9D=E5=AD=98=E6=95=B0=E6=8D=AE=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataMgr/src/CreateNewTableDlg.cpp | 6 ++++-- Slfio/src/slf.cpp | 15 ++++++++++++--- WellLogUI/src/WellLogTableDialogNew.cpp | 6 +++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/DataMgr/src/CreateNewTableDlg.cpp b/DataMgr/src/CreateNewTableDlg.cpp index 46b490e..5f83740 100644 --- a/DataMgr/src/CreateNewTableDlg.cpp +++ b/DataMgr/src/CreateNewTableDlg.cpp @@ -2,6 +2,8 @@ #include "DataHelper.h" #include "LogIO.h" #include "dataslothelper.h" +#include "geometryutils.h" + extern DEFAULTTABLE *DefauleTable;//[DefTabNum]; extern int DefTabNum; /* @@ -140,7 +142,7 @@ void CCreateNewTableDlg::slotSave() { QMessageBox::warning(NULL,"警告!",FileName+"\r\n打开井次文件失败!");return ; } - if(logio.FindObjectIndex(TableName.toStdString().c_str())>=0) + if(logio.FindObjectIndex(UTF8ToGBK(TableName))>=0) { QMessageBox::warning(NULL,"警告!","您要产生的表名称已存在!");return; } @@ -189,7 +191,7 @@ void CCreateNewTableDlg::slotSave() *(DWORD *)&pField[i].Reserved = strDigit.toInt(); } - int table=logio.CreateTable(0,TableName.toLocal8Bit().toStdString().c_str(),TableHzName.toLocal8Bit().toStdString().c_str(),fNum,&pField[0],0); + int table=logio.CreateTable(0,UTF8ToGBK(TableName),TableHzName.toLocal8Bit().toStdString().c_str(),fNum,&pField[0],0); delete []pField; logio.CloseTable(table); logio.Close(); diff --git a/Slfio/src/slf.cpp b/Slfio/src/slf.cpp index dfe78f7..ba26468 100644 --- a/Slfio/src/slf.cpp +++ b/Slfio/src/slf.cpp @@ -113,10 +113,19 @@ bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name) 0, // low offset: beginning 0); // default: map entire file #else - int hMapFile = open(slf1.toStdString().c_str(), O_RDONLY); - if (hMapFile<0) +// *hHandle = open(slf1.toStdString().c_str(), O_RDWR|O_CREAT,0644); +// if (*hHandle <0) +// return FALSE; +// void* p = mmap(0, 4096*512,PROT_READ|PROT_WRITE,MAP_SHARED,*hHandle,0); + *hHandle = -1; + void* p = mmap(0, 4096*512,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0); + if (p == MAP_FAILED) + { + //qDebug()<

OpenCurve(m_pWellLogs[0]->GetName().toStdString().c_str()); + int index=logio->OpenCurve(UTF8ToGBK(m_pWellLogs[0]->GetName())); if(index>-1) { flag=1; } @@ -511,7 +511,7 @@ void WellLogTableDialogNew::slotSave() int count=rowCount; for(int j=0;jOpenCurve(m_pWellLogs[j]->GetName().toStdString().c_str()); + int index=logio->OpenCurve(UTF8ToGBK(m_pWellLogs[0]->GetName())); if(index>-1) { float *data=new float[rowCount+1]; @@ -552,7 +552,7 @@ void WellLogTableDialogNew::slotSave() delete logio; return; } - int iIndex=logio->OpenTable(m_pWellLogs[0]->GetName().toStdString().c_str()); + int iIndex=logio->OpenTable(UTF8ToGBK(m_pWellLogs[0]->GetName())); if (iIndex >=0) { int fc=logio->GetTableFieldCount(iIndex); From d9054d26e6ab5cdd5737a18925b617bafee34cc0 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 18 May 2026 18:20:31 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=9B=BA=E4=BA=95=E3=80=81=E5=9C=B0=E8=B4=A8?= =?UTF-8?q?=E5=B1=82=E4=BD=8D=E9=81=93=E3=80=81=E6=9B=B2=E7=BA=BF=E3=80=81?= =?UTF-8?q?=E5=BD=95=E4=BA=95=E5=89=96=E9=9D=A2=E3=80=81=E5=B2=A9=E6=80=A7?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E6=96=87=E5=AD=97=E7=BB=93=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/TransparentDraggableGeoLith.cpp | 14 ++ logPlus/TransparentDraggableGeoLith.h | 1 + logPlus/TransparentDraggableGujing.cpp | 14 ++ logPlus/TransparentDraggableGujing.h | 3 +- logPlus/TransparentDraggableLayer.cpp | 14 ++ logPlus/TransparentDraggableLayer.h | 1 + logPlus/TransparentDraggableRect.cpp | 14 ++ logPlus/TransparentDraggableRect.h | 1 + logPlus/qmycustomplot.cpp | 264 +++++++++++++++++++++--- logPlus/qmycustomplot.h | 8 +- 10 files changed, 298 insertions(+), 36 deletions(-) diff --git a/logPlus/TransparentDraggableGeoLith.cpp b/logPlus/TransparentDraggableGeoLith.cpp index 62a965a..e270a86 100644 --- a/logPlus/TransparentDraggableGeoLith.cpp +++ b/logPlus/TransparentDraggableGeoLith.cpp @@ -830,6 +830,10 @@ int TransparentDraggableGeoLith::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -847,6 +851,16 @@ void TransparentDraggableGeoLith::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableGeoLith.h b/logPlus/TransparentDraggableGeoLith.h index 71a1150..502ce79 100644 --- a/logPlus/TransparentDraggableGeoLith.h +++ b/logPlus/TransparentDraggableGeoLith.h @@ -111,6 +111,7 @@ public: //鼠标形状 bool m_bArrow = false; bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/TransparentDraggableGujing.cpp b/logPlus/TransparentDraggableGujing.cpp index 0a7a17d..d636c8e 100644 --- a/logPlus/TransparentDraggableGujing.cpp +++ b/logPlus/TransparentDraggableGujing.cpp @@ -513,6 +513,10 @@ int TransparentDraggableGujing::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -530,6 +534,16 @@ void TransparentDraggableGujing::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableGujing.h b/logPlus/TransparentDraggableGujing.h index 0870a0e..55fdbc4 100644 --- a/logPlus/TransparentDraggableGujing.h +++ b/logPlus/TransparentDraggableGujing.h @@ -90,7 +90,8 @@ public: //鼠标形状 bool m_bArrow = false; - bool m_bMoveRect = false; + bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/TransparentDraggableLayer.cpp b/logPlus/TransparentDraggableLayer.cpp index 3e43e43..a85252e 100644 --- a/logPlus/TransparentDraggableLayer.cpp +++ b/logPlus/TransparentDraggableLayer.cpp @@ -445,6 +445,10 @@ int TransparentDraggableLayer::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -462,6 +466,16 @@ void TransparentDraggableLayer::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableLayer.h b/logPlus/TransparentDraggableLayer.h index 28451c7..2f3ed75 100644 --- a/logPlus/TransparentDraggableLayer.h +++ b/logPlus/TransparentDraggableLayer.h @@ -104,6 +104,7 @@ public: //鼠标形状 bool m_bArrow = false; bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/TransparentDraggableRect.cpp b/logPlus/TransparentDraggableRect.cpp index 9a6a185..e3a4353 100644 --- a/logPlus/TransparentDraggableRect.cpp +++ b/logPlus/TransparentDraggableRect.cpp @@ -333,6 +333,10 @@ int TransparentDraggableRect::getCursor() { return 1; } + if(m_bNormal) + { + return 3; + } return 0; } @@ -350,6 +354,16 @@ void TransparentDraggableRect::onMouseMove(QMouseEvent *event) } else { + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + QCPRange currentRange = getRange(); + if(y >= currentRange.lower && y <= currentRange.upper) { + m_bNormal = true; + } + else + { + m_bNormal = false; + } + // m_bArrow = false; m_bMoveRect = false; } diff --git a/logPlus/TransparentDraggableRect.h b/logPlus/TransparentDraggableRect.h index b9f7bdd..e6a5ea3 100644 --- a/logPlus/TransparentDraggableRect.h +++ b/logPlus/TransparentDraggableRect.h @@ -96,6 +96,7 @@ public: //鼠标形状 bool m_bArrow = false; bool m_bMoveRect = false; + bool m_bNormal = false; int getCursor(); //鼠标是否拖动item bool m_bChange = false; diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 2de9714..9afcb16 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1311,6 +1311,44 @@ void QMyCustomPlot::mouseDoubleClickEvent(QMouseEvent *event) // 在这里添加你的双击处理逻辑 m_bEditor = true; + //曲线 + if(m_addRandomGraph && m_strLineName != "CORE_PHYSICS") + { + //双击编辑曲线 + onEditLine(); + } + else if (m_strLineName == "GEO_LITH") + { + //录井剖面 + onEditGeoLith(); + } + else if (m_strLineName == "WORDS_RELUST") + { + //岩性描述,文字结论 + onEditText(); + } + else if (m_strLineName == "LAYER_DATA") + { + //地质分层 + onEditLayer(); + } + + //------------ + if(m_strType == "") + { + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + m_strType = pInfo->m_strType; + } + if (m_strType == "gujingObject") + { + //双击编辑固井 + onEditGujing(); + } + // 接受事件 event->accept(); } @@ -1450,7 +1488,7 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) QCustomPlot::mouseMoveEvent(event); - int nmaxCursor = 0; + int nmaxCursor = -1; //解释结论 QObjectList objList = m_mapDragGroup.values(); for( int i = 0; i< objList.size(); i++) @@ -1577,7 +1615,7 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) { this->setCursor(Qt::SizeVerCursor); } - else + else if (nmaxCursor == 3) { QCursor currentCursor = this->cursor(); if(currentCursor == Qt::CrossCursor) @@ -1588,6 +1626,63 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event) this->setCursor(Qt::ArrowCursor); } } + else + { + bool bCheck = false; + //曲线 + /*if(m_addRandomGraph && m_strLineName != "CORE_PHYSICS") + { + bCheck = true; + } + else */if (m_strLineName == "GEO_LITH") + { + //录井剖面 + bCheck = true; + } + else if (m_strLineName == "WORDS_RELUST") + { + //岩性描述,文字结论 + bCheck = true; + } + else if (m_strLineName == "LAYER_DATA") + { + //地质分层 + bCheck = true; + } + + // + if(m_strType == "") + { + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + m_strType = pInfo->m_strType; + } + + // + if (m_strType == "gujingObject") + { + bCheck = true; + } + if(bCheck) + { + //十字标,编辑 + if(m_bEditRect) + { + this->setCursor(Qt::CrossCursor); + } + else + { + this->setCursor(Qt::ArrowCursor); + } + } + else + { + this->setCursor(Qt::ArrowCursor); + } + } // if (mMousePress) { // auto items = selectedItems(); @@ -1792,6 +1887,7 @@ void QMyCustomPlot::s_LineClicked(int index) // } } +//右键 void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { m_event = event; @@ -1802,7 +1898,13 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/ZonePoint.png"), "添加分段线", this, &QMyCustomPlot::onAddShiftLine); menu.addAction(QIcon(::GetImagePath() + "icon/ClearZonePoint.png"), "清除当前分段线", this, &QMyCustomPlot::onDelSelectShiftLine); menu.addAction(QIcon(::GetImagePath() + "icon/ClearZone.png"), "清除全部分段线", this, &QMyCustomPlot::onDelAllShiftLine); - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑曲线", this, &QMyCustomPlot::onEditLine); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑曲线", this, &QMyCustomPlot::onCloseEditLine); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑曲线", this, &QMyCustomPlot::onEditLine); + } menu.exec(event->globalPos()); } @@ -1822,8 +1924,14 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { QMenu menu(this); //录井剖面 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑录井剖面", this, &QMyCustomPlot::onEditGeoLith); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_GeoLith); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑录井剖面", this, &QMyCustomPlot::onCloseEditGeoLith); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑录井剖面", this, &QMyCustomPlot::onEditGeoLith); + } + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_GeoLith); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_GeoLith); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_GeoLith); @@ -1833,8 +1941,14 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { QMenu menu(this); //岩性描述,文字结论 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑文字结论", this, &QMyCustomPlot::onEditText); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Text); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑文字结论", this, &QMyCustomPlot::onCloseEditText); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑文字结论", this, &QMyCustomPlot::onEditText); + } + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Text); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Text); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Text); @@ -1844,8 +1958,14 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) { QMenu menu(this); //地质分层 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑地质分层", this, &QMyCustomPlot::onEditLayer); - menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Layer); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑地质分层", this, &QMyCustomPlot::onCloseEditLayer); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑地质分层", this, &QMyCustomPlot::onEditLayer); + } + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Layer); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Layer); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Layer); @@ -1915,13 +2035,16 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) } // - FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); - if (pInfo == NULL) + if(m_strType == "") { - return; + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + m_strType = pInfo->m_strType; } - QString strType = pInfo->m_strType; - if (strType == "JiegutextObject") + if (m_strType == "JiegutextObject") { QMenu menu(this); //气测/FMT/射孔/文本 @@ -1931,11 +2054,17 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Jiegutext); menu.exec(event->globalPos()); } - else if (strType == "gujingObject") + else if (m_strType == "gujingObject") { QMenu menu(this); //固井 - menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑固井结论", this, &QMyCustomPlot::onEditGujing); + if(m_bEditRect) + { + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "关闭编辑固井结论", this, &QMyCustomPlot::onCloseEditGujing); + } + else{ + menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑固井结论", this, &QMyCustomPlot::onEditGujing); + } menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Gujing); @@ -1943,7 +2072,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "development.png"), "合并结论", this, &QMyCustomPlot::MegResult_Gujing); menu.exec(event->globalPos()); } - else if (strType == "LogfaceObject") + else if (m_strType == "LogfaceObject") { QMenu menu(this); //沉积相 @@ -1951,7 +2080,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) //menu.addAction(QIcon(::GetImagePath() + "icon/Layer.png"), "沉积相自动描述", this, &QMyCustomPlot::ChangeDep); menu.exec(event->globalPos()); } - else if (strType == "TubingstringObject") + else if (m_strType == "TubingstringObject") { QStringList strs=zoneOrder_Tubing.keys(); QStringList mstrs=QString("油管接箍,套管接箍,偏配,封隔器,筛管,喇叭口,水力猫,短接,管底部,油管深").split(","); @@ -1976,7 +2105,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.exec(event->globalPos()); } - else if (strType == "CrackObject") // 裂缝 + else if (m_strType == "CrackObject") // 裂缝 { QMenu menu(this); menu.addAction(QIcon(::GetImagePath() + "curve.png"), "添加裂缝", this, &QMyCustomPlot::addCrackObject); @@ -2019,6 +2148,9 @@ void QMyCustomPlot::onEditLine() } this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + //this->setCursor(Qt::CrossCursor); + + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { @@ -2039,7 +2171,6 @@ void QMyCustomPlot::onEditLine() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2073,7 +2204,7 @@ void QMyCustomPlot::onEditLine() } } - if(abs(right_Hight-left_Low) >= (3*rlev) )//至少选中5个点 + if(abs(right_Hight-left_Low) >= (3*rlev) && abs(right_Hight_Number-left_Low_Number)>0)//至少选中5个点 { // for (int j=right_Hight_Number; j::Iterator it = this->m_mapDraggable_SelectRect.begin(); + if( it != this->m_mapDraggable_SelectRect.end() ) + { + pDraggableRect = (TransparentDraggableSelectRect*)it.value(); + pDraggableRect->deleteRect(); + } + } + replot(); + + m_bEditRect = false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + //右键--添加文字结论 void QMyCustomPlot::onEditText() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { //信号槽只绑定一次,避免重复绑定 @@ -2124,7 +2279,6 @@ void QMyCustomPlot::onEditText() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2171,20 +2325,30 @@ void QMyCustomPlot::onEditText() //属性清空 PropertyService()->InitCurrentViewInfo(); - //取消框选 - this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); - this->setSelectionRectMode(QCP::srmNone); +// //取消框选 +// this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); +// this->setSelectionRectMode(QCP::srmNone); } }); } } +//右键--关闭编辑文字结论 +void QMyCustomPlot::onCloseEditText() +{ + m_bEditRect = false; + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} //右键--添加地质分层 void QMyCustomPlot::onEditLayer() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { //信号槽只绑定一次,避免重复绑定 @@ -2204,7 +2368,6 @@ void QMyCustomPlot::onEditLayer() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2260,11 +2423,24 @@ void QMyCustomPlot::onEditLayer() } } +//右键--关闭编辑地质分层 +void QMyCustomPlot::onCloseEditLayer() +{ + m_bEditRect=false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + //右键--添加固井 void QMyCustomPlot::onEditGujing() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { @@ -2285,7 +2461,6 @@ void QMyCustomPlot::onEditGujing() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2332,14 +2507,24 @@ void QMyCustomPlot::onEditGujing() //属性清空 PropertyService()->InitCurrentViewInfo(); - //取消框选 - this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); - this->setSelectionRectMode(QCP::srmNone); +// //取消框选 +// this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); +// this->setSelectionRectMode(QCP::srmNone); } }); } } +//右键--关闭编辑固井 +void QMyCustomPlot::onCloseEditGujing() +{ + m_bEditRect = false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + // 岩心图片 void QMyCustomPlot::onEditImage() { @@ -2829,7 +3014,9 @@ void QMyCustomPlot::onEditGeoLith() { this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + this->setCursor(Qt::CrossCursor); + m_bEditRect=true;//当前是否正在编辑曲线。 if(m_bFirstTimeConnect) { //信号槽只绑定一次,避免重复绑定 @@ -2849,7 +3036,6 @@ void QMyCustomPlot::onEditGeoLith() } // 当选择完成时,获取矩形范围并放大 QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) - m_bEditRect=true;//当前是否正在编辑曲线。 // 转换为坐标轴范围 double top = rect.top(); @@ -2977,14 +3163,24 @@ void QMyCustomPlot::onEditGeoLith() //属性清空 PropertyService()->InitCurrentViewInfo(); - //取消框选 - this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); - this->setSelectionRectMode(QCP::srmNone); +// //取消框选 +// this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); +// this->setSelectionRectMode(QCP::srmNone); } }); } } +//右键--关闭编辑录井剖面 +void QMyCustomPlot::onCloseEditGeoLith() +{ + m_bEditRect=false; + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); +} + bool QMyCustomPlot::SaveToSLF_SwallCore() { static int isrun=false; diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 340c222..b42f7d6 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -559,12 +559,14 @@ public slots: //右键--编辑曲线 void onEditLine(); + void onCloseEditLine(); //通用 void ClearSelectItems(); //取消选中 //右键--编辑固井 void onEditGujing(); + void onCloseEditGujing(); void addItems_Gujing(); //从剪切板文本数据粘贴 void DeleteItems_Gujing(); //全部清空 void RefreshItems_Gujing(); //刷新数据 @@ -597,7 +599,8 @@ public slots: void AddItem_SWallCore(QStringList lists); //右键--编辑录井剖面 - void onEditGeoLith(); + void onEditGeoLith(); + void onCloseEditGeoLith(); void addItems_GeoLith(); //从剪切板文本数据粘贴 void DeleteItems_GeoLith(); //全部清空 void RefreshItems_GeoLith(); //刷新数据 @@ -605,6 +608,7 @@ public slots: //右键--编辑文字结论 void onEditText(); + void onCloseEditText(); void addItems_Text(); //从剪切板文本数据粘贴 void DeleteItems_Text(); //全部清空 void RefreshItems_Text(); //刷新数据 @@ -612,6 +616,7 @@ public slots: //右键--编辑地质分层 void onEditLayer(); + void onCloseEditLayer(); void addItems_Layer(); //从剪切板文本数据粘贴 void DeleteItems_Layer(); //全部清空 void RefreshItems_Layer(); //刷新数据 @@ -748,6 +753,7 @@ public: //单点移动功能 void executeSingle(QMouseEvent *event); + //右键 virtual void contextMenuEvent(QContextMenuEvent *event); QList m_FracTabList; From 6e6372f26616e9ea054bc6d47e642c216d4fa77f Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Tue, 19 May 2026 10:17:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B2=E7=BA=BF?= =?UTF-8?q?=E6=B7=B1=E5=BA=A6=E9=87=8D=E9=87=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/qtprojectwidgets.cpp | 205 ++++++++++++++++++++++++++++++++++- logPlus/qtprojectwidgets.h | 2 + 2 files changed, 202 insertions(+), 5 deletions(-) diff --git a/logPlus/qtprojectwidgets.cpp b/logPlus/qtprojectwidgets.cpp index c61de4c..8fb6a5c 100644 --- a/logPlus/qtprojectwidgets.cpp +++ b/logPlus/qtprojectwidgets.cpp @@ -266,7 +266,6 @@ void QtProjectWidgets::s_loadTreeWidget(QString fileFull) itemIndex->setExpanded(true); } - void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname) { //Logdata @@ -298,10 +297,6 @@ void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFul } else { - qDebug() << " folderPath " << folderPath; - - - //井目录 //取当前当前目录内容 QDir dir(folderPath); @@ -865,6 +860,11 @@ void QtProjectWidgets::initCurveObjectTreeMenu(QMenu *menu, QTreeWidget *treeWid connect(m_action_DepthShift, SIGNAL(triggered(bool)), this, SLOT(onDepthShift(bool))); menu->addAction(m_action_DepthShift); + m_action_DepthResample = new QAction("深度重采样", treeWidget); + m_action_DepthResample->setIcon(QIcon(GetImagePath() + "icon/AddToTrack.png")); // 设置图标 + connect(m_action_DepthResample, SIGNAL(triggered(bool)), this, SLOT(onDepthResample(bool))); + menu->addAction(m_action_DepthResample); + QAction* action_WaveCompose = new QAction("合成阵列曲线", treeWidget); action_WaveCompose->setIcon(QIcon(GetImagePath() + "icon/RigidDepthShifting.png")); connect(action_WaveCompose, SIGNAL(triggered()), this, SLOT(onWaveCompose())); @@ -1246,6 +1246,201 @@ void QtProjectWidgets::onDepthShift(bool checked) } } +//深度重采样 +void QtProjectWidgets::onDepthResample(bool checked) +{ + double rlev=0.125; + bool ok=0; + QString ss=QInputDialog::getText(NULL,"深度重采样","请输入新的采样间隔",QLineEdit::Normal,QString::number(rlev),&ok); + if(!ok) return; + rlev=ss.toDouble(); + if(rlev==0) return; + int ret=QMessageBox::information(NULL,"提示","不保留原始数据?",QMessageBox::Yes|QMessageBox::No); + QList selectedItemList = ui->treeWidget->selectedItems(); + foreach (QTreeWidgetItem * pItem, selectedItemList) + { + QString strTreeTag = pItem->data(0, Qt::UserRole).toString(); + if (strTreeTag == "wellname") //井名 + { + QList listqWellFiles = m_qmapWellFiles[pItem->text(0)]; + int count = listqWellFiles.count(); + for(int i=0;iSetSlfFileName(listqWellFiles.at(i)); + if(pround){ + QString SlfFileName=pround->GetSlfFileName(); + if(SlfFileName.isEmpty()) continue; + CMemRdWt * logio=new CMemRdWt(); + if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + return ; + }; + char name[64]; + int count1=logio->GetObjectCount(); + QStringList namess; + for(int i=0;iGetObjectStatus(i)!=OBJECT_NORMAL) continue; + logio->GetObjectName(i,name); + if(strstr(name,".OLD")) continue; + short Attribute,SubAttribute; + Attribute=logio->GetObjectType(i); + if(Attribute!=CURVE_OBJECT&&Attribute!=WAVE_OBJECT)continue; + namess.append(name); + int index=logio->OpenChannel(name); + if(index>-1) { + logio->ChannelResamples(index,rlev); + } + /* + CObjWellLog *pLog=dynamic_cast(pround->GetObjectByName(name)); + if(pLog) { + if(pLog->IsLoaded()) + { + pLog->isLoad=false; + pLog->LoadFromSLF(); + } + else pLog->SetRlev(rlev); + } + */ + } + delete logio; + // foreach(QString name1,namess) + // { + // GetObjectEvent().OnDeAttchData(m_SlfFileName,name1); + // GetObjectEvent().OnRefreshData(m_SlfFileName,name1); + // } + if(ret==QMessageBox::Yes) { + CMemRdWt * logio=new CMemRdWt(); + if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + return ; + }; + char name[64]; + int count=logio->GetObjectCount(); + DepthProgress dp; + dp.CreatProgress(0,count,"开始清除对象原始数据..."); + for(int i=0;iGetObjectName(i,name); + if(strstr(name,".OLD")) logio->DiscardObject(name); + dp.SetDepth(i); + } + delete logio; + dp.DelProgress(); + } + CDataImport::ChangetoSlf(SlfFileName); + } + } + } + else if (strTreeTag == "wellItem") //井次 + { + CObjWelllogRound* pround = new CObjWelllogRound; + pround->SetSlfFileName(pItem->data(0, Qt::UserRole+1).toString()); + if(pround){ + QString SlfFileName=pround->GetSlfFileName(); + if(SlfFileName.isEmpty()) continue; + CMemRdWt * logio=new CMemRdWt(); + if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + return ; + }; + char name[64]; + int count=logio->GetObjectCount(); + QStringList namess; + for(int i=0;iGetObjectStatus(i)!=OBJECT_NORMAL) continue; + logio->GetObjectName(i,name); + if(strstr(name,".OLD")) continue; + short Attribute,SubAttribute; + Attribute=logio->GetObjectType(i); + if(Attribute!=CURVE_OBJECT&&Attribute!=WAVE_OBJECT)continue; + int index=logio->OpenChannel(name); + if(index>-1) { + logio->ChannelResamples(index,rlev); + namess.append(name); + } + /* + CObjWellLog *pLog=dynamic_cast(pround->GetObjectByName(name)); + if(pLog) { + if(pLog->IsLoaded()) + { + pLog->isLoad=false; + pLog->LoadFromSLF(); + } + else pLog->SetRlev(rlev); + } + */ + } + delete logio; + // foreach(QString name1,namess) + // { + // GetObjectEvent().OnDeAttchData(m_SlfFileName,name1); + // GetObjectEvent().OnRefreshData(m_SlfFileName,name1); + // } + if(ret==QMessageBox::Yes) { + CMemRdWt * logio=new CMemRdWt(); + if(!logio->Open(SlfFileName.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + return ; + }; + char name[64]; + int count=logio->GetObjectCount(); + DepthProgress dp; + dp.CreatProgress(0,count,"开始清除对象原始数据..."); + for(int i=0;iGetObjectName(i,name); + if(strstr(name,".OLD")) logio->DiscardObject(name); + dp.SetDepth(i); + } + delete logio; + dp.DelProgress(); + } + CDataImport::ChangetoSlf(SlfFileName); + } + } + else { + CObjWellLog* pLog= new CObjWellLog(); + pLog->SetSlfFileName(pItem->data(0, Qt::UserRole+1).toString()); + pLog->SetName(pItem->text(0)); + if(pLog) { + pLog->ReSample(rlev); + // GetObjectEvent().OnDeAttchData(pLog->GetSlfFileName(),pLog->GetName()); + // GetObjectEvent().OnRefreshData(pLog->GetSlfFileName(),pLog->GetName()); + } + if(ret==QMessageBox::Yes) { + CMemRdWt * logio=new CMemRdWt(); + if(!logio->Open(pLog->GetSlfFileName().toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + return ; + }; + char name[64]; + int count=logio->GetObjectCount(); + DepthProgress dp; + dp.CreatProgress(0,count,"开始清除对象原始数据..."); + for(int i=0;iGetObjectName(i,name); + if(strstr(name,".OLD")) logio->DiscardObject(name); + dp.SetDepth(i); + } + delete logio; + dp.DelProgress(); + } + } + } + // foreach(QDialog *pDia,m_pDialogs) + // { + // CBaseDialog *pBD=dynamic_cast(pDia); + // if(pBD) + // { + // pBD->ReFreshWindow(0); + // } + // } +} + //合成阵列曲线 void QtProjectWidgets::onWaveCompose(bool checked) { diff --git a/logPlus/qtprojectwidgets.h b/logPlus/qtprojectwidgets.h index 8f454cf..c8ea200 100644 --- a/logPlus/qtprojectwidgets.h +++ b/logPlus/qtprojectwidgets.h @@ -52,6 +52,7 @@ public slots: void onShowCurve(bool checked = false); //数据查看 void ApplyShiftDepth(QString strSlfName, QString strLineName, double DepthOffset); void onDepthShift(bool checked = false); //深度移动 + void onDepthResample(bool checked = false); //深度重采样 void onWaveCompose(bool checked = false); //合成阵列曲线 void onInfoEdit(bool checked = false); //属性 @@ -120,6 +121,7 @@ public: //曲线对象(AC、BS...)-右键菜单 QAction* m_action_ShowCurve; QAction* m_action_DepthShift; + QAction* m_action_DepthResample; QString m_strWellname; QString m_strSlfName;