diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 57f5cdb..d6e1c0e 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -208,6 +208,9 @@ signals: //改变固井曲线名 void sig_changeGujingLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName); + //改变录井剖面属性 + void sig_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 0ce466d..e4c05b6 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -273,6 +273,21 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant //先处理通用属性 CommonPropertyChanged(pProperty, variant); } + else if (m_strCurrentProperty == GeoLith_Property)//录井剖面 + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + + if("含油占比(1~8)" == m_propertyData[pProperty]) + { + //qDebug() << "含油占比(1~8)->改变"; + + double dOilZhan = variant.value(); + m_formInfo->m_dOilZhan = dOilZhan; + //改变录井剖面属性,含油占比 + emit CallManage::getInstance()->sig_changeGeoLithLine(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, dOilZhan); + } + } else if (m_strCurrentProperty == GujingItem_Property) { //固井结论item @@ -402,6 +417,74 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } } } + else if (m_strCurrentProperty == GeoLithItem_Property) + { + //录井剖面item + if("顶深(m)" == m_propertyData[pProperty]) + { + //qDebug() << "顶深(m)->改变"; + if(m_tdGeoLith) + { + double upper = variant.value(); + m_tdGeoLith->setUpper(-upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + } + } + else if("底深(m)" == m_propertyData[pProperty]) + { + //qDebug() << "底深(m)->改变"; + if(m_tdGeoLith) + { + double lower = variant.value(); + m_tdGeoLith->setLower(-lower); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + } + } + else if("岩性" == m_propertyData[pProperty]) + { + //qDebug() << "岩性->改变"; + if(m_tdGeoLith) + { + QString newResult = variant.value(); + m_tdGeoLith->setLith(newResult, m_tdGeoLith->m_Color); + // + QCPRange currentRange = m_tdGeoLith->getRange(); + m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + } + } + else if("油气" == m_propertyData[pProperty]) + { + //qDebug() << "油气->改变"; + if(m_tdGeoLith) + { + QString newResult = variant.value(); + m_tdGeoLith->setOil(newResult); + // + QCPRange currentRange = m_tdGeoLith->getRange(); + m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + } + } + else if("颜色" == m_propertyData[pProperty]) + { + //qDebug() << "颜色->改变"; + if(m_tdGeoLith) + { + QString newResult = variant.value(); + m_tdGeoLith->setLith(m_tdGeoLith->m_Lith, newResult); + // + QCPRange currentRange = m_tdGeoLith->getRange(); + m_tdGeoLith->setRange(currentRange.lower, currentRange.upper); + //保存 + m_tdGeoLith->mPlot->SaveToSLF_GeoLith(); + } + } + } if("深度比例尺" == m_propertyData[pProperty]) { @@ -1519,6 +1602,11 @@ void PropertyWidget::initProperty(FormInfo *formInfo) //井壁取心 this->initSwallCoreProperty(formInfo); } + else if (m_strLineName == "GEO_LITH") + { + //录井剖面 + this->initGeoLithProperty(formInfo); + } else{ this->initTableProperty(formInfo); } @@ -1708,3 +1796,33 @@ void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); _CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId()); } + +void PropertyWidget::initGeoLithProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + + _CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font); + _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); + + _CreateVariantPropertyItem("显示", "含油占比(1~8)", formInfo->m_dOilZhan, QVariant::Double, 1, 8); + + m_strCurrentProperty = GeoLith_Property; +} + +void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor) +{ + //初始化,清空 + InitCurrentViewInfo(); + + //当前属性类型 + m_strCurrentProperty = GeoLithItem_Property; + m_tdGeoLith = tdGeoLith; + + // + _CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double); + _CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double); + _CreateVariantPropertyItem("当前项", "岩性", myLith, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "油气", myOil, VariantManager::filePathTypeId()); + _CreateVariantPropertyItem("当前项", "颜色", myColor, VariantManager::filePathTypeId()); +} diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 5c00c12..637a4ec 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -22,6 +22,7 @@ #include "formtracktop.h" #include "TransparentDraggableGujing.h" #include "TransparentDraggableSwallCore.h" +#include "TransparentDraggableGeoLith.h" //当前曲线类型 #define Widget_Property "Widget_Property" @@ -38,6 +39,9 @@ #define SwallCore_Property "SwallCore_Property" //井壁取心 #define SwallCoreItem_Property "SwallCoreItem_Property" //井壁取心item +#define GeoLith_Property "GeoLith_Property" //录井剖面 +#define GeoLithItem_Property "GeoLithItem_Property" //录井剖面item + #pragma execution_character_set("utf-8") /** @@ -104,6 +108,7 @@ public: // TransparentDraggableGujing* m_tdGujing; TransparentDraggableSwallCore* m_tdSwallCore; + TransparentDraggableGeoLith* m_tdGeoLith; public: QWidget* GetPropertyWidget(); @@ -134,6 +139,7 @@ public: void initRoseProperty(FormInfo *formInfo); // 波列属性 void initWaveProperty(FormInfo *formInfo, int nType = 3); + // 固井结论属性 void initGujingProperty(FormInfo *formInfo); void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult); @@ -142,8 +148,11 @@ public: void initSwallCoreProperty(FormInfo *formInfo); void initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor); - void ChangFillProperty();//填充属性改变 + // 固井结论属性 + void initGeoLithProperty(FormInfo *formInfo); + void initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor); + void ChangFillProperty();//填充属性改变 void ChangHeadItemProperty();//图头项改变 //处理通用属性 diff --git a/logPlus/TransparentDraggableGeoLith.cpp b/logPlus/TransparentDraggableGeoLith.cpp index 05203a4..fad2575 100644 --- a/logPlus/TransparentDraggableGeoLith.cpp +++ b/logPlus/TransparentDraggableGeoLith.cpp @@ -1,436 +1,390 @@ #include "TransparentDraggableGeoLith.h" +#include "PropertyWidget.h" +#include "CallManage.h" extern double g_dPixelPerCm;//每厘米像素数 //static GeoIndicatorGenerator m_drawGeo; TransparentDraggableGeoLith::TransparentDraggableGeoLith(QMyCustomPlot *parentPlot, QString strUuid, double minWidth, QString strTitle) : QObject(parentPlot), mPlot(parentPlot), mstrTitle(strTitle), mMinWidth(minWidth) - { - m_strUuid = strUuid; - // - initRect(); - } - - TransparentDraggableGeoLith::~TransparentDraggableGeoLith() - { - if(mPlot) { +{ + m_strUuid = strUuid; + // + initRect(); +} + +TransparentDraggableGeoLith::~TransparentDraggableGeoLith() +{ + if(mPlot) { // mPlot->removeItem(mRect); // mPlot->removeItem(mLeftHandle); // mPlot->removeItem(mRightHandle); - } } +} - void TransparentDraggableGeoLith::DrawSVGNormal(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout) +void TransparentDraggableGeoLith::DrawSVGNormal(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout) +{ + QString svg=svgFileName; + QRectF boundingRect = painter->transform().mapRect(borderRect); + painter->save(); + QTransform transform; + transform.reset(); + if (!IsWellSectonHorizonLayout) { - QString svg=svgFileName; - QRectF boundingRect = painter->transform().mapRect(borderRect); - painter->save(); - QTransform transform; - transform.reset(); - if (!IsWellSectonHorizonLayout) - { - painter->setWorldTransform(transform); - } - else - { - } - QPixmap tiledmap(svg); - QRect border(boundingRect.left(),boundingRect.top(),boundingRect.width(),boundingRect.height()); - painter->drawPixmap(border,tiledmap); - painter->restore(); + painter->setWorldTransform(transform); } - //拉伸 - void TransparentDraggableGeoLith::DrawSVGSteched(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout) + else { - QString svg=svgFileName; - QSvgRenderer m_SvgRenderer; - m_SvgRenderer.load(svg); - m_SvgRenderer.render(painter,borderRect); } - //平铺 - void TransparentDraggableGeoLith::DrawSVGTiled(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout) + QPixmap tiledmap(svg); + QRect border(boundingRect.left(),boundingRect.top(),boundingRect.width(),boundingRect.height()); + painter->drawPixmap(border,tiledmap); + painter->restore(); +} +//拉伸 +void TransparentDraggableGeoLith::DrawSVGSteched(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout) +{ + QString svg=svgFileName; + QSvgRenderer m_SvgRenderer; + m_SvgRenderer.load(svg); + m_SvgRenderer.render(painter,borderRect); +} +//平铺 +void TransparentDraggableGeoLith::DrawSVGTiled(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout) +{ + QString svg=svgFileName; + QRectF boundingRect = painter->transform().mapRect(borderRect); + painter->save(); + QTransform transform; + transform.reset(); + if (!IsWellSectonHorizonLayout) { - QString svg=svgFileName; - QRectF boundingRect = painter->transform().mapRect(borderRect); - painter->save(); - QTransform transform; - transform.reset(); - if (!IsWellSectonHorizonLayout) - { - painter->setWorldTransform(transform); - } - else - { - } - QPixmap tiledmap(svg); - painter->drawTiledPixmap(boundingRect,tiledmap); - painter->restore(); + painter->setWorldTransform(transform); } - - - //设置最小宽度 - void TransparentDraggableGeoLith::setMinWidth(double minWidth) - { - mMinWidth = minWidth; - } - - //设置标题 - void TransparentDraggableGeoLith::setTitle(QString strTitle) - { - mstrTitle = strTitle; - mItemTitle->setText(mstrTitle); - //mPlot->replot(); - } - - //设置解释结论 - void TransparentDraggableGeoLith::setLith(QString filePath, QString colorPath) - { - m_Lith = filePath; - m_Color = colorPath; - } - - void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight, double lY1, double lY2) + else { - if(m_Lith=="") - { - return; - } + } + QPixmap tiledmap(svg); + painter->drawTiledPixmap(boundingRect,tiledmap); + painter->restore(); +} - double x1 = mPlot->xAxis->coordToPixel(left_Low); - double x2 = mPlot->xAxis->coordToPixel(right_Hight); - double y1 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/4); - double y2 = mPlot->yAxis->coordToPixel(lY2); - double newWidth = y2-y1; - double newHeight = x1-x2; +//设置最小宽度 +void TransparentDraggableGeoLith::setMinWidth(double minWidth) +{ + mMinWidth = minWidth; +} + +//设置标题 +void TransparentDraggableGeoLith::setTitle(QString strTitle) +{ + mstrTitle = strTitle; + mItemTitle->setText(mstrTitle); + //mPlot->replot(); +} + +//设置解释结论 +void TransparentDraggableGeoLith::setLith(QString filePath, QString colorPath) +{ + m_Lith = filePath; + m_Color = colorPath; +} + +void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight, double lY1, double lY2) +{ + if(m_Lith=="") + { + return; + } + + double x1 = mPlot->xAxis->coordToPixel(left_Low); + double x2 = mPlot->xAxis->coordToPixel(right_Hight); + double y1 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan); + double y2 = mPlot->yAxis->coordToPixel(lY2); + double newWidth = y2-y1; + double newHeight = x1-x2; + + // + QString filePath = m_Lith; + QString strLast = filePath.right(4); + if(strLast.toLower()==".svg") + { + QString path,filename; + GetWellNameAndPath(filePath, filename, path); + QString basename = filename; + + QString val=filePath; + QImage image(newWidth, newHeight, QImage::Format_RGB32); + QPainter painter(&image); + QRectF fillRect(0,0,newWidth, newHeight); + painter.fillRect(fillRect,Qt::white); // - QString filePath = m_Lith; - QString strLast = filePath.right(4); - if(strLast.toLower()==".svg") + //painter.setBrush(QBrush(QPixmap(colorPath))); + //颜色 + QString strLastColor = m_Color.right(4); + if(strLastColor.toLower()==".svg") { - QString path,filename; - GetWellNameAndPath(filePath, filename, path); - QString basename = filename; - - QString val=filePath; - QImage image(newWidth, newHeight, QImage::Format_RGB32); - QPainter painter(&image); - QRectF fillRect(0,0,newWidth, newHeight); - painter.fillRect(fillRect,Qt::white); - // - //painter.setBrush(QBrush(QPixmap(colorPath))); - //颜色 - QString strLastColor = m_Color.right(4); - if(strLastColor.toLower()==".svg") - { - //拉伸 - DrawSVGSteched(&painter,m_Color,fillRect,0); - } - -// bool isStrech=false; -// QSvgRenderer m_SvgRenderer; -// m_SvgRenderer.load(filePath); -// if(!isStrech){ -// float oil_h = fillRect.width(); -// oil_h = (oil_h / 2 >= fillRect.height() / 2) ? fillRect.height() : oil_h; -// float rect_y = fillRect.y() + fillRect.height() / 2 - oil_h / 2; -// fillRect.setY(rect_y); -// fillRect.setHeight(oil_h); -// } -// fillRect.setX(fillRect.x() + 1); -// m_SvgRenderer.render(&painter, fillRect); - //拉伸 - DrawSVGSteched(&painter,filePath,fillRect,0); - //平铺 - //DrawSVGTiled(&painter,filePath,fillRect,0); - //正常 - //DrawSVGNormal(&painter,filePath,fillRect,0); - - val=GetImagePath()+"TempNew"; - QDir ss; - if(!ss.exists(val)) { - ss.mkdir(val); - } - val+=QDir::separator(); - val+=basename+".png"; - image.save(val); - - // - mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片 - - -// QSvgRenderer* svgRender = new QSvgRenderer(); -// svgRender->load(result); -// // -// QPixmap* pixmap = new QPixmap(10, 10); -// pixmap->fill(Qt::transparent);//设置背景透明 -// QPainter p(pixmap); -// svgRender->render(&p); -// // -// mPixmap->setPixmap(*pixmap); // 设置图片 + DrawSVGSteched(&painter,m_Color,fillRect,0); } - else - { -// QString val=filePath; -// QImage image(47,16,QImage::Format_RGB32); -// QPainter painter(&image); -// QRectF fillRect(0,0,47,16); -// painter.fillRect(fillRect, QColor(0, 0, 0, 0)); -// // -// painter.setBrush(QBrush(QPixmap(colorPath))); -// QPixmap* pixmap = new QPixmap(filePath); -// pixmap->fill(Qt::transparent);//设置背景透明 -// mPixmap_Lith->setPixmap(*pixmap); // 设置图片 + //拉伸 + DrawSVGSteched(&painter,filePath,fillRect,0); + //平铺 + //DrawSVGTiled(&painter,filePath,fillRect,0); + //正常 + //DrawSVGNormal(&painter,filePath,fillRect,0); - //mPixmap_Lith->setPixmap(QPixmap(filePath)); // 设置图片 - - - QString path,filename; - GetWellNameAndPath(filePath, filename, path); - QString basename = filename; - - QString val=filePath; - QImage image(newWidth, newHeight, QImage::Format_RGB32); - QPainter painter(&image); - QRectF fillRect(0,0,newWidth, newHeight); - painter.fillRect(fillRect,Qt::white); - //颜色 - QString strLastColor = m_Color.right(4); - if(strLastColor.toLower()==".svg") - { - //拉伸 - DrawSVGSteched(&painter,m_Color,fillRect,0); - } - // - bool isOne=true; - bool isStech=true; - bool isHorizon=false; - float cm = g_dPixelPerCm;//一厘米对应的像素个数 - QColor bkColor = QColor(255,255,255,0); - - float GeoResult = m_drawGeo.seleGeo("岩性符号库", basename, &painter, fillRect, isOne, isStech, isHorizon, cm, bkColor); - - val=GetImagePath()+"TempNew"; - QDir ss; - if(!ss.exists(val)) { - ss.mkdir(val); - } - val+=QDir::separator(); - val+=basename+".png"; - image.save(val); - - // - mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片 + val=GetImagePath()+"TempNew"; + QDir ss; + if(!ss.exists(val)) { + ss.mkdir(val); } - mPixmap_Lith->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x2+1), mPlot->yAxis->pixelToCoord(y1+1));//right_Hight - mPixmap_Lith->bottomRight->setCoords(mPlot->xAxis->pixelToCoord(x1-1), mPlot->yAxis->pixelToCoord(y2-1));//left_Low + val+=QDir::separator(); + val+=basename+".png"; + image.save(val); -// mPixmap_Lith->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4); -// mPixmap_Lith->bottomRight->setCoords(left_Low, lY2); - - //mPlot->replot(); + // + mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片 } - - //设置m_Oil - void TransparentDraggableGeoLith::setOil(QString filePath) - { - m_Oil = filePath; - } - - void TransparentDraggableGeoLith::drawOil(double left_Low, double right_Hight, double lY1, double lY2) + else { - if(m_Oil=="") + QString path,filename; + GetWellNameAndPath(filePath, filename, path); + QString basename = filename; + + QString val=filePath; + QImage image(newWidth, newHeight, QImage::Format_RGB32); + QPainter painter(&image); + QRectF fillRect(0,0,newWidth, newHeight); + painter.fillRect(fillRect,Qt::white); + //颜色 + QString strLastColor = m_Color.right(4); + if(strLastColor.toLower()==".svg") { - return; - } - - double x1 = mPlot->xAxis->coordToPixel(left_Low); - double x2 = mPlot->xAxis->coordToPixel(right_Hight); - double y1 = mPlot->yAxis->coordToPixel(lY1); - double y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/4); - - bool bWidthBig = false; - double newWidth = y2-y1; - double newHeight = x1-x2; - if(newWidth>newHeight) - { - //取小,画正方形框 - newWidth = newHeight; - bWidthBig = true; - } - - float rect_xRight = x2 + newHeight/ 2 - newWidth/ 2; - double xNewRight = mPlot->xAxis->pixelToCoord(rect_xRight+1); - // - float rect_xLeft = rect_xRight + newWidth; - double xNewLeft = mPlot->xAxis->pixelToCoord(rect_xLeft-1); - - // - QString filePath = m_Oil; - // - QString strLast = filePath.right(4); - if(strLast.toLower()==".svg") - { - QString path,filename; - GetWellNameAndPath(filePath, filename, path); - QString basename = filename; - - QString val=filePath; - QImage image(newWidth, newWidth,QImage::Format_RGB32); - QPainter painter(&image); - QRectF fillRect(0,0, newWidth, newWidth); - painter.fillRect(fillRect,Qt::white); //拉伸 - DrawSVGSteched(&painter,filePath,fillRect,0); - //平铺 - //DrawSVGTiled(&painter,filePath,fillRect,0); - //正常 - //DrawSVGNormal(&painter,filePath,fillRect,0); - - val=GetImagePath()+"TempNew"; - QDir ss; - if(!ss.exists(val)) { - ss.mkdir(val); - } - val+=QDir::separator(); - val+=basename+".png"; - image.save(val); - - // - mPixmap_Oil->setPixmap(QPixmap(val)); // 设置图片 + DrawSVGSteched(&painter,m_Color,fillRect,0); } - else - { - mPixmap_Oil->setPixmap(QPixmap(filePath)); // 设置图片 + // + bool isOne=true; + bool isStech=true; + bool isHorizon=false; + float cm = g_dPixelPerCm;//一厘米对应的像素个数 + QColor bkColor = QColor(255,255,255,0); + + float GeoResult = m_drawGeo.seleGeo("岩性符号库", basename, &painter, fillRect, isOne, isStech, isHorizon, cm, bkColor); + + val=GetImagePath()+"TempNew"; + QDir ss; + if(!ss.exists(val)) { + ss.mkdir(val); } + val+=QDir::separator(); + val+=basename+".png"; + image.save(val); - mPixmap_Oil->topLeft->setCoords(xNewRight, mPlot->yAxis->pixelToCoord(y1+1)); //right_Hight, lY1 - mPixmap_Oil->bottomRight->setCoords(xNewLeft, mPlot->yAxis->pixelToCoord(y2-1)); //left_Low + // + mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片 + } + mPixmap_Lith->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x2+1), mPlot->yAxis->pixelToCoord(y1+1));//right_Hight + mPixmap_Lith->bottomRight->setCoords(mPlot->xAxis->pixelToCoord(x1-1), mPlot->yAxis->pixelToCoord(y2-1));//left_Low - //mPlot->replot(); +} + +//设置m_Oil +void TransparentDraggableGeoLith::setOil(QString filePath) +{ + m_Oil = filePath; +} + +void TransparentDraggableGeoLith::drawOil(double left_Low, double right_Hight, double lY1, double lY2) +{ + if(m_Oil=="") + { + return; } - //设置Color - void TransparentDraggableGeoLith::setColor(QString filePath) - { - m_Color = filePath; - // - QString strLast = filePath.right(4); - if(strLast.toLower()==".svg") - { - QString path,filename; - GetWellNameAndPath(filePath, filename, path); - QString basename = filename; + double x1 = mPlot->xAxis->coordToPixel(left_Low); + double x2 = mPlot->xAxis->coordToPixel(right_Hight); + double y1 = mPlot->yAxis->coordToPixel(lY1); + double y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan); - QString val=filePath; - QImage image(320,160,QImage::Format_RGB32); - QPainter painter(&image); - QRectF fillRect(0,0,320,160); - painter.fillRect(fillRect,Qt::white); - //拉伸 - DrawSVGSteched(&painter,filePath,fillRect,0); - //平铺 - //DrawSVGTiled(&painter,filePath,fillRect,0); - //正常 - //DrawSVGNormal(&painter,filePath,fillRect,0); - - val=GetImagePath()+"TempNew"; - QDir ss; - if(!ss.exists(val)) { - ss.mkdir(val); - } - val+=QDir::separator(); - val+=basename+".png"; - image.save(val); - - // - mPixmap_Color->setPixmap(QPixmap(val)); // 设置图片 - } - else - { - mPixmap_Color->setPixmap(QPixmap(filePath)); // 设置图片 - } - - //mPlot->replot(); + bool bWidthBig = false; + double newWidth = y2-y1; + double newHeight = x1-x2; + if(newWidth>newHeight) + { + //取小,画正方形框 + newWidth = newHeight; + bWidthBig = true; } - // 设置矩形范围 - void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight) - { - if(left_Low >= right_Hight) return; - - double lY1 = mPlot->yAxis->range().lower;//+10 - double lY2 = mPlot->yAxis->range().upper; + float rect_xRight = x2 + newHeight/ 2 - newWidth/ 2; + double xNewRight = mPlot->xAxis->pixelToCoord(rect_xRight+1); + // + float rect_xLeft = rect_xRight + newWidth; + double xNewLeft = mPlot->xAxis->pixelToCoord(rect_xLeft-1); - mRect->topLeft->setCoords(left_Low, lY1); - mRect->bottomRight->setCoords(right_Hight, lY2); + // + QString filePath = m_Oil; + // + QString strLast = filePath.right(4); + if(strLast.toLower()==".svg") + { + QString path,filename; + GetWellNameAndPath(filePath, filename, path); + QString basename = filename; - //位置与rect不一样,否则图像反转 - mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4); - mPixmap_Color->bottomRight->setCoords(left_Low, lY2); - // - //mPixmap_Lith->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/4); - //mPixmap_Lith->bottomRight->setCoords(left_Low, lY2); - drawLith(left_Low, right_Hight, lY1, lY2); + QString val=filePath; + QImage image(newWidth, newWidth,QImage::Format_RGB32); + QPainter painter(&image); + QRectF fillRect(0,0, newWidth, newWidth); + painter.fillRect(fillRect,Qt::white); + //拉伸 + DrawSVGSteched(&painter,filePath,fillRect,0); + //平铺 + //DrawSVGTiled(&painter,filePath,fillRect,0); + //正常 + //DrawSVGNormal(&painter,filePath,fillRect,0); - //位置与rect不一样,否则图像反转 - //mPixmap_Oil->topLeft->setCoords(right_Hight, lY1); - //mPixmap_Oil->bottomRight->setCoords(left_Low, lY1+(lY2-lY1)/4); - drawOil(left_Low, right_Hight, lY1, lY2); + val=GetImagePath()+"TempNew"; + QDir ss; + if(!ss.exists(val)) { + ss.mkdir(val); + } + val+=QDir::separator(); + val+=basename+".png"; + image.save(val); - //mItemTitle->position->setCoords(0.5, 0.5); - // 设置父锚点,定位点 - //mItemTitle->position->setParentAnchor(mRect->bottom); - mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, - (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + // + mPixmap_Oil->setPixmap(QPixmap(val)); // 设置图片 + } + else + { + mPixmap_Oil->setPixmap(QPixmap(filePath)); // 设置图片 + } - //mRect->topLeft->setCoords(left, mPlot->yAxis->range().upper); - //mRect->bottomRight->setCoords(right, mPlot->yAxis->range().lower); + mPixmap_Oil->topLeft->setCoords(xNewRight, mPlot->yAxis->pixelToCoord(y1+1)); //right_Hight, lY1 + mPixmap_Oil->bottomRight->setCoords(xNewLeft, mPlot->yAxis->pixelToCoord(y2-1)); //left_Low - updateHandles(); + //mPlot->replot(); +} + +////设置Color +//void TransparentDraggableGeoLith::setColor(QString filePath) +//{ +// m_Color = filePath; +// // +// QString strLast = filePath.right(4); +// if(strLast.toLower()==".svg") +// { +// QString path,filename; +// GetWellNameAndPath(filePath, filename, path); +// QString basename = filename; + +// QString val=filePath; +// QImage image(320,160,QImage::Format_RGB32); +// QPainter painter(&image); +// QRectF fillRect(0,0,320,160); +// painter.fillRect(fillRect,Qt::white); +// //拉伸 +// DrawSVGSteched(&painter,filePath,fillRect,0); +// //平铺 +// //DrawSVGTiled(&painter,filePath,fillRect,0); +// //正常 +// //DrawSVGNormal(&painter,filePath,fillRect,0); + +// val=GetImagePath()+"TempNew"; +// QDir ss; +// if(!ss.exists(val)) { +// ss.mkdir(val); +// } +// val+=QDir::separator(); +// val+=basename+".png"; +// image.save(val); + +// // +// mPixmap_Color->setPixmap(QPixmap(val)); // 设置图片 +// } +// else +// { +// mPixmap_Color->setPixmap(QPixmap(filePath)); // 设置图片 +// } + +// //mPlot->replot(); +//} + +// 设置矩形范围 +void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight, bool bRefresh) +{ + if(left_Low >= right_Hight) return; + + double lY1 = mPlot->yAxis->range().lower;//+10 + double lY2 = mPlot->yAxis->range().upper; + + mRect->topLeft->setCoords(left_Low, lY1); + mRect->bottomRight->setCoords(right_Hight, lY2); + + //位置与rect不一样,否则图像反转 + mPixmap_Color->topLeft->setCoords(right_Hight, lY1+(lY2-lY1)/mPlot->m_dOilZhan); + mPixmap_Color->bottomRight->setCoords(left_Low, lY2); + // + drawLith(left_Low, right_Hight, lY1, lY2); + + //位置与rect不一样,否则图像反转 + drawOil(left_Low, right_Hight, lY1, lY2); + + // 设置父锚点,定位点 + mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2, + (mRect->topLeft->coords().y() + mRect->bottomRight->coords().y())/2); // 设置文本在矩形中心位置 + + updateHandles(); + + if(bRefresh) + { mPlot->replot(); } - - // 获取当前范围 - QCPRange TransparentDraggableGeoLith::getRange() - { - return QCPRange(mRect->topLeft->coords().x(), mRect->bottomRight->coords().x()); - } - - // 设置矩形颜色 - void TransparentDraggableGeoLith::setColor(const QColor &color) - { - mRect->setBrush(QBrush(color)); - mRect->setPen(QPen(color.darker())); - //mPlot->replot(); - } - - // 删除框图 - void TransparentDraggableGeoLith::deleteRect() - { - if(mPlot) { +} + +// 获取当前范围 +QCPRange TransparentDraggableGeoLith::getRange() +{ + return QCPRange(mRect->topLeft->coords().x(), mRect->bottomRight->coords().x()); +} + +// 设置矩形颜色 +void TransparentDraggableGeoLith::setColor(const QColor &color) +{ + mRect->setBrush(QBrush(color)); + mRect->setPen(QPen(color.darker())); + //mPlot->replot(); +} + +// 删除框图 +void TransparentDraggableGeoLith::deleteRect() +{ + if(mPlot) { // mRect->deleteLater(); // mLeftHandle->deleteLater(); // mRightHandle->deleteLater(); // mPixmap->deleteLater(); - mPlot->m_mapDraggable_GeoLith.remove(m_strUuid); + mPlot->m_mapDraggable_GeoLith.remove(m_strUuid); - mPlot->removeItem(mRect); - mPlot->removeItem(mLeftHandle); - mPlot->removeItem(mRightHandle); - mPlot->removeItem(mPixmap_Lith); - mPlot->removeItem(mPixmap_Oil); - mPlot->removeItem(mPixmap_Color); - mPlot->removeItem(mItemTitle); + mPlot->removeItem(mRect); + mPlot->removeItem(mLeftHandle); + mPlot->removeItem(mRightHandle); + mPlot->removeItem(mPixmap_Lith); + mPlot->removeItem(mPixmap_Oil); + mPlot->removeItem(mPixmap_Color); + mPlot->removeItem(mItemTitle); - mPlot->replot(); - this->deleteLater(); + mPlot->replot(); + this->deleteLater(); - // + // // //避免二次绘制框图 // mPlot->m_bDrawRect = false; // mDragMode = DragNone; @@ -438,209 +392,320 @@ TransparentDraggableGeoLith::TransparentDraggableGeoLith(QMyCustomPlot *parentPl // mPlot->selectionRect()->cancel(); // mPlot->replot(); // mPlot->selectionRect()->mActive=true; - } } +} - void TransparentDraggableGeoLith::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))); - - // 创建左右边界控制点 - mLeftHandle = new QCPItemRect(mPlot); - mLeftHandle->setLayer("overlay"); - mLeftHandle->setBrush(QBrush(Qt::red)); - mLeftHandle->setPen(QPen(Qt::darkRed)); - - mRightHandle = new QCPItemRect(mPlot); - mRightHandle->setLayer("overlay"); - mRightHandle->setBrush(QBrush(Qt::red)); - mRightHandle->setPen(QPen(Qt::darkRed)); - - // 设置初始位置 - //double center = mPlot->xAxis->range().center(); +void TransparentDraggableGeoLith::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))); + + // 创建左右边界控制点 + mLeftHandle = new QCPItemRect(mPlot); + mLeftHandle->setLayer("overlay"); + mLeftHandle->setBrush(QBrush(Qt::red)); + mLeftHandle->setPen(QPen(Qt::darkRed)); + + mRightHandle = new QCPItemRect(mPlot); + mRightHandle->setLayer("overlay"); + mRightHandle->setBrush(QBrush(Qt::red)); + mRightHandle->setPen(QPen(Qt::darkRed)); + + // 设置初始位置 + //double center = mPlot->xAxis->range().center(); // setRange(center - 10, center + 10); - - // 连接鼠标事件 - connect(mPlot, &QCustomPlot::mousePress, this, &TransparentDraggableGeoLith::onMousePress); - connect(mPlot, &QCustomPlot::mouseMove, this, &TransparentDraggableGeoLith::onMouseMove); - connect(mPlot, &QCustomPlot::mouseRelease, this, &TransparentDraggableGeoLith::onMouseRelease); - - mPixmap_Lith = new QCPItemPixmap(mPlot); - //mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片 - mPixmap_Lith->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 KeepAspectRatio - mPixmap_Lith->setLayer("overlay"); // 确保在最上层 - mPixmap_Oil = new QCPItemPixmap(mPlot); - //mPixmap_Oil->setPixmap(QPixmap(":/image/file.png")); // 设置图片 - mPixmap_Oil->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 KeepAspectRatio - mPixmap_Oil->setLayer("overlay"); // 确保在最上层 + // 连接鼠标事件 + connect(mPlot, &QCustomPlot::mousePress, this, &TransparentDraggableGeoLith::onMousePress); + connect(mPlot, &QCustomPlot::mouseMove, this, &TransparentDraggableGeoLith::onMouseMove); + connect(mPlot, &QCustomPlot::mouseRelease, this, &TransparentDraggableGeoLith::onMouseRelease); - mPixmap_Color = new QCPItemPixmap(mPlot); - //mPixmap_Color->setPixmap(QPixmap(":/image/file.png")); // 设置图片 - mPixmap_Color->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 KeepAspectRatio - mPixmap_Color->setLayer("overlay"); // 确保在最上层 + mPixmap_Lith = new QCPItemPixmap(mPlot); + //mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片 + mPixmap_Lith->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 KeepAspectRatio + mPixmap_Lith->setLayer("overlay"); // 确保在最上层 - mItemTitle = new QCPItemText(mPlot); - mItemTitle->setText(mstrTitle); - //mItemTitle->setBrush(QBrush(Qt::red)); - mItemTitle->setFont(QFont("Arial", 12, QFont::Bold)); - mItemTitle->setColor(Qt::black); - mItemTitle->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter); - mItemTitle->position->setType(QCPItemPosition::ptPlotCoords); - //mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio); - mItemTitle->position->setCoords(0.5, 0); - mItemTitle->setLayer("overlay"); + mPixmap_Oil = new QCPItemPixmap(mPlot); + //mPixmap_Oil->setPixmap(QPixmap(":/image/file.png")); // 设置图片 + mPixmap_Oil->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 KeepAspectRatio + mPixmap_Oil->setLayer("overlay"); // 确保在最上层 + + mPixmap_Color = new QCPItemPixmap(mPlot); + //mPixmap_Color->setPixmap(QPixmap(":/image/file.png")); // 设置图片 + mPixmap_Color->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式 KeepAspectRatio + mPixmap_Color->setLayer("overlay"); // 确保在最上层 + + mItemTitle = new QCPItemText(mPlot); + mItemTitle->setText(mstrTitle); + //mItemTitle->setBrush(QBrush(Qt::red)); + mItemTitle->setFont(QFont("Arial", 12, QFont::Bold)); + mItemTitle->setColor(Qt::black); + mItemTitle->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter); + mItemTitle->position->setType(QCPItemPosition::ptPlotCoords); + //mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio); + mItemTitle->position->setCoords(0.5, 0); + mItemTitle->setLayer("overlay"); +} + +void TransparentDraggableGeoLith::updateHandles() +{ + // 左边界矩形控制点 + mLeftHandle->topLeft->setParentAnchor(mRect->topLeft); + mLeftHandle->bottomRight->setParentAnchor(mRect->topRight);//(mRect->bottomLeft); + mLeftHandle->topLeft->setCoords(-0.5, 0.5); // 矩形大小 + mLeftHandle->bottomRight->setCoords(0.5, -0.5); // 矩形大小 + + // 右边界矩形控制点 + mRightHandle->topLeft->setParentAnchor(mRect->bottomLeft); + mRightHandle->bottomRight->setParentAnchor(mRect->bottomRight); + mRightHandle->topLeft->setCoords(-0.5, 0.5); // 矩形大小 + mRightHandle->bottomRight->setCoords(0.5, -0.5); // 矩形大小 +} + +//分割 +void TransparentDraggableGeoLith::onSplitRect() +{ + QCPRange currentRange = getRange(); + //分割后显示上半部分 + setRange((currentRange.lower+currentRange.upper)/2.0, currentRange.upper); + + //添加下半部分 + mPlot->addGeoLithToPlot(currentRange.lower, (currentRange.lower+currentRange.upper)/2.0, m_Lith, m_Oil, m_Color); + + //保存 + mPlot->SaveToSLF_GeoLith(); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); + + //取消所有选中单元格 + emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, ""); +} + +void TransparentDraggableGeoLith::onDelRect() +{ + //mDragMode = DragNone; + //删除框图 + deleteRect(); + //保存 + mPlot->SaveToSLF_GeoLith(); + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + +//设置深度移动量 +void TransparentDraggableGeoLith::setItemDepthOffset() +{ + bool ok=0; + double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok); + if(!ok) return; + + QCPRange currentRange = getRange(); + QCPRange newRange = currentRange; + + newRange.lower = currentRange.lower-depthshift; + newRange.upper = currentRange.upper-depthshift; + + // + double width = currentRange.size(); +// //double center = mDragStartRange.center() + dx; +// double center = currentRange.center() - depthshift; +// newRange.lower = center - width/2; +// newRange.upper = center + width/2; + + // 检查是否超出轴范围 + if(newRange.lower < getMyLower()) { + return; } - - void TransparentDraggableGeoLith::updateHandles() - { - // 左边界矩形控制点 - mLeftHandle->topLeft->setParentAnchor(mRect->topLeft); - mLeftHandle->bottomRight->setParentAnchor(mRect->topRight);//(mRect->bottomLeft); - mLeftHandle->topLeft->setCoords(-0.5, 0.5); // 矩形大小 - mLeftHandle->bottomRight->setCoords(0.5, -0.5); // 矩形大小 - - // 右边界矩形控制点 - mRightHandle->topLeft->setParentAnchor(mRect->bottomLeft); - mRightHandle->bottomRight->setParentAnchor(mRect->bottomRight); - mRightHandle->topLeft->setCoords(-0.5, 0.5); // 矩形大小 - mRightHandle->bottomRight->setCoords(0.5, -0.5); // 矩形大小 - + else if(newRange.upper > getMyUpper()) { + return; } + // + setRange(newRange.lower, newRange.upper); - void TransparentDraggableGeoLith::onDelRect() { - //mDragMode = DragNone; - //删除框图 - deleteRect(); +// double low = mRect->topLeft->coords().x(); +// double hight = mRect->bottomRight->coords().x(); +// PropertyService()->initGeoLithItemProperty(this, low, hight, m_Lith, m_Oil, m_Color); + + //保存 + mPlot->SaveToSLF_GeoLith(); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); + + //取消所有选中单元格 + emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, ""); + } +} + +//设置顶深 +void TransparentDraggableGeoLith::setUpper(double upper) +{ + QCPRange currentRange = getRange(); + QCPRange newRange = currentRange; + + double proposedRight = upper; + // 确保不超出轴范围且不使宽度小于最小值 + newRange.upper = qBound( + currentRange.lower + mMinWidth, + proposedRight, + getMyUpper()); + + // 最终确保宽度不小于最小值(针对整体拖动的情况) + if(newRange.size() < mMinWidth) { + newRange.upper = newRange.lower + mMinWidth; } - void TransparentDraggableGeoLith::onMousePress(QMouseEvent *event) - { -// //右键 -// if(event->button() != Qt::LeftButton) -// { -// double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 -// QCPRange currentRange = getRange(); -// if(mLeftHandle->selectTest(event->pos(), false) < 5) { -// mDragMode = DragNone; -// } -// else if(mRightHandle->selectTest(event->pos(), false) < 5) { -// mDragMode = DragNone; -// } -// //else if(x >= currentRange.lower && x <= currentRange.upper) { -// else if(y >= currentRange.lower && y <= currentRange.upper) { -// mDragMode = DragNone; -// } -// else { -// mDragMode = DragNone; -// return; -// } -// //event->accept(); -// QMenu menu(nullptr); -// QAction *delAction = menu.addAction("删除框图"); -// //delAction->installEventFilter(this); -// connect(delAction, &QAction::triggered, this, &TransparentDraggableResult::onDelRect); -// QAction* pItem = menu.exec(event->globalPos()); -// if(pItem == delAction) -// { -// //event->accept(); -// int ii=0; -// ii++; -// } -// menu.exec(event->globalPos()); -// return; -// } + setRange(newRange.lower, newRange.upper); +} - event->accept(); - - // 检查点击了哪个部分 - //double x = mPlot->xAxis->pixelToCoord(event->pos().x()); - //double y = mPlot->yAxis->pixelToCoord(event->pos().y()); - +//设置底深 +void TransparentDraggableGeoLith::setLower(double lower) +{ + QCPRange currentRange = getRange(); + QCPRange newRange = currentRange; + + double proposedLeft = lower; + // 确保不超出轴范围且不使宽度小于最小值 + newRange.lower = qBound( + getMyLower(), + proposedLeft, + currentRange.upper - mMinWidth); + + // 最终确保宽度不小于最小值(针对整体拖动的情况) + if(newRange.size() < mMinWidth) { + // 如果是边界拖动,强制设置最小宽度 + newRange.lower = newRange.upper - mMinWidth; + } + + setRange(newRange.lower, newRange.upper); +} + +void TransparentDraggableGeoLith::onMousePress(QMouseEvent *event) +{ + if(event->button() != Qt::LeftButton)//右键 + { double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 - QCPRange currentRange = getRange(); - if(mLeftHandle->selectTest(event->pos(), false) < 5) { - mDragMode = DragLeft; + mDragMode = DragNone; } else if(mRightHandle->selectTest(event->pos(), false) < 5) { - mDragMode = DragRight; + mDragMode = DragNone; } //else if(x >= currentRange.lower && x <= currentRange.upper) { else if(y >= currentRange.lower && y <= currentRange.upper) { - mDragMode = DragRect; + mDragMode = DragNone; } else { mDragMode = DragNone; return; } - - //mDragStartX = x; - mDragStartY = y; - mDragStartRange = currentRange; + //event->accept(); + + double low = mRect->topLeft->coords().x(); + double hight = mRect->bottomRight->coords().x(); + PropertyService()->initGeoLithItemProperty(this, low, hight, m_Lith, m_Oil, m_Color); + + QMenu menu(nullptr); + menu.addAction(QIcon(::GetImagePath() + "icon/Split.png"), "分割", this, &TransparentDraggableGeoLith::onSplitRect); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &TransparentDraggableGeoLith::onDelRect); + menu.addAction(QIcon(::GetImagePath() + "icon/Shift.png"), "设置深度移动量", this, &TransparentDraggableGeoLith::setItemDepthOffset); + menu.exec(event->globalPos()); + + return; } - - void TransparentDraggableGeoLith::onMouseMove(QMouseEvent *event) - { - if(mDragMode == DragNone) return; - event->accept(); + event->accept(); - //double x = mPlot->xAxis->pixelToCoord(event->pos().x()); - //double dx = x - mDragStartX; + // 检查点击了哪个部分 + //double x = mPlot->xAxis->pixelToCoord(event->pos().x()); + //double y = mPlot->yAxis->pixelToCoord(event->pos().y()); - double y = mPlot->xAxis->pixelToCoord(event->pos().y()); - double dy = y - mDragStartY; - - QCPRange newRange = mDragStartRange; - - switch(mDragMode) { - case DragLeft: { - //double proposedLeft = mDragStartRange.lower + dx; - double proposedLeft = mDragStartRange.lower + dy; - // 确保不超出轴范围且不使宽度小于最小值 - newRange.lower = qBound( - //mPlot->xAxis->range().lower, - getMyLower(), - proposedLeft, - mDragStartRange.upper - mMinWidth); - break; + double y = mPlot->xAxis->pixelToCoord(event->pos().y());//x轴展示深度 + + QCPRange currentRange = getRange(); + + if(mLeftHandle->selectTest(event->pos(), false) < 5) { + mDragMode = DragLeft; + } + else if(mRightHandle->selectTest(event->pos(), false) < 5) { + mDragMode = DragRight; + } + //else if(x >= currentRange.lower && x <= currentRange.upper) { + else if(y >= currentRange.lower && y <= currentRange.upper) { + mDragMode = DragRect; + } + else { + mDragMode = DragNone; + return; + } + + //mDragStartX = x; + mDragStartY = y; + mDragStartRange = currentRange; + +} + +void TransparentDraggableGeoLith::onMouseMove(QMouseEvent *event) +{ + if(mDragMode == DragNone) return; + + event->accept(); + + //double x = mPlot->xAxis->pixelToCoord(event->pos().x()); + //double dx = x - mDragStartX; + + double y = mPlot->xAxis->pixelToCoord(event->pos().y()); + double dy = y - mDragStartY; + + QCPRange newRange = mDragStartRange; + + switch(mDragMode) { + case DragLeft: { + //double proposedLeft = mDragStartRange.lower + dx; + double proposedLeft = mDragStartRange.lower + dy; + // 确保不超出轴范围且不使宽度小于最小值 + newRange.lower = qBound( + //mPlot->xAxis->range().lower, + getMyLower(), + proposedLeft, + mDragStartRange.upper - mMinWidth); + break; + } + case DragRight: { + //double proposedRight = mDragStartRange.upper + dx; + double proposedRight = mDragStartRange.upper + dy; + // 确保不超出轴范围且不使宽度小于最小值 + newRange.upper = qBound( + mDragStartRange.lower + mMinWidth, + proposedRight, + getMyUpper()); + //mPlot->xAxis->range().upper); + break; + } + case DragRect: { + double width = mDragStartRange.size(); + //double center = mDragStartRange.center() + dx; + double center = mDragStartRange.center() + dy; + newRange.lower = center - width/2; + newRange.upper = center + width/2; + + // 检查是否超出轴范围 + if(newRange.lower < getMyLower()) { + newRange.lower = getMyLower(); + newRange.upper = newRange.lower + width; } - case DragRight: { - //double proposedRight = mDragStartRange.upper + dx; - double proposedRight = mDragStartRange.upper + dy; - // 确保不超出轴范围且不使宽度小于最小值 - newRange.upper = qBound( - mDragStartRange.lower + mMinWidth, - proposedRight, - getMyUpper()); - //mPlot->xAxis->range().upper); - break; + else if(newRange.upper > getMyUpper()) { + newRange.upper = getMyUpper(); + newRange.lower = newRange.upper - width; } - case DragRect: { - double width = mDragStartRange.size(); - //double center = mDragStartRange.center() + dx; - double center = mDragStartRange.center() + dy; - newRange.lower = center - width/2; - newRange.upper = center + width/2; - - // 检查是否超出轴范围 - if(newRange.lower < getMyLower()) { - newRange.lower = getMyLower(); - newRange.upper = newRange.lower + width; - } - else if(newRange.upper > getMyUpper()) { - newRange.upper = getMyUpper(); - newRange.lower = newRange.upper - width; - } // QCPRange axisRange = mPlot->xAxis->range(); // if(newRange.lower < axisRange.lower) { @@ -651,12 +716,12 @@ TransparentDraggableGeoLith::TransparentDraggableGeoLith(QMyCustomPlot *parentPl // newRange.upper = axisRange.upper; // newRange.lower = newRange.upper - width; // } - break; - } - default: - break; - } - + break; + } + default: + break; + } + // //取整数(方便显示统计,左右边界整数显示。) // newRange.lower = (int)newRange.lower; // QCPRange rangeByFile = mPlot->xAxis->range(); @@ -664,103 +729,116 @@ TransparentDraggableGeoLith::TransparentDraggableGeoLith(QMyCustomPlot *parentPl // { // newRange.upper = (int)newRange.upper; // } - - // 最终确保宽度不小于最小值(针对整体拖动的情况) - if(newRange.size() < mMinWidth) { - if(mDragMode == DragRect) { - // 如果是整体拖动,保持中心点不变 - double center = newRange.center(); - newRange.lower = center - mMinWidth/2; - newRange.upper = center + mMinWidth/2; - } else { - // 如果是边界拖动,强制设置最小宽度 - if(mDragMode == DragLeft) { - newRange.lower = newRange.upper - mMinWidth; - } else if(mDragMode == DragRight) { - newRange.upper = newRange.lower + mMinWidth; - } + + // 最终确保宽度不小于最小值(针对整体拖动的情况) + if(newRange.size() < mMinWidth) { + if(mDragMode == DragRect) { + // 如果是整体拖动,保持中心点不变 + double center = newRange.center(); + newRange.lower = center - mMinWidth/2; + newRange.upper = center + mMinWidth/2; + } else { + // 如果是边界拖动,强制设置最小宽度 + if(mDragMode == DragLeft) { + newRange.lower = newRange.upper - mMinWidth; + } else if(mDragMode == DragRight) { + newRange.upper = newRange.lower + mMinWidth; } } - - setRange(newRange.lower, newRange.upper); - } - - void TransparentDraggableGeoLith::onMouseRelease(QMouseEvent *event) - { - if(event->button() == Qt::LeftButton && mDragMode != DragNone) { - event->accept(); - //避免二次绘制框图 - mPlot->m_bDrawRect = false; - //emit rangeChanged(getRange()); - mDragMode = DragNone; - //取消选中状态 + + setRange(newRange.lower, newRange.upper); + +} + +void TransparentDraggableGeoLith::onMouseRelease(QMouseEvent *event) +{ + if(event->button() == Qt::LeftButton && mDragMode != DragNone) { + event->accept(); + //属性 + //if(mDragMode == DragRect) + { + double low = mRect->topLeft->coords().x(); + double hight = mRect->bottomRight->coords().x(); + PropertyService()->initGeoLithItemProperty(this, low, hight, m_Lith, m_Oil, m_Color); + //保存 + mPlot->SaveToSLF_GeoLith(); + + //取消所有选中单元格 + emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, ""); + } + + //避免二次绘制框图 + mPlot->m_bDrawRect = false; + //emit rangeChanged(getRange()); + mDragMode = DragNone; + //取消选中状态 // QCPDataSelection emptySelection; // mPlot->graph(0)->setSelection(emptySelection); // mPlot->replot(); - //取消选中框 - mPlot->selectionRect()->cancel(); - mPlot->replot(); - mPlot->selectionRect()->mActive=true; - } + //取消选中框 + mPlot->selectionRect()->cancel(); + mPlot->replot(); + mPlot->selectionRect()->mActive=true; } - - double TransparentDraggableGeoLith::getMyLower() +} + +double TransparentDraggableGeoLith::getMyLower() +{ + double dLower = mPlot->xAxis->range().lower; + double proposedLeft = mDragStartRange.lower; + + TransparentDraggableGeoLith *pDraggableRect =NULL; { - double dLower = mPlot->xAxis->range().lower; - double proposedLeft = mDragStartRange.lower; - - TransparentDraggableGeoLith *pDraggableRect =NULL; + QMap::Iterator it = mPlot->m_mapDraggable_GeoLith.begin(); + while( it != mPlot->m_mapDraggable_GeoLith.end() ) { - QMap::Iterator it = mPlot->m_mapDraggable_GeoLith.begin(); - while( it != mPlot->m_mapDraggable_GeoLith.end() ) + if(it.key() == m_strUuid) { - if(it.key() == m_strUuid) - { - it++; - continue; - } - pDraggableRect = (TransparentDraggableGeoLith*)it.value(); - // - QCPRange tmpRange = pDraggableRect->getRange(); - if(tmpRange.upper >= dLower && tmpRange.upper <= proposedLeft) - { - dLower = tmpRange.upper; - } it++; + continue; } + pDraggableRect = (TransparentDraggableGeoLith*)it.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + if(tmpRange.upper >= dLower && tmpRange.upper <= proposedLeft) + { + dLower = tmpRange.upper; + } + it++; } - - return dLower; } - double TransparentDraggableGeoLith::getMyUpper() + return dLower; +} + +double TransparentDraggableGeoLith::getMyUpper() +{ + double dUpper = mPlot->xAxis->range().upper; + double proposedRight = mDragStartRange.upper; + + TransparentDraggableGeoLith *pDraggableRect =NULL; { - double dUpper = mPlot->xAxis->range().upper; - double proposedRight = mDragStartRange.upper; - - TransparentDraggableGeoLith *pDraggableRect =NULL; + QMap::Iterator it = mPlot->m_mapDraggable_GeoLith.begin(); + while( it != mPlot->m_mapDraggable_GeoLith.end() ) { - QMap::Iterator it = mPlot->m_mapDraggable_GeoLith.begin(); - while( it != mPlot->m_mapDraggable_GeoLith.end() ) + if(it.key() == m_strUuid) { - if(it.key() == m_strUuid) - { - it++; - continue; - } - pDraggableRect = (TransparentDraggableGeoLith*)it.value(); - // - QCPRange tmpRange = pDraggableRect->getRange(); - if(tmpRange.lower <= dUpper && tmpRange.lower >= proposedRight) - { - dUpper = tmpRange.lower; - } it++; + continue; } + pDraggableRect = (TransparentDraggableGeoLith*)it.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + if(tmpRange.lower <= dUpper && tmpRange.lower >= proposedRight) + { + dUpper = tmpRange.lower; + } + it++; } - - return dUpper; } + return dUpper; +} + diff --git a/logPlus/TransparentDraggableGeoLith.h b/logPlus/TransparentDraggableGeoLith.h index 2e5ce28..339ccbe 100644 --- a/logPlus/TransparentDraggableGeoLith.h +++ b/logPlus/TransparentDraggableGeoLith.h @@ -34,14 +34,14 @@ public: void setLith(QString filePath, QString colorPath); void drawLith(double left_Low, double right_Hight, double lY1, double lY2); - void setColor(QString filePath); +// void setColor(QString filePath); //设置m_Oil void setOil(QString filePath); void drawOil(double left_Low, double right_Hight, double lY1, double lY2); // 设置矩形范围 - void setRange(double left_Low, double right_Hight); + void setRange(double left_Low, double right_Hight, bool bRefresh=true); // 获取当前范围 QCPRange getRange(); @@ -51,6 +51,11 @@ public: // 删除框图 void deleteRect(); + //设置顶深 + void setUpper(double upper); + //设置底深 + void setLower(double lower); + signals: void rangeChanged(QCPRange newRange); @@ -59,14 +64,16 @@ private: void updateHandles() ; private slots: - void onDelRect(); + void onSplitRect(); //分割 + void onDelRect(); //删除 + void setItemDepthOffset(); //设置深度移动量 void onMousePress(QMouseEvent *event); void onMouseMove(QMouseEvent *event); void onMouseRelease(QMouseEvent *event); double getMyLower(); double getMyUpper(); -private: +public: QMyCustomPlot *mPlot; QCPItemRect *mRect; QCPItemRect *mLeftHandle; @@ -83,6 +90,8 @@ private: QString m_Oil; QString m_Color; + //double m_dOilZhan=8; //含油占比 + GeoIndicatorGenerator m_drawGeo; enum DragMode { DragNone, DragLeft, DragRight, DragRect }; diff --git a/logPlus/TransparentDraggableGujing.cpp b/logPlus/TransparentDraggableGujing.cpp index 26c9578..3d80f57 100644 --- a/logPlus/TransparentDraggableGujing.cpp +++ b/logPlus/TransparentDraggableGujing.cpp @@ -316,12 +316,16 @@ void TransparentDraggableGujing::onSplitRect() //添加下半部分 mPlot->addGujingToPlot(currentRange.lower, (currentRange.lower+currentRange.upper)/2.0, m_Result); - double low = mRect->topLeft->coords().x(); - double hight = mRect->bottomRight->coords().x(); - PropertyService()->initGujingItemProperty(this, low, hight, m_Result); +// double low = mRect->topLeft->coords().x(); +// double hight = mRect->bottomRight->coords().x(); +// PropertyService()->initGujingItemProperty(this, low, hight, m_Result); + //保存 mPlot->SaveToSLF_Gujing(); + //属性清空 + PropertyService()->InitCurrentViewInfo(); + //取消所有选中单元格 emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, ""); } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 1b51467..d1f9ea6 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -295,14 +295,10 @@ void FormDraw::DisplayLines(QJsonArray linesArray) //qDebug() << "LineName:" << strLineName; } } - if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT") + if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT" + || strLineName == "GEO_LITH" || strLineName == "SWALL_CORE") { - //固井结论 - DisplayTable_One(lineObjInfo); - } - else if (strLineName == "SWALL_CORE") - { - //井壁取心 + //固井结论/井壁取心/录井剖面 DisplayTable_One(lineObjInfo); } } @@ -393,6 +389,12 @@ void FormDraw::DisplayTable_One(QJsonObject lineObjInfo) listOtherProperty.append(strAliasName);//别名 listOtherProperty.append(lineColor.name());//名称颜色 listOtherProperty.append(curveNameFont.toString());//名称字体 + // + if (lineObjInfo.contains("OilZhan"))//含油占比 + { + listOtherProperty.append(QString::number(lineObjInfo.value("OilZhan").toInt())); + } + //结论 this->addTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, listOtherProperty); } @@ -820,7 +822,17 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri else if (strLineName == "GEO_LITH") { //录井剖面 - initGeoLith(curv, strSlfName, strLineName); + if(listOtherProperty.size()>=3) + { + QString strAliasName = listOtherProperty[0]; + QColor newlineColor=QColor(0,0,0); + newlineColor.setNamedColor(listOtherProperty[1]); + initGeoLith(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty); + } + else + { + initGeoLith(curv, strSlfName, strLineName); + } } else if (strLineName == "SWALL_CORE") { @@ -3960,9 +3972,8 @@ bool FormDraw::LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QSt } //录井剖面 -void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName) +void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty) { - int iMyWidth = widget->axisRect(0)->width(); float vmax = iMyWidth; float vmin = 0; @@ -3992,125 +4003,28 @@ void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString st widget->yAxis->setTicks(false); widget->xAxis2->setTicks(false); widget->yAxis2->setTicks(false); - // - LoadFromSLF_GeoLith(widget, strSlfName, strLineName); - QString strAliasName = ""; + //含油占比 + if(listOtherProperty.size()>=4) + { + widget->m_dOilZhan = listOtherProperty[3].toDouble(); + } + //加载 + widget->LoadFromSLF_GeoLith(strSlfName, strLineName); + + if(listOtherProperty.size()>=3) + { + strAliasName = listOtherProperty[0]; + newlineColor.setNamedColor(listOtherProperty[1]); + } 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, "tableObject"); + m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty); } -bool FormDraw::LoadFromSLF_GeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName) -{ - CMemRdWt *logio=new CMemRdWt(); - if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) - { - delete logio; - return false; - } - int iIndex=logio->OpenTable(strLineName.toStdString().c_str()); - if(iIndex>-1) { - int len=logio->GetTableRecordLength(iIndex); - int sl=sizeof(GeoLith_DATA); - if(sl>len) len=sl; - GeoLith_DATA *m_Result; - m_Result=(GeoLith_DATA *)new char[len+1]; - int count=logio->GetTableRecordCount(iIndex); - for(int i=0;iReadTable(iIndex,i+1,m_Result); - // - QMap OilOrder; - QMap LithOrder; - QMap ColorOrder; - QMap ColorInds; - // - LithOrder=GetZoneOrder(QString("GeoLith")); - OilOrder=GetZoneOrder(QString("CoreOil")); - ColorOrder=GetZoneOrder(QString("CoreColor")); - ColorInds=GetZoneOrder(QString("ColorInd")); - - QString iconshotname=""; - QString IntLith = QString::number(m_Result->Lith); - if(IntLith=="0") { - iconshotname=""; - } - else - { - iconshotname=LithOrder.key(IntLith); - } - - // - QString Lith = ""; - if(iconshotname!="") - Lith=::GetMudSymbolDir()+""+iconshotname+".svg"; - int len=2; - int pos=Lith.indexOf(".//"); - if(pos<0) pos=Lith.indexOf("./"); - else len=3; - QString svg; - if(pos==0) - { - svg=QCoreApplication::applicationDirPath()+ QDir::separator(); - svg+=Lith.mid(len-1); - } - else svg=Lith; - QDir ss; - if(!ss.exists(svg)) - { - QString path=svg.left(svg.lastIndexOf('.')+1); - svg=path+"png"; - } - Lith=svg; - - // - QString Oil = ""; - iconshotname=OilOrder.key(QString::number(m_Result->Oil)); - if(iconshotname!="") - Oil=::GetGasSymbolDir()+""+iconshotname+".svg"; - len=2; - pos=Oil.indexOf(".//"); - if(pos<0) pos=Oil.indexOf("./"); - else len=3; - if(pos==0) - { - svg=QCoreApplication::applicationDirPath()+ QDir::separator(); - svg+=Oil.mid(len-1); - } - else svg=Oil; - if(!ss.exists(svg)) - { - QString path=svg.left(svg.lastIndexOf('.')+1); - svg=path+"png"; - } - Oil=svg; - - // - QString Color = ""; - int ind=ColorInds.value(QString::number(m_Result->Color)).toInt(); - if (ind>-1&&indaddGeoLithToPlot(-m_Result->EDEP, -m_Result->SDEP, Lith, Oil, Color); - } - logio->CloseTable(iIndex); - delete m_Result; - } - delete logio; - return true; -} - //井壁取心 void FormDraw::initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty) { diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index ef5ce32..dfa7133 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -181,8 +181,7 @@ public: bool LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QString strLineName); //录井剖面 - void initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName); - bool LoadFromSLF_GeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName); + void initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "录井剖面", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={}); //井壁取心 void initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "井壁取心", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={}); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index cbe583c..0b3e6ef 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -150,6 +150,17 @@ QJsonObject FormInfo::makeJson() //item属性写入slf文件,不需要此次记录 return rootObj; } + else if (m_strLineName == "GEO_LITH") + { + //录井剖面 + rootObj["Type"] = m_strType; + rootObj["curveNameFont"] = m_curveNameFont.toString(); + rootObj["lineColor"] = m_lineColor.name(); + + rootObj["OilZhan"] = m_dOilZhan;//含油占比 + //item属性写入slf文件,不需要此次记录 + return rootObj; + } } rootObj["Unit"] = m_strUnit; @@ -420,7 +431,7 @@ void FormInfo::paintEvent(QPaintEvent* event) else if(m_strLineName=="GEO_LITH") { //录井剖面,不绘制左右范围 - painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "录井剖面"); + //painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "录井剖面"); } else if(m_strLineName=="SWALL_CORE") { diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index f279788..3a0c030 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -142,6 +142,8 @@ public: QFont m_layerFont; // 层号字体 float m_fLayerRotate = 0.0f; // 层号旋转 + //录井剖面 + double m_dOilZhan=8; //含油占比 public: void setLineWidth(double dWidth); diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 7a65b5b..6b54bc5 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -534,15 +534,24 @@ void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString formInfo->setFrontColor(QColor(0,0,0)); formInfo->setBackColor(QColor(255,255,255)); if(strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT" - || strLineName == "SWALL_CORE") + || strLineName == "GEO_LITH" || strLineName == "SWALL_CORE") { - //固井结论/ 井壁取心 + //固井结论 / 井壁取心 / 录井剖面 if(listOtherProperty.size()>=3) { QFont curveNameFont("微软雅黑", 10); // 名称字体 curveNameFont.fromString(listOtherProperty[2]); formInfo->m_curveNameFont = curveNameFont; } + + //录井剖面 + if(strLineName == "GEO_LITH") + { + if(listOtherProperty.size()>=4) + { + formInfo->m_dOilZhan = listOtherProperty[3].toDouble(); + } + } } //设置高度 ui->tableWidget->setRowHeight(row, 100); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 79567fb..6358877 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -123,6 +123,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList))); //改变固井曲线名 connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString))); + //改变录井剖面属性 + connect(CallManage::getInstance(), SIGNAL(sig_changeGeoLithLine(QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGeoLithLine(QString, QString, QString, QString, QString, double))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW) @@ -956,8 +958,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "development.png"), "合并结论", this, &QMyCustomPlot::MegResult_Gujing); menu.exec(event->globalPos()); } - - if (m_strLineName == "SWALL_CORE") + else if (m_strLineName == "SWALL_CORE") { QMenu menu(this); //井壁取心 @@ -969,6 +970,17 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_SWallCore); menu.exec(event->globalPos()); } + else if (m_strLineName == "GEO_LITH") + { + QMenu menu(this); + //录井剖面 + 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); + menu.exec(event->globalPos()); + } // QAction *resetAction = menu.addAction("添加框图"); // connect(resetAction, &QAction::triggered, this, &QMyCustomPlot::onAddRect); @@ -1174,6 +1186,167 @@ void QMyCustomPlot::onEditGujing() } } +//右键--添加录井剖面 +void QMyCustomPlot::onEditGeoLith() +{ + this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式 + this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选 + + if(m_bFirstTimeConnect) + { + //信号槽只绑定一次,避免重复绑定 + m_bFirstTimeConnect = false; + + for (int i=0; i < this->graphCount(); ++i) { + QCPGraph *graph = this->graph(i); + graph->setSelectable(QCP::stDataRange); + break; + } + + connect(this->selectionRect(), &QCPSelectionRect::accepted, [this](){ + if(this->m_bDrawRect == false) + { + this->m_bDrawRect = true; + return; + } + // 当选择完成时,获取矩形范围并放大 + QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标) + m_bEditRect=true;//当前是否正在编辑曲线。 + + // 转换为坐标轴范围 + double top = rect.top(); + double bottom = rect.bottom(); + + double right_Hight = this->xAxis->pixelToCoord(top); + double left_Low = this->xAxis->pixelToCoord(bottom); + + //追加判断,避免框选重叠 + TransparentDraggableGeoLith *pDraggableRect =NULL; + { + QMap::Iterator it = m_mapDraggable_GeoLith.begin(); + while( it != m_mapDraggable_GeoLith.end() ) + { + pDraggableRect = (TransparentDraggableGeoLith*)it.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + if(tmpRange.lower >= left_Low && tmpRange.upper <= right_Hight) + { + return; + } + + if(tmpRange.upper >= left_Low && tmpRange.upper <= right_Hight) + { + return; + } + + if(tmpRange.lower >= left_Low && tmpRange.lower <= right_Hight) + { + return; + } + + it++; + } + } + + { + // + QMap OilOrder; + QMap LithOrder; + QMap ColorOrder; + QMap ColorInds; + // + LithOrder=GetZoneOrder(QString("GeoLith")); + OilOrder=GetZoneOrder(QString("CoreOil")); + ColorOrder=GetZoneOrder(QString("CoreColor")); + ColorInds=GetZoneOrder(QString("ColorInd")); + + int iOil=1;//含油性 + int iLith=50;//岩性 + int iColor=0;//颜色 + + QString iconshotname=""; + QString IntLith = QString::number(iLith); + if(IntLith=="0") { + iconshotname=""; + } + else + { + iconshotname=LithOrder.key(IntLith); + } + + // + QString Lith = ""; + if(iconshotname!="") + Lith=::GetMudSymbolDir()+""+iconshotname+".svg"; + int len=2; + int pos=Lith.indexOf(".//"); + if(pos<0) pos=Lith.indexOf("./"); + else len=3; + QString svg; + if(pos==0) + { + svg=QCoreApplication::applicationDirPath()+ QDir::separator(); + svg+=Lith.mid(len-1); + } + else svg=Lith; + QDir ss; + if(!ss.exists(svg)) + { + QString path=svg.left(svg.lastIndexOf('.')+1); + svg=path+"png"; + } + Lith=svg; + + // + QString Oil = ""; + iconshotname=OilOrder.key(QString::number(iOil)); + if(iconshotname!="") + Oil=::GetGasSymbolDir()+""+iconshotname+".svg"; + len=2; + pos=Oil.indexOf(".//"); + if(pos<0) pos=Oil.indexOf("./"); + else len=3; + if(pos==0) + { + svg=QCoreApplication::applicationDirPath()+ QDir::separator(); + svg+=Oil.mid(len-1); + } + else svg=Oil; + if(!ss.exists(svg)) + { + QString path=svg.left(svg.lastIndexOf('.')+1); + svg=path+"png"; + } + Oil=svg; + + // + QString Color = ""; + int ind=ColorInds.value(QString::number(iColor)).toInt(); + if (ind>-1&&indaddGeoLithToPlot(left_Low, right_Hight, Lith, Oil, Color); + + //保存 + this->SaveToSLF_GeoLith(); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); + + //取消框选 + this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables); + this->setSelectionRectMode(QCP::srmNone); + } + }); + } +} + bool QMyCustomPlot::SaveToSLF_SwallCore() { static int isrun=false; @@ -1350,6 +1523,151 @@ bool QMyCustomPlot::SaveToSLF_SwallCore() return true; } +// +QString QMyCustomPlot::GetIntLith(QString Lith) +{ + if(Lith=="") return ""; + QFileInfo afile(Lith); + return LithOrder.value(afile.completeBaseName()); +} + +QString QMyCustomPlot::GetIntOil(QString Oil) +{ + if(Oil=="") return ""; + QFileInfo afile(Oil); + return OilOrder.value(afile.completeBaseName()); +} +QString QMyCustomPlot::GetIntColor(QString Color) +{ + if(Color=="") return ""; + QFileInfo afile(Color); + return ColorOrder.value(afile.completeBaseName()); +} + +//保存录井剖面 +bool QMyCustomPlot::SaveToSLF_GeoLith() +{ + static int isrun=false; + if(isrun) return false; + QString ss=m_strSlfName; + if(ss=="") return false; + isrun=true; + + GeoLith_DATA m_Result; + CMemRdWt *logio=new CMemRdWt(); + if(ss==""||!logio->Open(ss.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); + isrun=false; + return false; + } + bool isfirst=false; + int iIndex=logio->OpenTable(m_strLineName.toStdString().c_str()); + if (iIndex < 0) + { + if(!m_mapDraggable_GeoLith.size()) { + delete logio; + isrun=false; + return false; + } + iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,7, + "NO,SDEP,EDEP,OIL,LITH,COLOR,DEST", + "4,4,4,4,4,4,64",//字段长度 + "1,4,4,1,1,1,6",//字段类型 + "0,0,0,3,7,5,0");//字段备注 + isfirst=true; + } + logio->SetTableRecordCount(iIndex,m_mapDraggable_GeoLith.size()); + + if(!m_mapDraggable_GeoLith.size()) { + delete logio; + if(isfirst)AddTableToWellRound(); + isrun=false; + return false; + } + + //----- + LithOrder.clear(); + OilOrder.clear(); + ColorOrder.clear(); + ColorInds.clear(); + LithOrder=GetZoneOrder(QString("GeoLith")); + OilOrder=GetZoneOrder(QString("CoreOil")); + ColorOrder=GetZoneOrder(QString("CoreColor")); + ColorInds=GetZoneOrder(QString("ColorInd")); + + TransparentDraggableGeoLith *pDraggableRect =NULL; + + //排序 + QList listSDepth; + for (QMap::Iterator iter = m_mapDraggable_GeoLith.begin(); iter != m_mapDraggable_GeoLith.end(); iter++) + { + pDraggableRect = (TransparentDraggableGeoLith*)iter.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + // + float fSDepth = -tmpRange.upper; + listSDepth.append(fSDepth); + } + qSort(listSDepth); + + // + for(int i=0; i::Iterator iter = m_mapDraggable_GeoLith.begin(); iter != m_mapDraggable_GeoLith.end(); iter++) + { + pDraggableRect = (TransparentDraggableGeoLith*)iter.value(); + // + QCPRange tmpRange = pDraggableRect->getRange(); + float fSDepth = -tmpRange.upper; + if(fSDepth == listSDepth[i])//按顺序写入 + { + memset(&m_Result,0,sizeof(GeoLith_DATA)); + m_Result.SDEP = -tmpRange.upper; + m_Result.EDEP = -tmpRange.lower; + m_Result.NO=i+1; + m_Result.Lith=325; + QString innerresult=GetIntLith(pDraggableRect->m_Lith); + if(innerresult!="") + m_Result.Lith=innerresult.toInt(); + if(m_Result.Lith<1) m_Result.Lith=325; + m_Result.Oil=1; + innerresult=GetIntOil(pDraggableRect->m_Oil); + if(innerresult!="") + m_Result.Oil=innerresult.toInt(); + if(m_Result.Oil<1) m_Result.Oil=1; + + QString name,path; + GetWellNameAndPath(pDraggableRect->m_Color,name,path); + if(name!="空白"&&name!="空"&&name!="白色") strcpy(m_Result.Dest,name.toStdString().c_str()); + int ind=ColorOrder.value(name).toInt(); + if(ind<0||ind>=ColorInds.size()) m_Result.Color=0; + else m_Result.Color=ColorInds.key(QString::number(ind)).toInt(); + name=""; + GetWellNameAndPath(pDraggableRect->m_Oil,name,path); + if(name!="空白"&&name!="空") strcat(m_Result.Dest,name.toStdString().c_str()); + name=""; + GetWellNameAndPath(pDraggableRect->m_Lith,name,path); + if(name!="空白"&&name!="空") strcat(m_Result.Dest,name.toStdString().c_str()); + name=m_Result.Dest; + name.remove("空白"); + //此处统一转换 + int n=strlen(name.toStdString().c_str()); + if(n>sizeof(m_Result.Dest)) n=sizeof(m_Result.Dest); + strncpy(m_Result.Dest,name.toLocal8Bit().data(),n); + // + logio->WriteTable(iIndex,i+1,&m_Result); + } + } + } + logio->CloseTable(iIndex); + delete logio; + if(isfirst)AddTableToWellRound(); + isrun=false; + return true; +} + //保存固井结论道 bool QMyCustomPlot::SaveToSLF_Gujing() { @@ -1712,6 +2030,342 @@ void QMyCustomPlot::DeleteItems_SWallCore() PropertyService()->InitCurrentViewInfo(); } +//全部清空 +void QMyCustomPlot::DeleteItems_GeoLith() +{ + if(QMessageBox::information(NULL,QObject::tr("提示"),QObject::tr("该功能将清除当前组件展示的全部信息,清除后无法恢复,但会备份到对应的\"_BAK\"中,确定清除吗?"),QMessageBox::Yes|QMessageBox::No)!=QMessageBox::Yes) return; + QString obj=m_strLineName + "BAK"; + CopyToSLFFile(m_strSlfName, false, (char *)obj.toStdString().c_str()); + AddTableToWellRound(); + + //删除对象 + TransparentDraggableGeoLith *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_GeoLith.begin(); + while( it != m_mapDraggable_GeoLith.end() ) + { + pDraggableRect = (TransparentDraggableGeoLith*)it.value(); + it++; + pDraggableRect->deleteRect(); + } + + //保存 + this->SaveToSLF_GeoLith(); + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + +//从剪切板文本数据粘贴 +void QMyCustomPlot::addItems_GeoLith() +{ + QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 + QString originalText = clipboard->text(); //获取剪贴板上文本信息 + int isspace=originalText.indexOf(" "); + int istab=originalText.indexOf("\t"); + int isd=originalText.indexOf(","); + + if((istab>-1|isd>-1)&&isspace>-1) + { + QMessageBox::information(NULL,"提示", "\",\"或制表符与空格键并存,自动分解可能有误!\n建议用单一符号风格!"); + } + originalText.replace("\t"," "); + originalText.replace(","," "); + originalText.replace("\r\n","\n"); + originalText.replace("\r","\n"); + QStringList line=originalText.split("\n"); + line.removeAll(""); + for(int i=0;i=0) coredat.removeAll(""); + if(coredat.size()<1) continue; + if(!coredat[0].isEmpty()&&!coredat[0].at(0).isDigit()) continue; + + //录井剖面 + AddItem_GeoLith(coredat); + } + + //保存 + this->SaveToSLF_GeoLith(); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + +void QMyCustomPlot::AddItem_GeoLith(QStringList lists) +{ + //初始化LithOrder + if(LithOrder.size()<=0) + { + LithOrder=GetZoneOrder(QString("GeoLith")); + } + if(OilOrder.size()<=0) + { + OilOrder=GetZoneOrder(QString("CoreOil")); + } + if(ColorOrder.size()<=0) + { + ColorOrder=GetZoneOrder(QString("CoreColor")); + } + if(ColorInds.size()<=0) + { + ColorInds=GetZoneOrder(QString("ColorInd")); + } + if(LithWidth.size()<=0) + { + QString configfile=::GetConfPath()+GetOilFieldName()+"LithWidth"; + QDir ss1; + if(!ss1.exists(configfile+".txt")) configfile+=".ini"; + else configfile+=".txt"; + QStringList lines; + QFile file( configfile ); + if ( file.open( QIODevice::ReadOnly ) ) { + QTextStream stream( &file ); + QString line; + while ( !stream.atEnd() ) { + line = stream.readLine(); // 不包括“\n”的一行文本 + lines += line; + } + file.close(); + } + LithWidth=lines; + } + if(lists.size()<3) return; + if(lists.size()<4) lists.insert(0,"0"); + GeoLith_DATA m_Result; + memset(&m_Result,0,sizeof(GeoLith_DATA)); + double top=-9999.0; + double bottom=-9999.0; + m_Result.NO=lists[0].toInt(); + top=(int)(lists[1].toDouble()*1000+0.5)/1000.0; + bottom=(int)(lists[2].toDouble()*1000+0.5)/1000.0; + m_Result.SDEP=top; + m_Result.EDEP=bottom; + m_Result.Oil=-1; + m_Result.Lith=325; + if(lists.size()>2) { + if(!lists[3].isEmpty()) { + if(lists[3].at(0).isDigit()||lists[3].at(0)=='.') { + m_Result.Oil=lists[3].toDouble(); + if(lists.size()>4) m_Result.Lith=lists[4].toDouble(); + } + else { + for(int j=0;j<3;j++) { + QMap ss; + if(j==0) ss=LithOrder; + else if(j==1)ss=OilOrder; + else ss=ColorOrder; + int len=0; + int len1=0; + int iid=-1; + QString key,value; + for(int i=0;i-1) { + len1=strlen(key.toStdString().c_str()); + if(len=0&&iid-1&&indaddGeoLithToPlot(-m_Result.EDEP, -m_Result.SDEP, Lith, Oil, Color); +} + +bool QMyCustomPlot::LoadFromSLF_GeoLith(QString strSlfName, QString strLineName) +{ + // + LithOrder.clear(); + OilOrder.clear(); + ColorOrder.clear(); + ColorInds.clear(); + LithOrder=GetZoneOrder(QString("GeoLith")); + OilOrder=GetZoneOrder(QString("CoreOil")); + ColorOrder=GetZoneOrder(QString("CoreColor")); + ColorInds=GetZoneOrder(QString("ColorInd")); + + CMemRdWt *logio=new CMemRdWt(); + if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) + { + delete logio; + return false; + } + int iIndex=logio->OpenTable(strLineName.toStdString().c_str()); + if(iIndex>-1) { + int len=logio->GetTableRecordLength(iIndex); + int sl=sizeof(GeoLith_DATA); + if(sl>len) len=sl; + GeoLith_DATA *m_Result; + m_Result=(GeoLith_DATA *)new char[len+1]; + int count=logio->GetTableRecordCount(iIndex); + for(int i=0;iReadTable(iIndex,i+1,m_Result); + + QString iconshotname=""; + QString IntLith = QString::number(m_Result->Lith); + if(IntLith=="0") { + iconshotname=""; + } + else + { + iconshotname=LithOrder.key(IntLith); + } + + // + QString Lith = ""; + if(iconshotname!="") + Lith=::GetMudSymbolDir()+""+iconshotname+".svg"; + int len=2; + int pos=Lith.indexOf(".//"); + if(pos<0) pos=Lith.indexOf("./"); + else len=3; + QString svg; + if(pos==0) + { + svg=QCoreApplication::applicationDirPath()+ QDir::separator(); + svg+=Lith.mid(len-1); + } + else svg=Lith; + QDir ss; + if(!ss.exists(svg)) + { + QString path=svg.left(svg.lastIndexOf('.')+1); + svg=path+"png"; + } + Lith=svg; + + // + QString Oil = ""; + iconshotname=OilOrder.key(QString::number(m_Result->Oil)); + if(iconshotname!="") + Oil=::GetGasSymbolDir()+""+iconshotname+".svg"; + len=2; + pos=Oil.indexOf(".//"); + if(pos<0) pos=Oil.indexOf("./"); + else len=3; + if(pos==0) + { + svg=QCoreApplication::applicationDirPath()+ QDir::separator(); + svg+=Oil.mid(len-1); + } + else svg=Oil; + if(!ss.exists(svg)) + { + QString path=svg.left(svg.lastIndexOf('.')+1); + svg=path+"png"; + } + Oil=svg; + + // + QString Color = ""; + int ind=ColorInds.value(QString::number(m_Result->Color)).toInt(); + if (ind>-1&&indaddGeoLithToPlot(-m_Result->EDEP, -m_Result->SDEP, Lith, Oil, Color, bRefresh); + } + //最后统一刷新 + //widget->replot(); + + logio->CloseTable(iIndex); + delete m_Result; + } + delete logio; + return true; +} + //刷新数据 void QMyCustomPlot::RefreshItems_SWallCore() { @@ -1731,6 +2385,25 @@ void QMyCustomPlot::RefreshItems_SWallCore() PropertyService()->InitCurrentViewInfo(); } +//刷新数据 +void QMyCustomPlot::RefreshItems_GeoLith() +{ + //删除对象 + TransparentDraggableGeoLith *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_GeoLith.begin(); + while( it != m_mapDraggable_GeoLith.end() ) + { + pDraggableRect = (TransparentDraggableGeoLith*)it.value(); + it++; + pDraggableRect->deleteRect(); + } + + //重新加载 + LoadFromSLF_GeoLith(m_strSlfName, m_strLineName); + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineName) { WALLCORE_DATA m_Result; @@ -2859,7 +3532,7 @@ void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QSt //this->replot(); } -void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor) +void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor, bool bRefresh) { QtCommonClass *qtCommon = new QtCommonClass(this); QString strUuid = qtCommon->getUUid(); @@ -2871,7 +3544,7 @@ void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const dragRect->setLith(myLith, myColor); // 设置初始范围 - dragRect->setRange(left_Low, right_Hight); + dragRect->setRange(left_Low, right_Hight, bRefresh); // 可选:设置颜色 dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色255, 100, 100, 80 //最小宽度 @@ -4234,3 +4907,36 @@ void QMyCustomPlot::s_changeGujingLine(QString strUuid, QString strSlfName, QStr //刷新数据 RefreshItems_Gujing(); } + +//改变录井剖面属性 +void QMyCustomPlot::s_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan) +{ + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + + m_dOilZhan = dOilZhan; + //删除对象 + TransparentDraggableGeoLith *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_GeoLith.begin(); + while( it != m_mapDraggable_GeoLith.end() ) + { + pDraggableRect = (TransparentDraggableGeoLith*)it.value(); + it++; + pDraggableRect->deleteRect(); + } + + //重新加载 + LoadFromSLF_GeoLith(m_strSlfName, m_strLineName); + + //不清空属性窗口 +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 58e844b..3bf3bef 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -169,10 +169,23 @@ public: QStringList oils_SWallCore; QStringList colors_SWallCore; QStringList colorinds_SWallCore; - // bool SaveToSLF_SwallCore(); bool LoadFromSLF_SwallCore(QString strSlfName, QString strLineName); + //录井剖面 + QMap OilOrder; + QMap LithOrder; + QMap ColorOrder; + QMap ColorInds; + QStringList LithWidth; + QString GetIntLith(QString Lith); + QString GetIntOil(QString Oil); + QString GetIntColor(QString Color); + bool SaveToSLF_GeoLith(); + bool LoadFromSLF_GeoLith(QString strSlfName, QString strLineName); + //录井剖面 + double m_dOilZhan=8; //含油占比 + public slots: void slot_time(); @@ -188,7 +201,7 @@ public: void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText=""); - void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor); + void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor, bool bRefresh=true); void addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor); @@ -270,10 +283,12 @@ public slots: //右键--编辑曲线 void onEditLine(); + //通用 + void ClearSelectItems(); //取消选中 + //右键--编辑固井 void onEditGujing(); void addItems_Gujing(); //从剪切板文本数据粘贴 - void ClearSelectItems(); //取消选中 void DeleteItems_Gujing(); //全部清空 void RefreshItems_Gujing(); //刷新数据 void MegResult_Gujing(); //合并结论 @@ -286,6 +301,13 @@ public slots: void RefreshItems_SWallCore(); //刷新数据 void AddItem_SWallCore(QStringList lists); + //右键--编辑录井剖面 + void onEditGeoLith(); + void addItems_GeoLith(); //从剪切板文本数据粘贴 + void DeleteItems_GeoLith(); //全部清空 + void RefreshItems_GeoLith(); //刷新数据 + void AddItem_GeoLith(QStringList lists); + // void addItems_Core(); @@ -314,6 +336,9 @@ public slots: //改变固井曲线名 void s_changeGujingLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName); + //改变录井剖面属性 + void s_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan); + public: //蝌蚪图重绘网格线 bool mKedou = false;