From 2cc27657909f5f1dab4d6a70eeb6188b2fa40590 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 23 Mar 2026 10:20:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A5=97=E7=AE=A1=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=EF=BC=8C=E9=9A=8F=E7=9D=80=E5=A5=97=E7=AE=A1?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/PropertyWidget.cpp | 19 +++++ logPlus/qmycustomplot.cpp | 105 +++++++++++++++++++++++++++ logPlus/qmycustomplot.h | 4 + logPlus/transparentdraggableGuan.cpp | 23 ++++++ logPlus/transparentdraggableGuan.h | 2 +- 5 files changed, 152 insertions(+), 1 deletion(-) diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index e7a18aa..f8dd51d 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -1356,6 +1356,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_tdGuan->setRange(-depth-m_tdGuan->mH/2.0, -depth+m_tdGuan->mH/2.0); //保存 m_tdGuan->mPlot->SaveToSLF_Tubing(); + //检查套管组件名称,是否需要更新套管图形 + bool bReDraw = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result); + if(bReDraw) + { + //组件改变后,重绘管柱 + m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName); + } } } else if("组件类型" == m_propertyData[pProperty]) @@ -1363,6 +1370,10 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant //qDebug() << "组件类型->改变"; if(m_tdGuan) { + //检查套管组件名称,是否需要更新套管图形 + bool bReDrawOld = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result); + + //-------------------------- QString newResult = variant.value(); m_tdGuan->setResult(newResult); // @@ -1370,6 +1381,14 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant m_tdGuan->setRange(currentRange.lower, currentRange.upper); //保存 m_tdGuan->mPlot->SaveToSLF_Tubing(); + + //--------- + bool bReDrawNew = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result); + if(bReDrawOld || bReDrawNew) + { + //组件改变后,重绘管柱 + m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName); + } } } } diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 8cd385f..7a9c7e7 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -8363,6 +8363,17 @@ void QMyCustomPlot::addItem_Tubing() drawOne_Tubing(result); //保存 SaveToSLF_Tubing(); + + //检查套管组件名称,是否需要更新套管图形 + //画管柱 + if(str == "管底部" || + str == "油管深" || + str == "喇叭口" || + str == "剌叭口") + { + //组件改变后,重绘管柱 + LoadFromSLF_ReDrawTubing(m_strSlfName, m_strLineName); + } } } } @@ -8724,6 +8735,77 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result) this->addGuanToPlot(newLower, newUpper, cclimgfile, in, false); } +bool QMyCustomPlot::LoadFromSLF_ReDrawTubing(QString strSlfName, QString csCurve) +{ + cclimgpath_Tubing=GetSymbolDir()+"\\管柱组件\\"; + + Slf_JIEGUPOS *m_pResult=NULL; + CMemRdWt *logio=new CMemRdWt(); + if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) + { + delete logio; + return false; + } + + int iIndex=logio->OpenTable(csCurve.toStdString().c_str()); + if(iIndex<0) + { + delete logio; + return false; + } + // + if(iIndex>-1) { + int count=logio->GetTableRecordCount(iIndex); + //int fieldnum=logio->GetTableFieldCount(iIndex); + int len=logio->GetTableRecordLength(iIndex); + m_pResult=(Slf_JIEGUPOS *)new char[len+1]; + char buf[200]; + logio->IsChange=true; + + bool bDrawGuanzhu = false; + for(int i=0;iReadTable(iIndex,i+1,m_pResult); + + Slf_JIEGUPOS result; + result.Depth=m_pResult->Depth; + result.Order=m_pResult->Order; + result.Number=m_pResult->Number; + + // + double depth=m_pResult->Depth; + int Order=m_pResult->Order; + int Number=m_pResult->Number; + + if(bDrawGuanzhu == false) + { + //还没有画管柱 + if(Number == zoneOrder_Tubing.value("管底部").toInt()|| + Number == zoneOrder_Tubing.value("油管深").toInt()|| + Number == zoneOrder_Tubing.value("喇叭口").toInt()|| + Number == zoneOrder_Tubing.value("剌叭口").toInt()) + { + bDrawGuanzhu = true;//画管柱 + m_depth_Tubing = depth;//管柱深度 + + //绘制管柱 + DrawTubing(); + } + } + } + // + logio->CloseTable(iIndex); + delete m_pResult; + } + delete logio; + //统一刷新 + this->replot(); + + return true; +} + + bool QMyCustomPlot::SaveToSLF_Tubing() { static int isrun=false; @@ -8827,3 +8909,26 @@ bool QMyCustomPlot::SaveToSLF_Tubing() isrun=false; return true; } + + +//检查套管组件名称,是否需要更新套管图形 +bool QMyCustomPlot::checkTubingName(QString m_Result) +{ + // + QString name,itemName; + m_Result.replace("\\","/"); + int l=m_Result.lastIndexOf("/"); + if(l>-1) name=m_Result.mid(l+1); + l=name.indexOf("."); + name=name.left(l); + itemName=name; + //画管柱 + if(itemName == "管底部" || + itemName == "油管深" || + itemName == "喇叭口" || + itemName == "剌叭口") + { + return true; + } + return false; +} diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 4e515fb..62c52c3 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -298,6 +298,10 @@ public: void DrawStruct(); //绘制管柱 void DrawTubing(); + //组件改变后,重绘管柱 + bool LoadFromSLF_ReDrawTubing(QString strSlfName, QString csCurve); + //检查套管组件名称,是否需要更新套管图形 + bool checkTubingName(QString m_Result); public slots: void slot_time(); diff --git a/logPlus/transparentdraggableGuan.cpp b/logPlus/transparentdraggableGuan.cpp index cadba8d..47bab48 100644 --- a/logPlus/transparentdraggableGuan.cpp +++ b/logPlus/transparentdraggableGuan.cpp @@ -316,6 +316,14 @@ void TransparentDraggableGuan::setItemDepthOffset() //保存 mPlot->SaveToSLF_Tubing(); + //检查套管组件名称,是否需要更新套管图形 + bool bReDraw = mPlot->checkTubingName(m_Result); + if(bReDraw) + { + //组件改变后,重绘管柱 + mPlot->LoadFromSLF_ReDrawTubing(mPlot->m_strSlfName, mPlot->m_strLineName); + } + //属性清空 PropertyService()->InitCurrentViewInfo(); @@ -406,6 +414,13 @@ void TransparentDraggableGuan::onDelRect() mPlot->replot(); //保存 mPlot->SaveToSLF_Tubing(); + //检查套管组件名称,是否需要更新套管图形 + bool bReDraw = mPlot->checkTubingName(m_Result); + if(bReDraw) + { + //组件改变后,重绘管柱 + mPlot->LoadFromSLF_ReDrawTubing(mPlot->m_strSlfName, mPlot->m_strLineName); + } //属性清空 PropertyService()->InitCurrentViewInfo(); } @@ -606,6 +621,7 @@ void TransparentDraggableGuan::onMouseMove(QMouseEvent *event) } + void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event) { if(event->button() == Qt::LeftButton && mDragMode != DragNone) { @@ -619,6 +635,13 @@ void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event) { //保存 mPlot->SaveToSLF_Tubing(); + //检查套管组件名称,是否需要更新套管图形 + bool bReDraw = mPlot->checkTubingName(m_Result); + if(bReDraw) + { + //组件改变后,重绘管柱 + mPlot->LoadFromSLF_ReDrawTubing(mPlot->m_strSlfName, mPlot->m_strLineName); + } } //取消所有选中单元格 diff --git a/logPlus/transparentdraggableGuan.h b/logPlus/transparentdraggableGuan.h index 1e38ab4..531de78 100644 --- a/logPlus/transparentdraggableGuan.h +++ b/logPlus/transparentdraggableGuan.h @@ -32,7 +32,7 @@ public: //设置外径长 void setOin(float in); - //设置解释结论 + //设置套管组件 void setResult(QString filePath); void drawResult(double left_Low, double right_Hight, double lY1, double lY2); From 5e750f0529d10928dc080d92e36788355ebabd0b Mon Sep 17 00:00:00 2001 From: "DESKTOP-450PEFP\\mainc" Date: Mon, 23 Mar 2026 10:40:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=80=BB=E8=BE=91=EF=BC=8C=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=B8=AD=E8=87=AA=E5=AE=9A=E4=B9=89=E7=94=9F=E6=88=90QAction?= =?UTF-8?q?=20=E5=B9=B3=E5=8F=B0=E8=8E=B7=E5=8F=96=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=B8=AD=E5=AE=9A=E4=B9=89=E7=9A=84QAction=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=9C=A8ToolBar,=20=E7=82=B9=E5=87=BBQAction,=20=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=8F=92=E4=BB=B6=E6=8F=92=E5=85=A5=E5=88=B0tab?= =?UTF-8?q?=E4=B8=AD=20getPrjAllSlf=E5=B0=81=E8=A3=85=E5=88=B0Slfio?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=9C=A8=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=AD=E4=BD=BF=E7=94=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallPlugin/CallPlugin.cpp | 37 +++++- CallPlugin/CallPlugin.h | 7 + Plugin/PluginUnit/PluginUnit.cpp | 59 +++++++++ Plugin/PluginUnit/PluginUnit.h | 31 +++++ Plugin/PluginUnit/PluginUnit.pro | 50 +++++++ Plugin/PluginUnit/image/zfu.png | Bin 0 -> 479 bytes Plugin/PluginUnit/myunitui.cpp | 221 +++++++++++++++++++++++++++++++ Plugin/PluginUnit/myunitui.h | 44 ++++++ Plugin/PluginUnit/myunitui.ui | 65 +++++++++ Plugin/PluginUnit/res.qrc | 5 + Slfio/include/MemRdWt.h | 3 + Slfio/include/commonutils.h | 30 +++++ Slfio/src/Slfio.pro | 2 + Slfio/src/commonutils.cpp | 203 ++++++++++++++++++++++++++++ Slfio/src/memrdwt.cpp | 10 +- common/geometryutils.cpp | 153 +-------------------- include/HPluginInterface.h | 3 + logPlus/mainwindow.cpp | 42 ++++++ logPlus/mainwindow.h | 3 + 19 files changed, 814 insertions(+), 154 deletions(-) create mode 100644 Plugin/PluginUnit/PluginUnit.cpp create mode 100644 Plugin/PluginUnit/PluginUnit.h create mode 100644 Plugin/PluginUnit/PluginUnit.pro create mode 100644 Plugin/PluginUnit/image/zfu.png create mode 100644 Plugin/PluginUnit/myunitui.cpp create mode 100644 Plugin/PluginUnit/myunitui.h create mode 100644 Plugin/PluginUnit/myunitui.ui create mode 100644 Plugin/PluginUnit/res.qrc create mode 100644 Slfio/include/commonutils.h create mode 100644 Slfio/src/commonutils.cpp diff --git a/CallPlugin/CallPlugin.cpp b/CallPlugin/CallPlugin.cpp index 7aa8b44..9e105c2 100644 --- a/CallPlugin/CallPlugin.cpp +++ b/CallPlugin/CallPlugin.cpp @@ -79,5 +79,38 @@ void CallPlugin::setPluginParams(QString strPluginName, QString strParams) { return pluInter->setParams(strParams); } - } -} \ No newline at end of file + } +} + +QList CallPlugin::getPluginActionList(QWidget *parent) +{ + QList ret; + foreach (HPLUGIN_INFO *pluItem, HPluginManage::getInstance()->getPluginList()) + { + HPluginInterface *pluInter = reinterpret_cast(pluItem->pluClass); + QWidget *pWidget = pluInter->createWindow(parent); + if(pWidget) + pWidget->hide(); + QAction *p = pluInter->createAction(parent); + if(p) + ret << p; + } + return ret; +} + +QAction *CallPlugin::getPluginAction(QString strPluginName, QWidget *parent) +{ + if (strPluginName == "") + return nullptr; + + foreach (HPLUGIN_INFO *pluItem, HPluginManage::getInstance()->getPluginList()) + { + HPluginInterface *pluInter = reinterpret_cast(pluItem->pluClass); + if (pluItem->pluName == strPluginName) + { + QAction *pAct = pluInter->createAction(parent); + return pAct; + } + } + return nullptr; +} diff --git a/CallPlugin/CallPlugin.h b/CallPlugin/CallPlugin.h index c6d19f8..2d4a9bf 100644 --- a/CallPlugin/CallPlugin.h +++ b/CallPlugin/CallPlugin.h @@ -25,6 +25,13 @@ public: QString getPluginParams(QString strPluginName); void setPluginParams(QString strPluginName, QString strParams); + // 从插件模块中获取所有需要显示在平台的按钮 + QList getPluginActionList(QWidget *parent = Q_NULLPTR); + + //根据插件名称获取平台显示按钮 + QAction *getPluginAction(QString strPluginName, QWidget *parent = Q_NULLPTR); + + public: Q_DISABLE_COPY(CallPlugin) }; diff --git a/Plugin/PluginUnit/PluginUnit.cpp b/Plugin/PluginUnit/PluginUnit.cpp new file mode 100644 index 0000000..5e9cfa9 --- /dev/null +++ b/Plugin/PluginUnit/PluginUnit.cpp @@ -0,0 +1,59 @@ +#include "PluginUnit.h" +#include "PluginName.h" + +#include "myunitui.h" +MyUnitUI *_window = nullptr; + +PluginUnit::PluginUnit(QObject *parent) : + QObject(parent) +{ + +} + +QString PluginUnit::getPluName() const +{ + QString pluName = tr(PLUGINUNIT); + return pluName; +} + +QIcon PluginUnit::icon() const +{ + return QIcon(":/logo.png"); +} + +int PluginUnit::windowType() const +{ + return 1; +} + +QWidget *PluginUnit::createWindow(QWidget *parent) const +{ + if (_window == nullptr) + { + _window = new MyUnitUI(parent); + } + return _window; +} + +QString PluginUnit::getParams() const +{ + if (_window != nullptr) + return _window->getParams(); + + return ""; +} + +void PluginUnit::setParams(QString &strParams) +{ + if (_window != nullptr) + return _window->setParams(strParams); +} + +QAction *PluginUnit::createAction(QWidget *parent) const +{ + if (_window == nullptr) + createWindow(parent); + + return _window->createAction(); +} + diff --git a/Plugin/PluginUnit/PluginUnit.h b/Plugin/PluginUnit/PluginUnit.h new file mode 100644 index 0000000..ef89101 --- /dev/null +++ b/Plugin/PluginUnit/PluginUnit.h @@ -0,0 +1,31 @@ +#ifndef PLUGINUNIT_H +#define PLUGINUNIT_H + +#include "HPluginInterface.h" + +class PluginUnit : public QObject, public HPluginInterface +{ + Q_OBJECT + + Q_INTERFACES(HPluginInterface) +#if QT_VERSION >= 0x050000 + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.HPluginInterface") +#endif // QT_VERSION >= 0x050000 + +public: + explicit PluginUnit(QObject *parent = 0); + + virtual QString getPluName() const; + virtual QIcon icon() const; + virtual int windowType() const; + virtual QWidget *createWindow(QWidget *parent) const; + virtual QString getParams() const; + virtual void setParams(QString &strParams); + + virtual QAction *createAction(QWidget *parent) const; + +signals: + +public slots: +}; +#endif // PLUGINUNIT_H diff --git a/Plugin/PluginUnit/PluginUnit.pro b/Plugin/PluginUnit/PluginUnit.pro new file mode 100644 index 0000000..cc08823 --- /dev/null +++ b/Plugin/PluginUnit/PluginUnit.pro @@ -0,0 +1,50 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +TEMPLATE = lib + +CONFIG += c++17 + +HEADERS = \ + PluginUnit.h \ + myunitui.h + +SOURCES = \ + PluginUnit.cpp \ + myunitui.cpp + + +FORMS += \ + myunitui.ui + + +INCLUDEPATH += $$PWD/../../include \ + $$PWD/../../HPluginManage \ + $$PWD/../../CallPlugin +INCLUDEPATH += $$PWD/../../Slfio/include + +# Default rules for deployment. +CONFIG(debug, debug|release){ + TARGET = PluginUnitd + DESTDIR = $$PWD/../../Bin/customPlugind + MOC_DIR = ../tmp/PluginUnitd + UI_DIR = ../tmp/PluginUnitd + OBJECTS_DIR = ../tmp/PluginUnitd + LIBS += -L$$PWD/../../Bin/ -lCallPlugind -lHPluginManaged -lslfiod +} else { + TARGET = PluginUnit + DESTDIR = $$PWD/../../Bin/customPlugin + MOC_DIR = ../tmp/PluginUnit + UI_DIR = ../tmp/PluginUnit + OBJECTS_DIR = ../tmp/PluginUnit + LIBS += -L$$PWD/../../Bin/ -lCallPlugin -lHPluginManage -lslfio +} + +RESOURCES += \ + res.qrc diff --git a/Plugin/PluginUnit/image/zfu.png b/Plugin/PluginUnit/image/zfu.png new file mode 100644 index 0000000000000000000000000000000000000000..cd3c31f4d7f0811e461b5c9821425f339bdd6fd0 GIT binary patch literal 479 zcmV<50U-W~P)OXCs~hbNy7CMzdjz}D zr9FXo02hUByn?%W1G93W(k`r2p`wz0*bgHUV~DneDU>FQ`N3mChR6KEyv)EOwrwM9 z5FDKCGbj71coP;k8Nj*woDbN=Lkfw#(M0yRt{8ZLd{$Qn5&eiDPG35k5n>Ajnabutl2h<^5ND+Jus;$w>i7X7bYcY ziWecpi;&_)Nbw@1co9;(u>KUgY*~-$r$43ibt(FhUZNBl3yI?WReR`ksl}#uhA(@B z0+Ip{1?Wji`>q|kcXA_Ef-Zl?ojfWz`HjaFlTGP%U*8Q{DJ8)wP;cG7f_y!Xv VV0q6iZ^Zxr002ovPDHLkV1oNb)A#@Y literal 0 HcmV?d00001 diff --git a/Plugin/PluginUnit/myunitui.cpp b/Plugin/PluginUnit/myunitui.cpp new file mode 100644 index 0000000..571240f --- /dev/null +++ b/Plugin/PluginUnit/myunitui.cpp @@ -0,0 +1,221 @@ +#include "myunitui.h" +#include "ui_myunitui.h" +#include "PluginName.h" +#include "MemRdWt.h" +#include +#include + +//固井结构体(注:此处为表格输出示例) +typedef struct ss_struct +{ + int GNO; + float GSDEP,GEDEP; + int GRESULT; +} GUJING; + +MyUnitUI::MyUnitUI(QWidget *parent) : + QWidget(parent), + ui(new Ui::MyUnitUI) +{ + ui->setupUi(this); + + //保存logplus窗口句柄 + m_mainParentWindow = (QMainWindow *)parent; + + //绑定logplus信号槽 + connect(this, SIGNAL(sig_PluginMsg(QString)), m_mainParentWindow, SLOT(s_PluginMsg(QString))); + + //测试用 + //点击按钮 + connect(ui->pushButton, &QPushButton::clicked, this, [ = ]() + { + s_ButtonClick(); + }); +} + +MyUnitUI::~MyUnitUI() +{ + delete ui; +} + +QString MyUnitUI::getParams() +{ + return ui->lineEdit->text(); +} + +void MyUnitUI::setParams(QString &strParams) +{ + if (strParams.length() <= 0) + { + return; + } + QJsonParseError err_rpt; + QJsonDocument root_Doc = QJsonDocument::fromJson(strParams.toStdString().c_str(), &err_rpt);//字符串格式化为JSON + if (err_rpt.error != QJsonParseError::NoError) + { + return; + } + QJsonObject root_Obj = root_Doc.object(); + if (root_Obj.contains("prjname")) + { + // 获取当前项目名称 + m_strPrjName = root_Obj.value("prjname").toString(); + ui->lineEdit->setText(m_strPrjName); + } + +} + +QAction *MyUnitUI::createAction() +{ + //下面, 平台显示按钮, 如需要平台显示解开注释 + m_pAction = new QAction(); + m_pAction->setText("直方图"); + m_pAction->setToolTip("直方图"); + m_pAction->setIcon( QIcon(":/image/zfu.png")); + m_pAction->setProperty("PluginName", PLUGINUNIT); + + return m_pAction; +} + +//测试按钮 +void MyUnitUI::s_ButtonClick() +{ + QVector vecSlfList; + QVector vecWellList; + // 根据当前项目名称获取当前项目的slf文件,获取当前项目井文件 + bool bret = CMemRdWt::getPrjAllSlf(m_strPrjName, vecSlfList, vecWellList); + + if(vecSlfList.size() > 0) + { + CMemRdWt *pMemRdWt=new CMemRdWt(); + //(1)初始化参数、输入 + pMemRdWt->Const(); + pMemRdWt->In(); + + if(!pMemRdWt->Open(vecSlfList.at(6).toStdString().c_str(),CMemRdWt::modeReadWrite)) { + delete pMemRdWt; + return; + } + + //(2)波形类型的输出数据初始化检查 + char outname[2][16]; + int OUTindex = 0, WaveIndex = 0; + pMemRdWt->GetOutCurveName(OUTindex, outname[OUTindex]);//获取输出数据名称,参数1是序列值(从0开始)(注:波形/曲线均使用GetOutCurveName函数) + + float fSdep = 2900; //设置起始深度 + float fEdep = 3000; //设置结束深度 + float fRlev = 0.0; //设置采样间隔 + + int index1 = pMemRdWt->OpenWave(outname[OUTindex]);//检查是否存在outname[OUTindex]波形 + if(index1 < 0) //返回索引小于0说明没有该波形,需要创建 + { + //创建方式: + Slf_WAVE myWave; + strcpy(myWave.Name, outname[OUTindex]); + strcpy(myWave.AliasName, outname[OUTindex]); + strcpy(myWave.DepthUnit, "m"); + myWave.CodeLen = 4; + myWave.RepCode = 4; + myWave.DefVal = 0; + myWave.StartDepth = fSdep; + myWave.EndDepth = fEdep; + myWave.DepLevel = fRlev; + strcpy(myWave.DepthUnit, "m"); + myWave.StartTime = 0; //起始记录时间 + myWave.TimeLevel = 5; //时间采样间隔 + myWave.ArrayNum = 1; //阵列数 + myWave.TimeSamples = 36; //时间采样总数 + strcpy(myWave.TimeUnit, "ns"); //时间单位 + + index1 = pMemRdWt->OpenWave((Slf_WAVE *)&myWave); //创建波形(注:此时返回索引应>1,代表创建成功) + } + if(index1 < 0) + { + return; + }else + { + WaveIndex = index1; + } + + //(3)曲线类型的输出数据初始化检查 + OUTindex = 1;//按extern "C"中定义的输出数据顺序设置 + pMemRdWt->GetOutCurveName(OUTindex, outname[OUTindex]);//获取输出数据名称,参数1是序列值(从0开始) + index1 = pMemRdWt->OpenCurve(outname[1]);//index1 = MemRdWt.OpenCurve("EEE");//检查数据是否存在//outname[OUTindex] + if(index1 < 0) //返回索引小于0说明没有这条曲线,需要创建 + { + //创建方式: + Slf_CURVE myCurve; //定义曲线对象 + strcpy(myCurve.Name, outname[1]); //设置名称 + strcpy(myCurve.AliasName, outname[1]); //设置别名 + strcpy(myCurve.Unit, "m"); //设置数据单位 + myCurve.CodeLen = 4; //设置字节长度(注:4float) + myCurve.RepCode = 4; //设置数据类型(注:4float) + myCurve.DefVal = 0; //设置默认值 + myCurve.StartDepth = fSdep; //设置起始深度 + myCurve.EndDepth = fEdep; //设置结束深度 + myCurve.DepLevel = fRlev; //设置采样间隔 + strcpy(myCurve.DepthUnit, "m"); //设置深度单位 + + index1 = pMemRdWt->OpenCurve((Slf_CURVE *)&myCurve); //创建曲线(注:此时返回索引应>1,代表创建成功) + + } + if(index1 < 0) + { + return; + } + + /*************************************************向平台写表格示例************************************************************* + *****************************begin****************************/ + + //(1)固井结论表格 + int itable1 = pMemRdWt->OpenOG_RESULT("固井质量");//例如表格取名为“固井质量” + pMemRdWt->SetTableRecordCount(itable1, 0); //清空原有表格数据 + + GUJING *CCNN2 = new GUJING[5]; + for(int i = 0; i < 5; i++) + { + CCNN2[i].GNO = i + 1; + CCNN2[i].GSDEP = 2000 + i * 10; + CCNN2[i].GEDEP = 2000 + (i + 1) * 10; + CCNN2[i].GRESULT = 1; + + int temp = pMemRdWt->WriteTable(itable1, i + 1, &CCNN2[i]); + } + + //(2)其他表格 + struct Slf_RST{ + int Order; + float Depth; + float CorrDepth; + }; + struct Slf_RST m_Result; + itable1 = pMemRdWt->OpenTable("ABCD"); + if (itable1 < 0) + { + itable1 = pMemRdWt->Open_Set_Table("ABCD",0,3, + "NO,DEPTH,DDEP", + "4,4,4",//字段长度 + "1,4,4",//字段类型 + "0,0,0");//字段备注,1-枚举 + } + pMemRdWt->SetTableRecordCount(itable1,3); //设置表格有3行数据 + for(int j = 0; j < 3; j++) + { + memset(&m_Result, 0, sizeof(Slf_RST)); + m_Result.Order = j + 1; + m_Result.Depth = 10; + m_Result.CorrDepth = 20 + j; + pMemRdWt->WriteTable(itable1, j + 1, &m_Result); + + } + pMemRdWt->CloseTable(itable1); + + delete pMemRdWt; + } + + // + QString strMsg = ui->lineEdit->text(); + + //插件给平台发消息 + emit sig_PluginMsg("插件给平台发了消息:" + strMsg); +} diff --git a/Plugin/PluginUnit/myunitui.h b/Plugin/PluginUnit/myunitui.h new file mode 100644 index 0000000..8c018ea --- /dev/null +++ b/Plugin/PluginUnit/myunitui.h @@ -0,0 +1,44 @@ +#ifndef MYUNITUI_H +#define MYUNITUI_H + +#include +#include +#include + +#pragma execution_character_set("utf-8") + +namespace Ui { +class MyUnitUI; +} + +class MyUnitUI : public QWidget +{ + Q_OBJECT + +public: + explicit MyUnitUI(QWidget *parent = nullptr); + ~MyUnitUI(); + +private: + Ui::MyUnitUI *ui; + QAction* m_pAction = nullptr; + QString m_strPrjName = ""; + +public: + QString getParams(); + void setParams(QString &strParams); + + // 创建在平台显示的QAction按钮 + QAction *createAction(); + +public: + QMainWindow *m_mainParentWindow; + +signals: + void sig_PluginMsg(QString msg); + +public slots: + void s_ButtonClick(); +}; + +#endif // MYUNITUI_H diff --git a/Plugin/PluginUnit/myunitui.ui b/Plugin/PluginUnit/myunitui.ui new file mode 100644 index 0000000..2456ddd --- /dev/null +++ b/Plugin/PluginUnit/myunitui.ui @@ -0,0 +1,65 @@ + + + MyUnitUI + + + + 0 + 0 + 367 + 331 + + + + Form + + + QWidget#widget{ +background-color: rgb(225, 170, 255); +} + + + + + + + + 60 + 80 + 211 + 111 + + + + + + + + + + 我是插件-直方图 + + + Qt::AlignCenter + + + + + + + + + + 发送消息 + + + + + + + + + + + + diff --git a/Plugin/PluginUnit/res.qrc b/Plugin/PluginUnit/res.qrc new file mode 100644 index 0000000..a4445e2 --- /dev/null +++ b/Plugin/PluginUnit/res.qrc @@ -0,0 +1,5 @@ + + + image/zfu.png + + diff --git a/Slfio/include/MemRdWt.h b/Slfio/include/MemRdWt.h index fc0cb52..fbd4d74 100644 --- a/Slfio/include/MemRdWt.h +++ b/Slfio/include/MemRdWt.h @@ -124,6 +124,9 @@ public: CMemRdWt(); CMemRdWt(const char *wellname,bool mconst=FALSE,int FileType=0); ~CMemRdWt(); + + static bool getPrjAllSlf(QString prjname, QVector &vecSlfList, QVector &vecWellList);//直方图,获取当前工程下的slf + void Initialize(bool mconst=FALSE); void BackData(); void RestoreData(); diff --git a/Slfio/include/commonutils.h b/Slfio/include/commonutils.h new file mode 100644 index 0000000..0a75961 --- /dev/null +++ b/Slfio/include/commonutils.h @@ -0,0 +1,30 @@ +#ifndef COMMONUTILS_H +#define COMMONUTILS_H + +#include +#include +#include +#include +#include +#include + +#pragma execution_character_set("utf-8") + +class CCommonUtils +{ + //函数定义 +public: + //构造函数 + CCommonUtils(); + //析构函数 + virtual ~CCommonUtils(); + + static bool getAllSlf(QString prjname, QVector &vecSlfList, QVector &vecWellList);//直方图,获取当前工程下的slf + static QString GetLogdataPath(); + static int chakan(QString path, QStringList &wellfs, QString strSuffix); + +private: + +}; + +#endif // COMMONUTILS_H diff --git a/Slfio/src/Slfio.pro b/Slfio/src/Slfio.pro index 83262ad..9c2d37d 100644 --- a/Slfio/src/Slfio.pro +++ b/Slfio/src/Slfio.pro @@ -52,11 +52,13 @@ HEADERS += \ ../include/LogIO.h \ ../include/MemRdWt.h \ ../include/SlfioExport.h \ + ../include/commonutils.h \ ../include/slf.h SOURCES += \ CStringType.cpp \ LogIO.cpp \ + commonutils.cpp \ memrdwt.cpp \ slf.cpp diff --git a/Slfio/src/commonutils.cpp b/Slfio/src/commonutils.cpp new file mode 100644 index 0000000..e7f9993 --- /dev/null +++ b/Slfio/src/commonutils.cpp @@ -0,0 +1,203 @@ +#include "commonutils.h" +#include "LogIO.h" +#include + +CCommonUtils::CCommonUtils() +{ + +} + +CCommonUtils::~CCommonUtils() +{ + +} + +bool CCommonUtils::getAllSlf(QString prjname, QVector &vecSlfList, QVector &vecWellList) +{ + //Logdata + QString folderPath; + folderPath = GetLogdataPath(); + folderPath = folderPath + prjname; + folderPath = folderPath + "/"; + + //------------------- + QStringList listFolders; + QFileInfo mfi(folderPath); + if(!mfi.isDir()) + { + //井文件 *.wwl + if(!mfi.isFile()) + { + return false; + } + //listFiles.append(folderPath); + } + else + { + //井目录 + //取当前当前目录内容 + QDir dir(folderPath); + dir.setFilter(QDir::Dirs |QDir::NoDotAndDotDot |QDir::Files | QDir::NoSymLinks); + QFileInfoList list = dir.entryInfoList(); + int file_count = list.count(); + if(file_count <= 0)//判断目录是否为空,空目录返回 + { + return false; + } + //取当前目录内容,符合后缀文件 + QStringList string_list; + for(int i=0; iOpen(filename.toStdString().c_str(),CSlfIO::modeRead)) + { + delete logio; + QString aa=filename+"文件打开失败,请检查!"; + //qDebug() << aa; + //AppendConsole(pai::log::PAI_ERROR,aa); + continue; + } + // + QString wellname=""; + Slf_FILE_MESSAGE mssage; + logio->GetFileMessage(mssage); + wellname=mssage.WellName; + wellname=wellname.toUpper(); + if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1) + { + //辨别井名是否有效,无效则采用文件名 + QFileInfo fileInfo(filename); + QString strWellName = fileInfo.completeBaseName(); + strWellName=strWellName.toUpper(); + // + wellname=strWellName.toStdString().c_str(); + int len=strlen(strWellName.toStdString().c_str()); + if(len>sizeof(mssage.WellName)) len=sizeof(mssage.WellName); + strncpy(mssage.WellName,strWellName.toStdString().c_str(),len); + mssage.WellName[len]=0; + logio->SetFileMessage(mssage); + } + wellname=wellname.toUpper(); + + //查找是否已经存在该井和井次 + if(wellNames.contains(wellname)) + { + delete logio; + continue; + } + wellNames.append(wellname); + // + vecWellList.append(wellname); + + //加载*.slf + QStringList slffiles; + QString pathTmp=GetLogdataPath(); + pathTmp+=prjname+"/#"+wellname; + chakan(pathTmp, slffiles, "*.slf"); + foreach(QString slfFile1, slffiles ) + { + CLogIO * logioSLf=new CLogIO(); + if(!logioSLf->Open(slfFile1.toStdString().c_str(),CSlfIO::modeRead)) + { + delete logioSLf; + //QString aa=fileFull+"文件打开失败,请检查!"; + //qDebug() << aa; + //AppendConsole(pai::log::PAI_ERROR,aa); + continue; + } + else + { + Slf_FILE_MESSAGE mssageSlf; + logioSLf->GetFileMessage(mssageSlf); + + if(wellname != QString(mssageSlf.WellName)) + { + delete logioSLf; + continue; + } + QString wellnameSLf=mssageSlf.Item; + if (wellnameSLf.isEmpty()||wellnameSLf.length()>64||wellnameSLf.indexOf('&')>-1) + { + QFileInfo fileinfo; + fileinfo = QFileInfo(slfFile1); + wellnameSLf = fileinfo.completeBaseName(); + } + if(wellnameSLf != wellname) + { + //井次名称不一致 + //qDebug() << "井次名称不一致"; + delete logioSLf; + continue; + } + + vecSlfList.append(slfFile1); + delete logioSLf; + } + } + } + + return true; +} + +QString CCommonUtils::GetLogdataPath() +{ + // 1.获取当前运行程序的目录路径 + QString applicationDirPath = QCoreApplication::applicationDirPath(); + //获取上级目录 + int index = applicationDirPath.lastIndexOf("/"); + int index1 = applicationDirPath.lastIndexOf("\\"); + if(index1 > index) + { + index = index1; + } + // + QString strImagePath; + strImagePath = applicationDirPath.mid(0,index+1) + "Logdata/"; + // + QDir dir(strImagePath); + if( !dir.exists( strImagePath ) ) + { + dir.mkdir(strImagePath); + } + + return strImagePath; +} + +int CCommonUtils::chakan(QString path, QStringList &wellfs, QString strSuffix) +{ + QDir dir(path); + QFileInfoList fileInfos = dir.entryInfoList(QStringList() << strSuffix, QDir::Files); + foreach(QFileInfo fileInfo, fileInfos) + { + wellfs.append(fileInfo.absoluteFilePath()); + } + return 1; +} diff --git a/Slfio/src/memrdwt.cpp b/Slfio/src/memrdwt.cpp index e3576b7..a6516af 100644 --- a/Slfio/src/memrdwt.cpp +++ b/Slfio/src/memrdwt.cpp @@ -1,6 +1,8 @@ #include "MemRdWt.h" #include "math.h" #include +#include "commonutils.h" + CMemRdWt ::CMemRdWt(const char *wellname,bool bconst,int FileType):CLogIO(wellname,FileType) { Initialize(bconst); @@ -409,8 +411,14 @@ QString getStrValue(char *stryy,int pos)//stryy 输入字符串缓冲器,pos CMemRdWt ::~CMemRdWt() { - Close(); + Close(); } + +bool CMemRdWt::getPrjAllSlf(QString prjname, QVector &vecSlfList, QVector &vecWellList) +{ + return CCommonUtils::getAllSlf(prjname, vecSlfList, vecWellList); +} + int CMemRdWt::GetInCurveName(int CurveNo,char *InName) { if(!INC) return 0; diff --git a/common/geometryutils.cpp b/common/geometryutils.cpp index 50c7b1c..8ab20fd 100644 --- a/common/geometryutils.cpp +++ b/common/geometryutils.cpp @@ -9,6 +9,7 @@ #include #include #include "LogIO.h" +#include "MemRdWt.h" float mLineWidth=0.75; QString OilField; @@ -700,157 +701,7 @@ bool SystemExiting(){return SystemIsExiting;} //直方图,获取当前工程下的slf bool getAllSlf(QString prjname, QVector &vecSlfList, QVector &vecWellList) { - //Logdata - QString folderPath; - folderPath = GetLogdataPath(); - folderPath = folderPath + prjname; - folderPath = folderPath + "/"; - - //------------------- - QStringList listFolders; - QFileInfo mfi(folderPath); - if(!mfi.isDir()) - { - //井文件 *.wwl - if(!mfi.isFile()) - { - return false; - } - //listFiles.append(folderPath); - } - else - { - //井目录 - //取当前当前目录内容 - QDir dir(folderPath); - dir.setFilter(QDir::Dirs |QDir::NoDotAndDotDot |QDir::Files | QDir::NoSymLinks); - QFileInfoList list = dir.entryInfoList(); - int file_count = list.count(); - if(file_count <= 0)//判断目录是否为空,空目录返回 - { - return false; - } - //取当前目录内容,符合后缀文件 - QStringList string_list; - for(int i=0; iOpen(filename.toStdString().c_str(),CSlfIO::modeRead)) - { - delete logio; - QString aa=filename+"文件打开失败,请检查!"; - //qDebug() << aa; - //AppendConsole(pai::log::PAI_ERROR,aa); - continue; - } - // - QString wellname=""; - Slf_FILE_MESSAGE mssage; - logio->GetFileMessage(mssage); - wellname=mssage.WellName; - wellname=wellname.toUpper(); - if (wellname.isEmpty()||wellname.length()>64||wellname.indexOf('&')>-1) - { - //辨别井名是否有效,无效则采用文件名 - QFileInfo fileInfo(filename); - QString strWellName = fileInfo.completeBaseName(); - strWellName=strWellName.toUpper(); - // - wellname=strWellName.toStdString().c_str(); - int len=strlen(strWellName.toStdString().c_str()); - if(len>sizeof(mssage.WellName)) len=sizeof(mssage.WellName); - strncpy(mssage.WellName,strWellName.toStdString().c_str(),len); - mssage.WellName[len]=0; - logio->SetFileMessage(mssage); - } - wellname=wellname.toUpper(); - - //查找是否已经存在该井和井次 - if(wellNames.contains(wellname)) - { - delete logio; - continue; - } - wellNames.append(wellname); - // - vecWellList.append(wellname); - - //加载*.slf - QStringList slffiles; - QString pathTmp=GetLogdataPath(); - pathTmp+=prjname+"/#"+wellname; - chakan(pathTmp, slffiles, "*.slf"); - foreach(QString slfFile1, slffiles ) - { - CLogIO * logioSLf=new CLogIO(); - if(!logioSLf->Open(slfFile1.toStdString().c_str(),CSlfIO::modeRead)) - { - delete logioSLf; - //QString aa=fileFull+"文件打开失败,请检查!"; - //qDebug() << aa; - //AppendConsole(pai::log::PAI_ERROR,aa); - continue; - } - else - { - Slf_FILE_MESSAGE mssageSlf; - logioSLf->GetFileMessage(mssageSlf); - - if(wellname != QString(mssageSlf.WellName)) - { - delete logioSLf; - continue; - } - QString wellnameSLf=mssageSlf.Item; - if (wellnameSLf.isEmpty()||wellnameSLf.length()>64||wellnameSLf.indexOf('&')>-1) - { - QFileInfo fileinfo; - fileinfo = QFileInfo(slfFile1); - wellnameSLf = fileinfo.completeBaseName(); - } - if(wellnameSLf != wellname) - { - //井次名称不一致 - //qDebug() << "井次名称不一致"; - delete logioSLf; - continue; - } - - vecSlfList.append(slfFile1); - delete logioSLf; - } - } - } - - return true; + return CMemRdWt::getPrjAllSlf(prjname, vecSlfList, vecWellList); } int GetCurvInfo(QString strSlfName, QString strLineName, double &sdep, double &edep, double &rlev) diff --git a/include/HPluginInterface.h b/include/HPluginInterface.h index 9ede14b..2e6e4ce 100644 --- a/include/HPluginInterface.h +++ b/include/HPluginInterface.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "HPluginDefine.h" @@ -20,6 +21,8 @@ public: virtual QWidget *createWindow(QWidget *parent) const = 0; virtual QString getParams() const = 0; virtual void setParams(QString &strParams) = 0; + + virtual QAction *createAction(QWidget *parent) const = 0; }; #define HPluginInterface_iid "org.qt-project.HPluginInterface" diff --git a/logPlus/mainwindow.cpp b/logPlus/mainwindow.cpp index 1fb72f5..a89b292 100644 --- a/logPlus/mainwindow.cpp +++ b/logPlus/mainwindow.cpp @@ -71,9 +71,12 @@ MainWindow::MainWindow(QWidget *parent) : initTitleBar(); //菜单栏 initToolBar(); //工具栏 + initPluginTool(); //插件QAction + initProjectView(); //左侧-项目区 初始化在前 initWorkSpaceView(); //中间-工作区 初始化在后 dockLayout(); + // this->setStatusBar(::GetStatusBar());//状态栏 @@ -243,6 +246,17 @@ void MainWindow::initToolBar() // connect(m_loadAc, &QAction::triggered, this, &MainWindow::s_DrawLine); } +//初始化插件QAction +void MainWindow::initPluginTool() +{ + QList listTool = CallPlugin::getInstance()->getPluginActionList(this); + foreach (QAction *pAct, listTool) + { + ui->mainToolBar->addAction(pAct); + connect(pAct, &QAction::triggered, this, &MainWindow::slot_PluginActionFunc); + } +} + //左侧 void MainWindow::initProjectView() { @@ -367,6 +381,34 @@ void MainWindow::s_SaveProject() // emit CallManage::getInstance()->sig_testPlugin("hello"); } +void MainWindow::slot_PluginActionFunc() +{ + QAction* pAction = qobject_cast(sender()); + if(pAction == nullptr) + return; + + if (g_prjname == "") + { + QMessageBox::information(nullptr, "提示", "请先打开项目!"); + return; + } + + QString strPluginName = pAction->property("PluginName").toString(); + QWidget * pMyWidget = CallPlugin::getInstance()->getPluginWidget(strPluginName, (QWidget *)this); + if (pMyWidget != nullptr) + { + QJsonObject rootObject; + rootObject.insert("prjname", g_prjname); + //---------------------- + QJsonDocument doc; + doc.setObject(rootObject); + + CallPlugin::getInstance()->setPluginParams(strPluginName, doc.toJson(QJsonDocument::Compact)); + m_centerWidgets->addTab(pMyWidget, pAction->text()); + + } +} + //收到插件消息 void MainWindow::s_PluginMsg(QString msg) { diff --git a/logPlus/mainwindow.h b/logPlus/mainwindow.h index c6cd9ae..5a36106 100644 --- a/logPlus/mainwindow.h +++ b/logPlus/mainwindow.h @@ -65,6 +65,7 @@ public: void initTitleBar(); //初始化菜单 void initToolBar(); //初始化工具栏 + void initPluginTool(); //初始化插件QAction void initProjectView(); //初始化左侧工程区 void initWorkSpaceView(); //初始化工作区 void dockLayout(); //停靠 @@ -95,6 +96,8 @@ public slots: void s_ShowWave(QString strSlfName, QString strName); //波列数据查看 void s_WelllogInformation(QString strSlfName);//编辑测井信息 + void slot_PluginActionFunc(); + //插件消息 void s_PluginMsg(QString msg); From 40d908dbaa0dcd7bc1cae8837b2b55ad3a2c78d7 Mon Sep 17 00:00:00 2001 From: zhaolei <353719554@qq.com> Date: Mon, 23 Mar 2026 11:52:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=89=E5=9B=BE=E4=B8=80=E8=A1=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E9=87=8D=E6=96=B0=E7=BC=96=E8=AF=91DrawBase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CallManage/CallManage.h | 4 + DrawBase/include/DrawBase.h | 2 +- logPlus/PropertyWidget.cpp | 166 ++++----- logPlus/formdraw.cpp | 706 +++++++++++++++++++++++++++++++++++- logPlus/formdraw.h | 8 +- logPlus/forminfo.cpp | 195 +++++++--- logPlus/forminfo.h | 34 +- logPlus/formline.cpp | 14 +- logPlus/formline.h | 1 + 9 files changed, 953 insertions(+), 177 deletions(-) diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 68f10e3..2ba75a1 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -127,6 +127,10 @@ signals: //绘制对称曲线 void sig_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry); + //斜井三图一表 + void sig_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, + QObject *pTvd); + //斜井三图一表 void sig_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strGroup, QString strProperty, QVariant variant); diff --git a/DrawBase/include/DrawBase.h b/DrawBase/include/DrawBase.h index b50734c..64044e5 100644 --- a/DrawBase/include/DrawBase.h +++ b/DrawBase/include/DrawBase.h @@ -60,7 +60,7 @@ struct DRAWBASE_EXPORT WaveMessage ColorMessage m_ColorMessage; }; -class DRAWBASE_EXPORT CDrawBase/*:public CQtWellLogTrackNode*/ +class DRAWBASE_EXPORT CDrawBase : public QObject/*:public CQtWellLogTrackNode*/ { // Q_OBJECT public: diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index f8dd51d..ec86c0c 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -694,8 +694,6 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant return; } - - } } } @@ -3117,117 +3115,121 @@ void PropertyWidget::initGeoLithProperty(FormInfo *formInfo) // 斜井三图一表属性 void PropertyWidget::initTvdProperty(FormInfo *formInfo) { + if (!formInfo->m_pTvd) + return; _CreateVariantPropertyItem("通常", "选择井斜数据", m_strSlfName, QVariant::String); _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); _CreateVariantPropertyItem("通常", "显示井名", formInfo->m_strWellName, QVariant::String); - _CreateVariantPropertyItem("绘制图形对象", "靶心", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "靶心参数表", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "井斜数据表", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "俯视图", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "侧视图深度在左边", false, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "侧视图(水平位移)", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "侧视图(向东)", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "侧视图(向北)", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "侧视图(侧视角)", false, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "立体轨迹图", true, QVariant::Bool); - _CreateVariantPropertyItem("绘制图形对象", "绘制标注信息", true, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "靶心", formInfo->m_pTvd->objViewInfo->m_IsDrawBX, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "靶心参数表", formInfo->m_pTvd->objViewInfo->m_IsDrawBxcs, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "井斜数据表", formInfo->m_pTvd->objViewInfo->m_IsDrawTable, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "俯视图", formInfo->m_pTvd->objViewInfo->m_IsDrawFst, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图深度在左边", formInfo->m_pTvd->objViewInfo->m_DepthLeft, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(水平位移)", formInfo->m_pTvd->objViewInfo->m_IsDrawCst1, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(向东)", formInfo->m_pTvd->objViewInfo->m_IsDrawCst2, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(向北)", formInfo->m_pTvd->objViewInfo->m_IsDrawCst3, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "侧视图(侧视角)", formInfo->m_pTvd->objViewInfo->m_IsDrawCst, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "立体轨迹图", formInfo->m_pTvd->objViewInfo->m_IsDrawLtgjt, QVariant::Bool); + _CreateVariantPropertyItem("绘制图形对象", "绘制标注信息", formInfo->m_pTvd->objViewInfo->m_isDrawNote, QVariant::Bool); - _CreateVariantPropertyItem("边框线型", "线宽", 3, QVariant::Int); - _CreateVariantPropertyItem("边框线型", "颜色", QColor(0, 0, 0), QVariant::Color); - _CreateVariantPropertyItem("格线线型", "线宽", 3, QVariant::Int); - _CreateVariantPropertyItem("格线线型", "颜色", QColor(127, 127, 127), QVariant::Color); - _CreateVariantPropertyItem("轨迹线型", "线宽", 3, QVariant::Int); - _CreateVariantPropertyItem("轨迹线型", "颜色", QColor(0, 0, 0), QVariant::Color); - _CreateVariantPropertyItem("靶心半径线型", "线宽", 3, QVariant::Int); - _CreateVariantPropertyItem("靶心半径线型", "颜色", QColor(255, 0, 0), QVariant::Color); - _CreateVariantPropertyItem("靶心连线线型", "线宽", 3, QVariant::Int); - _CreateVariantPropertyItem("靶心连线线型", "颜色", QColor(255, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("边框线型", "线宽", formInfo->m_pTvd->m_FrameWidth, QVariant::Int); + _CreateVariantPropertyItem("边框线型", "颜色", formInfo->m_pTvd->m_FrameColor, QVariant::Color); + _CreateVariantPropertyItem("格线线型", "线宽", formInfo->m_pTvd->m_GridWidth, QVariant::Int); + _CreateVariantPropertyItem("格线线型", "颜色", formInfo->m_pTvd->m_GridColor, QVariant::Color); + _CreateVariantPropertyItem("轨迹线型", "线宽", formInfo->m_pTvd->m_GuijiWidth, QVariant::Int); + _CreateVariantPropertyItem("轨迹线型", "颜色", formInfo->m_pTvd->m_GuijiColor, QVariant::Color); + _CreateVariantPropertyItem("靶心半径线型", "线宽", formInfo->m_pTvd->m_BxbjWidth, QVariant::Int); + _CreateVariantPropertyItem("靶心半径线型", "颜色", formInfo->m_pTvd->m_BxbjColor, QVariant::Color); + _CreateVariantPropertyItem("靶心连线线型", "线宽", formInfo->m_pTvd->m_BxlxWidth, QVariant::Int); + _CreateVariantPropertyItem("靶心连线线型", "颜色", formInfo->m_pTvd->m_BxlxColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "道头字体", QFont(), QVariant::Font); - _CreateVariantPropertyItem("字体", "道头颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("字体", "道头字体", formInfo->m_pTvd->objViewInfo->m_HeadFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "道头颜色", formInfo->m_pTvd->objViewInfo->m_HeadColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "标题字体", QFont(), QVariant::Font); - _CreateVariantPropertyItem("字体", "标题颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("字体", "标题字体", formInfo->m_pTvd->objViewInfo->m_TitleFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "标题颜色", formInfo->m_pTvd->objViewInfo->m_TitleColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "数据表字体", QFont(), QVariant::Font); - _CreateVariantPropertyItem("字体", "数据表颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("字体", "数据表字体", formInfo->m_pTvd->objViewInfo->m_TableFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "数据表颜色", formInfo->m_pTvd->objViewInfo->m_TableColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "刻度字体", QFont(), QVariant::Font); - _CreateVariantPropertyItem("字体", "刻度颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("字体", "刻度字体", formInfo->m_pTvd->objViewInfo->m_ScaleFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "刻度颜色", formInfo->m_pTvd->objViewInfo->m_ScaleColor, QVariant::Color); - _CreateVariantPropertyItem("字体", "注释字体", QFont(), QVariant::Font); - _CreateVariantPropertyItem("字体", "注释颜色", QColor(0, 0, 0), QVariant::Color); + _CreateVariantPropertyItem("字体", "注释字体", formInfo->m_pTvd->objViewInfo->m_NoteFont, QVariant::Font); + _CreateVariantPropertyItem("字体", "注释颜色", formInfo->m_pTvd->objViewInfo->m_NoteColor, QVariant::Color); - _CreateVariantPropertyItem("井斜数据表参数", "标题名", "井连续井斜仪测量数据表", QVariant::String); - _CreateVariantPropertyItem("井斜数据表参数", "头记录高度(cm)", 1.6, QVariant::Double); - _CreateVariantPropertyItem("井斜数据表参数", "数据记录高度(cm)", 0.8, QVariant::Double); + _CreateVariantPropertyItem("井斜数据表参数", "标题名", formInfo->m_pTvd->m_Title_table, QVariant::String); + _CreateVariantPropertyItem("井斜数据表参数", "头记录高度(cm)", formInfo->m_pTvd->objViewInfo->m_Head_Height, QVariant::Double); + _CreateVariantPropertyItem("井斜数据表参数", "数据记录高度(cm)", formInfo->m_pTvd->objViewInfo->m_Rec_Height, QVariant::Double); - _CreateVariantPropertyItem("俯视图参数", "标题名", "井井眼俯视图", QVariant::String); - _CreateVariantPropertyItem("俯视图参数", "东西位移最小刻度", -100, QVariant::Double); - _CreateVariantPropertyItem("俯视图参数", "东西位移最大刻度", 100, QVariant::Double); - _CreateVariantPropertyItem("俯视图参数", "南北位移最小刻度", -100, QVariant::Double); - _CreateVariantPropertyItem("俯视图参数", "南北位移最大刻度", 100, QVariant::Double); - _CreateVariantPropertyItem("俯视图参数", "是否绘制闭合线", false, QVariant::Bool); + _CreateVariantPropertyItem("俯视图参数", "标题名", formInfo->m_pTvd->objViewInfo->m_Title_fst, QVariant::String); + _CreateVariantPropertyItem("俯视图参数", "东西位移最小刻度", formInfo->m_pTvd->objViewInfo->m_MinXe, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "东西位移最大刻度", formInfo->m_pTvd->objViewInfo->m_MaxXe, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "南北位移最小刻度", formInfo->m_pTvd->objViewInfo->m_MinYn, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "南北位移最大刻度", formInfo->m_pTvd->objViewInfo->m_MaxYn, QVariant::Double); + _CreateVariantPropertyItem("俯视图参数", "是否绘制闭合线", formInfo->m_pTvd->objViewInfo->m_bPlotBhx, QVariant::Bool); - _CreateVariantPropertyItem("侧视图参数", "标题名", "井井眼侧视图", QVariant::String); - _CreateVariantPropertyItem("侧视图参数", "高宽相同", false, QVariant::Bool); + _CreateVariantPropertyItem("侧视图参数", "标题名", formInfo->m_pTvd->objViewInfo->m_Title_cst, QVariant::String); + _CreateVariantPropertyItem("侧视图参数", "高宽相同", formInfo->m_pTvd->objViewInfo->m_heqw, QVariant::Bool); - _CreateVariantPropertyItem("侧视图(水平位移)", "最大侧视位移(m)", 100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(水平位移)", "最小侧视位移(m)", -100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(水平位移)", "最大垂深(m)", 10000, QVariant::Double); - _CreateVariantPropertyItem("侧视图(水平位移)", "最小垂深(m)", 0, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最大侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MaxWy_HOFF, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最小侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MinWy_HOFF, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最大垂深(m)", formInfo->m_pTvd->objViewInfo->m_MaxTVD_HOFF, QVariant::Double); + _CreateVariantPropertyItem("侧视图(水平位移)", "最小垂深(m)", formInfo->m_pTvd->objViewInfo->m_MinTVD_HOFF, QVariant::Double); - _CreateVariantPropertyItem("侧视图(向东)", "最大侧视位移(m)", 100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(向东)", "最小侧视位移(m)", -100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(向东)", "最大垂深(m)", 10000, QVariant::Double); - _CreateVariantPropertyItem("侧视图(向东)", "最小垂深(m)", 0, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最大侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MaxWy_XE, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最小侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MinWy_XE, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最大垂深(m)", formInfo->m_pTvd->objViewInfo->m_MaxTVD_XE, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向东)", "最小垂深(m)", formInfo->m_pTvd->objViewInfo->m_MinTVD_XE, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "最大侧视位移(m)", 100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "最小侧视位移(m)", -100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "最大垂深(m)", 10000, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "最小垂深(m)", 0, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "深度间隔(m)", 100, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "等分个数(=0按深度间隔)", 0, QVariant::Double); - _CreateVariantPropertyItem("侧视图(侧视角)", "侧视角(度)", 90, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向北)", "最大侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MaxWy_YN, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向北)", "最小侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MinWy_YN, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向北)", "最大垂深(m)", formInfo->m_pTvd->objViewInfo->m_MaxTVD_YN, QVariant::Double); + _CreateVariantPropertyItem("侧视图(向北)", "最小垂深(m)", formInfo->m_pTvd->objViewInfo->m_MinTVD_YN, QVariant::Double); - // - _CreateVariantPropertyItem("立体轨迹图参数", "标题名", "", QVariant::String); - _CreateVariantPropertyItem("立体轨迹图参数", "最大位移(m)", 100, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "起始垂深(m)", 0, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "垂深间隔(m)", 100, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "是否绘制立体框", formInfo->m_is3DFrame, QVariant::Bool); - _CreateVariantPropertyItem("立体轨迹图参数", "俯视角(度)", 10, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "侧视角(度)", 45, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "倾斜角(度)", 0, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "竖线间隔", 5, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "俯视南北间隔数", 20, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "俯视东西间隔数", 20, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最大侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MaxWy, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最小侧视位移(m)", formInfo->m_pTvd->objViewInfo->m_MinWy, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最大垂深(m)", formInfo->m_pTvd->objViewInfo->m_MaxTVD, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "最小垂深(m)", formInfo->m_pTvd->objViewInfo->m_MinTVD, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "深度间隔(m)", formInfo->m_pTvd->objViewInfo->m_DepSpace, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "等分个数(=0按深度间隔)", formInfo->m_pTvd->objViewInfo->m_DepSpaceN, QVariant::Double); + _CreateVariantPropertyItem("侧视图(侧视角)", "侧视角(度)", formInfo->m_pTvd->objViewInfo->m_CsAngle, QVariant::Double); + + _CreateVariantPropertyItem("立体轨迹图参数", "标题名", formInfo->m_pTvd->m_Title_ltgj, QVariant::String); + _CreateVariantPropertyItem("立体轨迹图参数", "最大位移(m)", formInfo->m_pTvd->objViewInfo->m_MaxWy1, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "起始垂深(m)", formInfo->m_pTvd->objViewInfo->m_LTTTVD, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "垂深间隔(m)", formInfo->m_pTvd->objViewInfo->m_DepSpace1, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "是否绘制立体框", formInfo->m_pTvd->objViewInfo->m_is3DFrame, QVariant::Bool); + _CreateVariantPropertyItem("立体轨迹图参数", "俯视角(度)", formInfo->m_pTvd->objViewInfo->m_LttAngle_X, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "侧视角(度)", formInfo->m_pTvd->objViewInfo->m_LttAngle, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "倾斜角(度)", formInfo->m_pTvd->objViewInfo->m_LttAngle_Z, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "竖线间隔", formInfo->m_pTvd->objViewInfo->m_LTTTVD, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "俯视南北间隔数", formInfo->m_pTvd->objViewInfo->m_YD, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "俯视东西间隔数", formInfo->m_pTvd->objViewInfo->m_XD, QVariant::Double); QStringList listType; listType.append("NONE"); listType.append("狗腿度"); listType.append("井经"); listType.append("成像"); - _CreateEnumPropertyItem("立体轨迹图参数", "附加属性类型", listType.indexOf("NONE"), listType); - _CreateVariantPropertyItem("立体轨迹图参数", "选择井曲线1", "", QVariant::String); - _CreateVariantPropertyItem("立体轨迹图参数", "选择井曲线2", "", QVariant::String); - _CreateVariantPropertyItem("立体轨迹图参数", "调色板参数设置",0, QVariant::Int); - _CreateVariantPropertyItem("立体轨迹图参数", "直径放大系数", 1, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "波形基值", 0, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "波形最大值", 500, QVariant::Double); - _CreateVariantPropertyItem("立体轨迹图参数", "连续填充", false, QVariant::Bool); + _CreateEnumPropertyItem("立体轨迹图参数", "附加属性类型", formInfo->m_pTvd->objViewInfo->m_IsDrawProperty, listType); + _CreateVariantPropertyItem("立体轨迹图参数", "选择井曲线1", formInfo->m_pTvd->objViewInfo->m_CurveName1, QVariant::String); + _CreateVariantPropertyItem("立体轨迹图参数", "选择井曲线2", formInfo->m_pTvd->objViewInfo->m_CurveName2, QVariant::String); + _CreateVariantPropertyItem("立体轨迹图参数", "调色板参数设置",0, QVariant::Int);//formInfo->m_pTvd->objViewInfo->m_ColorTableIndex + _CreateVariantPropertyItem("立体轨迹图参数", "直径放大系数", formInfo->m_pTvd->objViewInfo->m_calscale, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "波形基值", formInfo->m_pTvd->objViewInfo->m_baseval, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "波形最大值", formInfo->m_pTvd->objViewInfo->m_maxval, QVariant::Double); + _CreateVariantPropertyItem("立体轨迹图参数", "连续填充", formInfo->m_pTvd->objViewInfo->m_isBlock, QVariant::Bool); _CreateVariantPropertyItem("立体闭合方位线型", "线宽", 1, QVariant::Int); _CreateVariantPropertyItem("立体闭合方位线型", "颜色", QColor(255, 0, 0), QVariant::Color); - _CreateVariantPropertyItem("绘图参数", "最小深度间隔(m)", 5, QVariant::Double); + _CreateVariantPropertyItem("绘图参数", "最小深度间隔(m)", formInfo->m_pTvd->objViewInfo->m_Rlev, QVariant::Double); _CreateVariantPropertyItem("立体闭合方位线型", "线宽", 3, QVariant::Int); _CreateVariantPropertyItem("立体闭合方位线型", "颜色", QColor(255, 0, 0), QVariant::Color); - - //当前属性类型 m_strCurrentProperty = Tvd_Property; } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 3b475b3..fee655d 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -325,6 +325,11 @@ void FormDraw::DisplayLines(QJsonArray linesArray) //套管组件 DisplayTubing_One(lineObjInfo); } + else if (strType == "SantuyibiaoObject") + { + // 斜井三图一表属性 + DisplayTvd_One(lineObjInfo); + } else { DisplayType_One(lineObjInfo); @@ -1009,6 +1014,695 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) } } +//斜井三图一表 +void FormDraw::DisplayTvd_One(QJsonObject lineObjInfo) +{ + QString strSlfName = ""; + QString strWellName = ""; + QString strLineName = ""; + QString strAliasName = "";//显示名称 + QFont curveNameFont("微软雅黑", 10); // 名称字体 + QColor lineColor = QColor(0, 0, 0);//颜色 + + if (lineObjInfo.contains("SlfName")) + { + QJsonValue value = lineObjInfo.value("SlfName"); + if (value.isString()) { + strSlfName = value.toString(); + //qDebug() << "SlfName:" << strSlfName; + + // + QString slffilename = QString(""); + int ind = strSlfName.lastIndexOf('\\'); + int ind2 = strSlfName.lastIndexOf('/'); + if (ind2 > ind) ind = ind2; + if (ind > -1) { + slffilename = strSlfName.mid(ind + 1); + strSlfName = slffilename; + } + } + } + if (lineObjInfo.contains("WellName")) + { + QJsonValue value = lineObjInfo.value("WellName"); + if (value.isString()) { + strWellName = value.toString(); + //qDebug() << "WellName:" << strWellName; + } + } + if (lineObjInfo.contains("LineName")) + { + QJsonValue value = lineObjInfo.value("LineName"); + if (value.isString()) { + strLineName = value.toString(); + //qDebug() << "LineName:" << strLineName; + } + } + if (lineObjInfo.contains("AliasName")) + { + QJsonValue value = lineObjInfo.value("AliasName"); + if (value.isString()) { + strAliasName = value.toString(); + //qDebug() << "strAliasName:" << strAliasName; + } + } + //字体 + if (lineObjInfo.contains("curveNameFont")) + { + QJsonValue value = lineObjInfo.value("curveNameFont"); + if (value.isString()) { + curveNameFont.fromString(value.toString()); + //qDebug() << "strUnit:" << strUnit; + } + } + // + if (lineObjInfo.contains("lineColor")) + { + lineColor.setNamedColor(lineObjInfo.value("lineColor").toString()); + } + QString folderPath = GetLogdataPath(); + folderPath = folderPath + g_prjname; + strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; + + if (strLineName != "") + { + FormLine* pFormL = this->s_addSantuyibiao(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0); + if (pFormL && pFormL->m_drawTvd) + { + GetTvdProperty(pFormL->m_drawTvd, lineObjInfo); + emit CallManage::getInstance()->sig_ChangeTvdProperty(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, "Santuyibiao", + (QObject *)(pFormL->m_drawTvd)); + } + } +} + +void FormDraw::GetTvdProperty(CDrawTvd *drawTvd, QJsonObject lineObjInfo) +{ + if (lineObjInfo.contains("AliasWellName")) // 通常-显示井名 + { + QJsonValue value = lineObjInfo.value("AliasWellName"); + if (value.isString()) { + drawTvd->m_AliasWellName = value.toString(); + } + } + + // 绘制图形对象 + if (lineObjInfo.contains("IsDrawBX")) // 绘制图形对象-靶心 + { + QJsonValue value = lineObjInfo.value("IsDrawBX"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawBX = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawBxcs")) // 绘制图形对象-靶心参数表 + { + QJsonValue value = lineObjInfo.value("IsDrawBxcs"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawBxcs = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawTable")) // 绘制图形对象-井斜数据表 + { + QJsonValue value = lineObjInfo.value("IsDrawTable"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawTable = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawFst")) // 绘制图形对象-俯视图 + { + QJsonValue value = lineObjInfo.value("IsDrawFst"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawFst = value.toBool(); + } + } + if (lineObjInfo.contains("DepthLeft")) // 绘制图形对象-侧视图深度在左边 + { + QJsonValue value = lineObjInfo.value("DepthLeft"); + if (value.isBool()) { + drawTvd->objViewInfo->m_DepthLeft = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawCst1")) // 绘制图形对象-侧视图(水平位移) + { + QJsonValue value = lineObjInfo.value("IsDrawCst1"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawCst1 = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawCst2")) // 绘制图形对象-侧视图(向东) + { + QJsonValue value = lineObjInfo.value("IsDrawCst2"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawCst2 = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawCst3")) // 绘制图形对象-侧视图(向北) + { + QJsonValue value = lineObjInfo.value("IsDrawCst3"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawCst3 = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawCst")) // 绘制图形对象-侧视图(侧视角) + { + QJsonValue value = lineObjInfo.value("IsDrawCst"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawCst = value.toBool(); + } + } + if (lineObjInfo.contains("IsDrawLtgjt")) // 绘制图形对象-立体轨迹图 + { + QJsonValue value = lineObjInfo.value("IsDrawLtgjt"); + if (value.isBool()) { + drawTvd->objViewInfo->m_IsDrawLtgjt = value.toBool(); + } + } + if (lineObjInfo.contains("isDrawNote")) // 绘制图形对象-绘制标注信息 + { + QJsonValue value = lineObjInfo.value("isDrawNote"); + if (value.isBool()) { + drawTvd->objViewInfo->m_isDrawNote = value.toBool(); + } + } + + // 边框线型 + if (lineObjInfo.contains("FrameWidth")) // 边框线型-线宽 + { + QJsonValue value = lineObjInfo.value("FrameWidth"); + if (value.isDouble()) { + drawTvd->m_FrameWidth = value.toInt(); + } + } + if (lineObjInfo.contains("FrameColor")) // 边框线型-颜色 + { + QJsonValue value = lineObjInfo.value("FrameColor"); + if (value.isString()) { + drawTvd->m_FrameColor.setNamedColor(value.toString()); + } + } + + // 格线线型 + if (lineObjInfo.contains("GridWidth")) // 格线线型-线宽 + { + QJsonValue value = lineObjInfo.value("GridWidth"); + if (value.isDouble()) { + drawTvd->m_GridWidth = value.toInt(); + } + } + if (lineObjInfo.contains("GridColor")) // 格线线型-颜色 + { + QJsonValue value = lineObjInfo.value("GridColor"); + if (value.isString()) { + drawTvd->m_GridColor.setNamedColor(value.toString()); + } + } + // 轨迹线型 + if (lineObjInfo.contains("GuijiWidth")) // 轨迹线型-线宽 + { + QJsonValue value = lineObjInfo.value("GuijiWidth"); + if (value.isDouble()) { + drawTvd->m_GuijiWidth = value.toInt(); + } + } + if (lineObjInfo.contains("GuijiColor")) // 轨迹线型-颜色 + { + QJsonValue value = lineObjInfo.value("GuijiColor"); + if (value.isString()) { + drawTvd->m_GuijiColor.setNamedColor(value.toString()); + } + } + // 靶心半径线型 + if (lineObjInfo.contains("BxbjWidth")) // 靶心半径线型-线宽 + { + QJsonValue value = lineObjInfo.value("BxbjWidth"); + if (value.isDouble()) { + drawTvd->m_BxbjWidth = value.toInt(); + } + } + if (lineObjInfo.contains("BxbjColor")) // 靶心半径线型-颜色 + { + QJsonValue value = lineObjInfo.value("BxbjColor"); + if (value.isString()) { + drawTvd->m_BxbjColor.setNamedColor(value.toString()); + } + } + // 靶心连线线型 + if (lineObjInfo.contains("BxlxWidth")) // 靶心连线线型-线宽 + { + QJsonValue value = lineObjInfo.value("BxlxWidth"); + if (value.isDouble()) { + drawTvd->m_BxlxWidth = value.toInt(); + } + } + if (lineObjInfo.contains("BxlxColor")) // 靶心连线线型-颜色 + { + QJsonValue value = lineObjInfo.value("BxlxColor"); + if (value.isString()) { + drawTvd->m_BxlxColor.setNamedColor(value.toString()); + } + } + // 字体 + if (lineObjInfo.contains("HeadFont")) // 字体-道头字体 + { + QJsonValue value = lineObjInfo.value("HeadFont"); + if (value.isString()) { + drawTvd->objViewInfo->m_HeadFont.fromString(value.toString()); + } + } + if (lineObjInfo.contains("HeadColor")) // 字体-道头颜色 + { + QJsonValue value = lineObjInfo.value("HeadColor"); + if (value.isString()) { + drawTvd->objViewInfo->m_HeadColor.setNamedColor(value.toString()); + } + } + if (lineObjInfo.contains("TitleFont")) // 字体-标题字体 + { + QJsonValue value = lineObjInfo.value("TitleFont"); + if (value.isString()) { + drawTvd->objViewInfo->m_TitleFont.fromString(value.toString()); + } + } + if (lineObjInfo.contains("TitleColor")) // 字体-标题颜色 + { + QJsonValue value = lineObjInfo.value("TitleColor"); + if (value.isString()) { + drawTvd->objViewInfo->m_TitleColor.setNamedColor(value.toString()); + } + } + if (lineObjInfo.contains("TableFont")) // 字体-数据表字体 + { + QJsonValue value = lineObjInfo.value("TableFont"); + if (value.isString()) { + drawTvd->objViewInfo->m_TableFont.fromString(value.toString()); + } + } + if (lineObjInfo.contains("TableColor")) // 字体-数据表颜色 + { + QJsonValue value = lineObjInfo.value("TableColor"); + if (value.isString()) { + drawTvd->objViewInfo->m_TableColor.setNamedColor(value.toString()); + } + } + if (lineObjInfo.contains("ScaleFont")) // 字体-刻度字体 + { + QJsonValue value = lineObjInfo.value("ScaleFont"); + if (value.isString()) { + drawTvd->objViewInfo->m_ScaleFont.fromString(value.toString()); + } + } + if (lineObjInfo.contains("ScaleColor")) // 字体-刻度颜色 + { + QJsonValue value = lineObjInfo.value("ScaleColor"); + if (value.isString()) { + drawTvd->objViewInfo->m_ScaleColor.setNamedColor(value.toString()); + } + } + if (lineObjInfo.contains("NoteFont")) // 字体-注释字体 + { + QJsonValue value = lineObjInfo.value("NoteFont"); + if (value.isString()) { + drawTvd->objViewInfo->m_NoteFont.fromString(value.toString()); + } + } + if (lineObjInfo.contains("NoteColor")) // 字体-注释颜色 + { + QJsonValue value = lineObjInfo.value("NoteColor"); + if (value.isString()) { + drawTvd->objViewInfo->m_NoteColor.setNamedColor(value.toString()); + } + } + // 井斜数据表参数 + if (lineObjInfo.contains("Title_table")) // 井斜数据表参数-标题名 + { + QJsonValue value = lineObjInfo.value("Title_table"); + if (value.isString()) { + drawTvd->m_Title_table = value.toString(); + } + } + if (lineObjInfo.contains("Head_Height")) // 井斜数据表参数-头记录高度(cm) + { + QJsonValue value = lineObjInfo.value("Head_Height"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_Head_Height = value.toDouble(); + } + } + if (lineObjInfo.contains("Rec_Height")) // 井斜数据表参数-数据记录高度(cm) + { + QJsonValue value = lineObjInfo.value("Rec_Height"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_Rec_Height = value.toDouble(); + } + } + // 俯视图参数 + if (lineObjInfo.contains("Title_fst")) // 俯视图参数-标题名 + { + QJsonValue value = lineObjInfo.value("Title_fst"); + if (value.isString()) { + drawTvd->objViewInfo->m_Title_fst = value.toString(); + } + } + if (lineObjInfo.contains("MinXe")) // 俯视图参数-东西位移最小刻度 + { + QJsonValue value = lineObjInfo.value("MinXe"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinXe = value.toDouble(); + } + } + if (lineObjInfo.contains("MaxXe")) // 俯视图参数-东西位移最大刻度 + { + QJsonValue value = lineObjInfo.value("MaxXe"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxXe = value.toDouble(); + } + } + if (lineObjInfo.contains("MinYn")) // 俯视图参数-南北位移最小刻度 + { + QJsonValue value = lineObjInfo.value("MinYn"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinYn = value.toDouble(); + } + } + if (lineObjInfo.contains("MaxYn")) // 俯视图参数-南北位移最大刻度 + { + QJsonValue value = lineObjInfo.value("MaxYn"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxYn = value.toDouble(); + } + } + if (lineObjInfo.contains("bPlotBhx")) // 俯视图参数-是否绘制闭合线 + { + QJsonValue value = lineObjInfo.value("bPlotBhx"); + if (value.isBool()) { + drawTvd->objViewInfo->m_bPlotBhx = value.toBool(); + } + } + + // 侧视图参数 + if (lineObjInfo.contains("Title_cst")) // 侧视图参数-标题名 + { + QJsonValue value = lineObjInfo.value("Title_cst"); + if (value.isString()) { + drawTvd->objViewInfo->m_Title_cst = value.toString(); + } + } + if (lineObjInfo.contains("heqw")) // 侧视图参数-高宽相同 + { + QJsonValue value = lineObjInfo.value("heqw"); + if (value.isBool()) { + drawTvd->objViewInfo->m_heqw = value.toBool(); + } + } + + // 侧视图(水平位移) + if (lineObjInfo.contains("MaxWy_HOFF")) // 侧视图(水平位移)-最大侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MaxWy_HOFF"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxWy_HOFF = value.toDouble(); + } + } + if (lineObjInfo.contains("MinWy_HOFF")) // 侧视图(水平位移)-最小侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MinWy_HOFF"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinWy_HOFF = value.toDouble(); + } + } + if (lineObjInfo.contains("MaxTVD_HOFF")) // 侧视图(水平位移)-最大垂深(m) + { + QJsonValue value = lineObjInfo.value("MaxTVD_HOFF"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxTVD_HOFF = value.toDouble(); + } + } + if (lineObjInfo.contains("MinTVD_HOFF")) // 侧视图(水平位移)-最小垂深(m) + { + QJsonValue value = lineObjInfo.value("MinTVD_HOFF"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinTVD_HOFF = value.toDouble(); + } + } + // 侧视图(向东) + if (lineObjInfo.contains("MaxWy_XE")) // 侧视图(向东)-最大侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MaxWy_XE"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxWy_XE = value.toDouble(); + } + } + if (lineObjInfo.contains("MinWy_XE")) // 侧视图(向东)-最小侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MinWy_XE"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinWy_XE = value.toDouble(); + } + } + if (lineObjInfo.contains("MaxTVD_XE")) // 侧视图(向东)-最大垂深(m) + { + QJsonValue value = lineObjInfo.value("MaxTVD_XE"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxTVD_XE = value.toDouble(); + } + } + if (lineObjInfo.contains("MinTVD_XE")) // 侧视图(向东)-最小垂深(m) + { + QJsonValue value = lineObjInfo.value("MinTVD_XE"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinTVD_XE = value.toDouble(); + } + } + // 侧视图(向北) + if (lineObjInfo.contains("MaxWy_YN")) // 侧视图(向北)-最大侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MaxWy_YN"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxWy_YN = value.toDouble(); + } + } + if (lineObjInfo.contains("MinWy_YN")) // 侧视图(向北)-最小侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MinWy_YN"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinWy_YN = value.toDouble(); + } + } + if (lineObjInfo.contains("MaxTVD_YN")) // 侧视图(向北)-最大垂深(m) + { + QJsonValue value = lineObjInfo.value("MaxTVD_YN"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxTVD_YN = value.toDouble(); + } + } + if (lineObjInfo.contains("MinTVD_YN")) // 侧视图(向北)-最小垂深(m) + { + QJsonValue value = lineObjInfo.value("MinTVD_YN"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinTVD_YN = value.toDouble(); + } + } + // 侧视图(侧视角) + if (lineObjInfo.contains("MaxWy")) // 侧视图(侧视角)-最大侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MaxWy"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxWy = value.toDouble(); + } + } + if (lineObjInfo.contains("MinWy")) // 侧视图(侧视角)-最小侧视位移(m) + { + QJsonValue value = lineObjInfo.value("MinWy"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinWy = value.toDouble(); + } + } + if (lineObjInfo.contains("MaxTVD")) // 侧视图(侧视角)-最大垂深(m) + { + QJsonValue value = lineObjInfo.value("MaxTVD"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxTVD = value.toDouble(); + } + } + if (lineObjInfo.contains("MinTVD")) // 侧视图(侧视角)-最小垂深(m) + { + QJsonValue value = lineObjInfo.value("MinTVD"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MinTVD = value.toDouble(); + } + } + if (lineObjInfo.contains("DepSpace")) // 侧视图(侧视角)-深度间隔(m) + { + QJsonValue value = lineObjInfo.value("DepSpace"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_DepSpace = value.toDouble(); + } + } + if (lineObjInfo.contains("DepSpaceN")) // 侧视图(侧视角)-等分个数(=0按深度间隔) + { + QJsonValue value = lineObjInfo.value("DepSpaceN"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_DepSpaceN = value.toDouble(); + } + } + if (lineObjInfo.contains("CsAngle")) // 侧视图(侧视角)-侧视角(度) + { + QJsonValue value = lineObjInfo.value("CsAngle"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_CsAngle = value.toDouble(); + } + } + // 立体轨迹图参数 + if (lineObjInfo.contains("Title_ltgj")) // 立体轨迹图参数-标题名 + { + QJsonValue value = lineObjInfo.value("Title_ltgj"); + if (value.isString()) { + drawTvd->m_Title_ltgj = value.toString(); + } + } + if (lineObjInfo.contains("MaxWy1")) // 立体轨迹图参数-最大位移(m) + { + QJsonValue value = lineObjInfo.value("MaxWy1"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_MaxWy1 = value.toDouble(); + } + } + if (lineObjInfo.contains("LTTTVD")) // 立体轨迹图参数-起始垂深(m) + { + QJsonValue value = lineObjInfo.value("LTTTVD"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_LTTTVD = value.toDouble(); + } + } + if (lineObjInfo.contains("DepSpace1")) // 立体轨迹图参数-垂深间隔(m) + { + QJsonValue value = lineObjInfo.value("DepSpace1"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_DepSpace1 = value.toDouble(); + } + } + if (lineObjInfo.contains("is3DFrame")) // 立体轨迹图参数-是否绘制立体框 + { + QJsonValue value = lineObjInfo.value("is3DFrame"); + if (value.isBool()) { + drawTvd->objViewInfo->m_is3DFrame = value.toBool(); + } + } + if (lineObjInfo.contains("LttAngle_X")) // 立体轨迹图参数-俯视角(度) + { + QJsonValue value = lineObjInfo.value("LttAngle_X"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_LttAngle_X = value.toDouble(); + } + } + if (lineObjInfo.contains("LttAngle")) // 立体轨迹图参数-侧视角(度) + { + QJsonValue value = lineObjInfo.value("LttAngle"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_LttAngle = value.toDouble(); + } + } + if (lineObjInfo.contains("LttAngle_Z")) // 立体轨迹图参数-倾斜角(度) + { + QJsonValue value = lineObjInfo.value("LttAngle_Z"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_LttAngle_Z = value.toDouble(); + } + } + if (lineObjInfo.contains("LTTTVD")) // 立体轨迹图参数-竖线间隔 + { + QJsonValue value = lineObjInfo.value("LTTTVD"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_LTTTVD = value.toDouble(); + } + } + if (lineObjInfo.contains("YD")) // 立体轨迹图参数-俯视南北间隔数 + { + QJsonValue value = lineObjInfo.value("YD"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_YD = value.toDouble(); + } + } + if (lineObjInfo.contains("XD")) // 立体轨迹图参数-俯视东西间隔数 + { + QJsonValue value = lineObjInfo.value("XD"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_XD = value.toDouble(); + } + } + if (lineObjInfo.contains("IsDrawProperty")) // 立体轨迹图参数-附加属性类型 + { + QJsonValue value = lineObjInfo.value("IsDrawProperty"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_IsDrawProperty = value.toInt(); + } + } + if (lineObjInfo.contains("CurveName1")) // 立体轨迹图参数-选择井曲线1 + { + QJsonValue value = lineObjInfo.value("CurveName1"); + if (value.isString()) { + drawTvd->objViewInfo->m_CurveName1 = value.toString(); + } + } + if (lineObjInfo.contains("CurveName2")) // 立体轨迹图参数-选择井曲线2 + { + QJsonValue value = lineObjInfo.value("CurveName2"); + if (value.isString()) { + drawTvd->objViewInfo->m_CurveName2 = value.toString(); + } + } + if (lineObjInfo.contains("ColorTableIndex")) // 立体轨迹图参数-调色板参数设置 + { + QJsonValue value = lineObjInfo.value("ColorTableIndex"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_ColorTableIndex = value.toInt(); + } + } + if (lineObjInfo.contains("calscale")) // 立体轨迹图参数-直径放大系数 + { + QJsonValue value = lineObjInfo.value("calscale"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_calscale = value.toDouble(); + } + } + if (lineObjInfo.contains("baseval")) // 立体轨迹图参数-波形基值 + { + QJsonValue value = lineObjInfo.value("baseval"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_baseval = value.toDouble(); + } + } + if (lineObjInfo.contains("maxval")) // 立体轨迹图参数-波形最大值 + { + QJsonValue value = lineObjInfo.value("maxval"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_maxval = value.toDouble(); + } + } + if (lineObjInfo.contains("isBlock")) // 立体轨迹图参数-连续填充 + { + QJsonValue value = lineObjInfo.value("isBlock"); + if (value.isBool()) { + drawTvd->objViewInfo->m_isBlock = value.toBool(); + } + } + // 立体闭合方位线型 + // rootObj["linewidth"] = m_pTvd->objViewInfo->m_linewidth; // 立体闭合方位线型-线宽 + // rootObj["linecolor"] = m_pTvd->objViewInfo->m_linecolor; // 立体闭合方位线型-颜色 + + // 立体轨迹图参数 + if (lineObjInfo.contains("Rlev")) // 侧视图(侧视角)-最小深度间隔(m) + { + QJsonValue value = lineObjInfo.value("Rlev"); + if (value.isDouble()) { + drawTvd->objViewInfo->m_Rlev = value.toDouble(); + } + } + + // 立体井径线型 + // rootObj["linewidth"] = m_pTvd->objViewInfo->m_linewidth; // 立体井径线型-线宽 + // rootObj["linecolor"] = m_pTvd->objViewInfo->m_linecolor; // 立体井径线型-颜色 +} + void FormDraw::DisplayLine_One(QJsonObject lineObjInfo) { QString strSlfName = ""; @@ -2608,7 +3302,7 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe } //斜井三图一表 -void FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW) +FormLine* FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW) { //井名&道名不一致 if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) @@ -2616,13 +3310,13 @@ void FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QString str } else { - return; + return NULL; } if(m_listTableName.contains(strLineName)) { qDebug() << "FormDraw strLineName already exist! " << strLineName; - return; + return NULL; } // FormLine *curv = new FormLine(this, strSlfName, strWellName, strTrackName, strLineName); @@ -2663,8 +3357,10 @@ void FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QString str double width=2; QString strScaleType = ""; //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, _nSamples, 0, strScaleType, "SantuyibiaoObject"); - + m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, _nSamples, 0, strScaleType, "SantuyibiaoObject"); + emit CallManage::getInstance()->sig_ChangeTvdProperty(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, "Santuyibiao", + (QObject *)(curv->m_drawTvd)); + return curv; } //裂痕 diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index dd9d363..6bac1bf 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -9,6 +9,7 @@ #include "formtrack.h" #include "LogIO.h" #include "MemRdWt.h" +#include "FormLine.h" #pragma execution_character_set("utf-8") @@ -72,6 +73,11 @@ public: //套管組件 void DisplayTubing_One(QJsonObject lineObjInfo); + //斜井三图一表 + void DisplayTvd_One(QJsonObject lineObjInfo); + //获取斜井三图一表属性 + void GetTvdProperty(CDrawTvd *drawTvd, QJsonObject lineObjInfo); + // 跨道设置 void crossTrackSetting(); @@ -252,7 +258,7 @@ public slots: //图像 成像 void s_addDrawImage(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); //斜井三图一表 - void s_addSantuyibiao(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); + FormLine* s_addSantuyibiao(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); //裂缝 void s_addCrack(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index f8bc4f0..b046825 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -20,6 +20,7 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt // setAcceptDrops(true); + m_pTvd = NULL; m_strSlfName = strSlfName; m_strWellName = strWellName; m_strTrackName = strTrackName; @@ -64,8 +65,8 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawSymmetry(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawSymmetry(QString, QString, QString, QString, QString, bool))); //斜井三图一表 - connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)), - this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant))); + connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QObject *)), + this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QObject *))); //岩性填充-不填充 connect(CallManage::getInstance(), SIGNAL(sig_ClearFillMode(QString, QString, QString, QString, QString)), this, SLOT(s_ClearFillMode(QString, QString, QString, QString, QString))); @@ -249,10 +250,135 @@ QJsonObject FormInfo::makeJson() rootObj["SchemeIndex"] = m_nSchemeIndex; rootObj["ColorNum"] = m_nColorNum; } + else if(m_strType == "SantuyibiaoObject") + { + makeTvdJson(rootObj); + } return rootObj; } +void FormInfo::makeTvdJson(QJsonObject& rootObj) +{ + if(!m_pTvd) + { + return; + } + + rootObj["AliasWellName"] = m_pTvd->m_AliasWellName;;// 通常-显示井名 + + // 绘制图形对象 + rootObj["IsDrawBX"] = m_pTvd->objViewInfo->m_IsDrawBX; // 绘制图形对象-靶心 + rootObj["IsDrawBxcs"] = m_pTvd->objViewInfo->m_IsDrawBxcs; // 绘制图形对象-靶心参数表 + rootObj["IsDrawTable"] = m_pTvd->objViewInfo->m_IsDrawTable; // 绘制图形对象-井斜数据表 + rootObj["IsDrawFst"] = m_pTvd->objViewInfo->m_IsDrawFst; // 绘制图形对象-俯视图 + rootObj["DepthLeft"] = m_pTvd->objViewInfo->m_DepthLeft; // 绘制图形对象-侧视图深度在左边 + rootObj["IsDrawCst1"] = m_pTvd->objViewInfo->m_IsDrawCst1; // 绘制图形对象-侧视图(水平位移) + rootObj["IsDrawCst2"] = m_pTvd->objViewInfo->m_IsDrawCst2; // 绘制图形对象-侧视图(向东) + rootObj["IsDrawCst3"] = m_pTvd->objViewInfo->m_IsDrawCst3; // 绘制图形对象-侧视图(向北) + rootObj["IsDrawCst"] = m_pTvd->objViewInfo->m_IsDrawCst; // 绘制图形对象-侧视图(侧视角) + rootObj["IsDrawLtgjt"] = m_pTvd->objViewInfo->m_IsDrawLtgjt; // 绘制图形对象-立体轨迹图 + rootObj["isDrawNote"] = m_pTvd->objViewInfo->m_isDrawNote; // 绘制图形对象-绘制标注信息 + + // 边框线型 + rootObj["FrameWidth"] = m_pTvd->m_FrameWidth; // 边框线型-线宽 + rootObj["FrameColor"] = m_pTvd->m_FrameColor.name(); // 边框线型-颜色 + // 格线线型 + rootObj["GridWidth"] = m_pTvd->m_GridWidth; // 格线线型-线宽 + rootObj["GridColor"] = m_pTvd->m_GridColor.name();// 格线线型-颜色 + // 轨迹线型 + rootObj["GuijiWidth"] = m_pTvd->m_GuijiWidth;// 轨迹线型-线宽 + rootObj["GuijiColor"] = m_pTvd->m_GuijiColor.name();// 轨迹线型-颜色 + // 靶心半径线型 + rootObj["BxbjWidth"] = m_pTvd->m_BxbjWidth; // 靶心半径线型-线宽 + rootObj["BxbjColor"] = m_pTvd->m_BxbjColor.name(); // 靶心半径线型-颜色 + // 靶心连线线型 + rootObj["BxlxWidth"] = m_pTvd->m_BxlxWidth; // 靶心连线线型-线宽 + rootObj["BxlxColor"] = m_pTvd->m_BxlxColor.name(); // 靶心连线线型-颜色 + // 字体 + rootObj["HeadFont"] = m_pTvd->objViewInfo->m_HeadFont.toString(); // 字体-道头字体 + rootObj["HeadColor"] = m_pTvd->objViewInfo->m_HeadColor.name(); // 字体-道头颜色 + rootObj["TitleFont"] = m_pTvd->objViewInfo->m_TitleFont.toString(); // 字体-标题字体 + rootObj["TitleColor"] = m_pTvd->objViewInfo->m_TitleColor.name(); // 字体-标题颜色 + rootObj["TableFont"] = m_pTvd->objViewInfo->m_TableFont.toString(); // 字体-数据表字体 + rootObj["TableColor"] = m_pTvd->objViewInfo->m_TableColor.name(); // 字体-数据表颜色 + rootObj["ScaleFont"] = m_pTvd->objViewInfo->m_ScaleFont.toString(); // 字体-刻度字体 + rootObj["ScaleColor"] = m_pTvd->objViewInfo->m_ScaleColor.name(); // 字体-刻度颜色 + rootObj["NoteFont"] = m_pTvd->objViewInfo->m_NoteFont.toString(); // 字体-注释字体 + rootObj["NoteColor"] = m_pTvd->objViewInfo->m_NoteColor.name(); // 字体-注释颜色 + // 井斜数据表参数 + rootObj["Title_table"] = m_pTvd->m_Title_table;// 井斜数据表参数-标题名 + rootObj["Head_Height"] = m_pTvd->objViewInfo->m_Head_Height;// 井斜数据表参数-头记录高度(cm) + rootObj["Rec_Height"] = m_pTvd->objViewInfo->m_Rec_Height;// 井斜数据表参数-数据记录高度(cm) + // 俯视图参数 + rootObj["Title_fst"] = m_pTvd->objViewInfo->m_Title_fst;// 俯视图参数-标题名 + rootObj["MinXe"] = m_pTvd->objViewInfo->m_MinXe; // 俯视图参数-东西位移最小刻度 + rootObj["MaxXe"] = m_pTvd->objViewInfo->m_MaxXe; // 俯视图参数-东西位移最大刻度 + rootObj["MinYn"] = m_pTvd->objViewInfo->m_MinYn; // 俯视图参数-南北位移最小刻度 + rootObj["MaxYn"] = m_pTvd->objViewInfo->m_MaxYn; // 俯视图参数-南北位移最大刻度 + rootObj["bPlotBhx"] = m_pTvd->objViewInfo->m_bPlotBhx; // 俯视图参数-是否绘制闭合线 + + // 侧视图参数 + rootObj["Title_cst"] = m_pTvd->objViewInfo->m_Title_cst; // 侧视图参数-标题名 + rootObj["heqw"] = m_pTvd->objViewInfo->m_heqw; // 侧视图参数-高宽相同 + + // 侧视图(水平位移) + rootObj["MaxWy_HOFF"] = m_pTvd->objViewInfo->m_MaxWy_HOFF; // 侧视图(水平位移)-最大侧视位移(m) + rootObj["MinWy_HOFF"] = m_pTvd->objViewInfo->m_MinWy_HOFF; // 侧视图(水平位移)-最小侧视位移(m) + rootObj["MaxTVD_HOFF"] = m_pTvd->objViewInfo->m_MaxTVD_HOFF;// 侧视图(水平位移)-最大垂深(m) + rootObj["MinTVD_HOFF"] = m_pTvd->objViewInfo->m_MinTVD_HOFF;// 侧视图(水平位移)-最小垂深(m) + // 侧视图(向东) + rootObj["MaxWy_XE"] = m_pTvd->objViewInfo->m_MaxWy_XE; // 侧视图(向东)-最大侧视位移(m) + rootObj["MinWy_XE"] = m_pTvd->objViewInfo->m_MinWy_XE; // 侧视图(向东)-最小侧视位移(m) + rootObj["MaxTVD_XE"] = m_pTvd->objViewInfo->m_MaxTVD_XE; // 侧视图(向东)-最大垂深(m) + rootObj["MinTVD_XE"] = m_pTvd->objViewInfo->m_MinTVD_XE; // 侧视图(向东)-最小垂深(m) + // 侧视图(向北) + rootObj["MaxWy_YN"] = m_pTvd->objViewInfo->m_MaxWy_YN; // 侧视图(向北)-最大侧视位移(m) + rootObj["MinWy_YN"] = m_pTvd->objViewInfo->m_MinWy_YN; // 侧视图(向北)-最小侧视位移(m) + rootObj["MaxTVD_YN"] = m_pTvd->objViewInfo->m_MaxTVD_YN; // 侧视图(向北)-最大垂深(m) + rootObj["MinTVD_YN"] = m_pTvd->objViewInfo->m_MinTVD_YN; // 侧视图(向北)-最小垂深(m) + // 侧视图(侧视角) + rootObj["MaxWy"] = m_pTvd->objViewInfo->m_MaxWy; // 侧视图(侧视角)-最大侧视位移(m) + rootObj["MinWy"] = m_pTvd->objViewInfo->m_MinWy; // 侧视图(侧视角)-最小侧视位移(m) + rootObj["MaxTVD"] = m_pTvd->objViewInfo->m_MaxTVD; // 侧视图(侧视角)-最大垂深(m) + rootObj["MinTVD"] = m_pTvd->objViewInfo->m_MinTVD; // 侧视图(侧视角)-最小垂深(m) + rootObj["DepSpace"] = m_pTvd->objViewInfo->m_DepSpace; // 侧视图(侧视角)-深度间隔(m) + rootObj["DepSpaceN"] = m_pTvd->objViewInfo->m_DepSpaceN; // 侧视图(侧视角)-等分个数(=0按深度间隔) + rootObj["CsAngle"] = m_pTvd->objViewInfo->m_CsAngle; // 侧视图(侧视角)-侧视角(度) + + // 立体轨迹图参数 + rootObj["Title_ltgj"] = m_pTvd->m_Title_ltgj; // 立体轨迹图参数-标题名 + rootObj["MaxWy1"] = m_pTvd->objViewInfo->m_MaxWy1; // 立体轨迹图参数-最大位移(m) + rootObj["LTTTVD"] = m_pTvd->objViewInfo->m_LTTTVD; // 立体轨迹图参数-起始垂深(m) + rootObj["DepSpace1"] = m_pTvd->objViewInfo->m_DepSpace1; // 立体轨迹图参数-垂深间隔(m) + rootObj["is3DFrame"] = m_pTvd->objViewInfo->m_is3DFrame; // 立体轨迹图参数-是否绘制立体框 + rootObj["LttAngle_X"] = m_pTvd->objViewInfo->m_LttAngle_X; // 立体轨迹图参数-俯视角(度) + rootObj["LttAngle"] = m_pTvd->objViewInfo->m_LttAngle; // 立体轨迹图参数-侧视角(度) + rootObj["LttAngle_Z"] = m_pTvd->objViewInfo->m_LttAngle_Z; // 立体轨迹图参数-倾斜角(度) + rootObj["LTTTVD"] = m_pTvd->objViewInfo->m_LTTTVD; // 立体轨迹图参数-竖线间隔 + rootObj["YD"] = m_pTvd->objViewInfo->m_YD; // 立体轨迹图参数-俯视南北间隔数 + rootObj["XD"] = m_pTvd->objViewInfo->m_XD; // 立体轨迹图参数-俯视东西间隔数 + rootObj["IsDrawProperty"] = m_pTvd->objViewInfo->m_IsDrawProperty; // 立体轨迹图参数-附加属性类型 + rootObj["CurveName1"] = m_pTvd->objViewInfo->m_CurveName1; // 立体轨迹图参数-选择井曲线1 + rootObj["CurveName2"] = m_pTvd->objViewInfo->m_CurveName2; // 立体轨迹图参数-选择井曲线2 + rootObj["ColorTableIndex"] = m_pTvd->objViewInfo->m_ColorTableIndex; // 立体轨迹图参数-调色板参数设置 + rootObj["calscale"] = m_pTvd->objViewInfo->m_calscale; // 立体轨迹图参数-直径放大系数 + rootObj["baseval"] = m_pTvd->objViewInfo->m_baseval; // 立体轨迹图参数-波形基值 + rootObj["maxval"] = m_pTvd->objViewInfo->m_maxval; // 立体轨迹图参数-波形最大值 + rootObj["isBlock"] = m_pTvd->objViewInfo->m_isBlock; // 立体轨迹图参数-连续填充 + + // 立体闭合方位线型 + // rootObj["linewidth"] = m_pTvd->objViewInfo->m_linewidth; // 立体闭合方位线型-线宽 + // rootObj["linecolor"] = m_pTvd->objViewInfo->m_linecolor; // 立体闭合方位线型-颜色 + + // 立体轨迹图参数 + rootObj["Rlev"] = m_pTvd->objViewInfo->m_Rlev; // 立体轨迹图参数-最小深度间隔(m) + + // 立体井径线型 + // rootObj["linewidth"] = m_pTvd->objViewInfo->m_linewidth; // 立体井径线型-线宽 + // rootObj["linecolor"] = m_pTvd->objViewInfo->m_linecolor; // 立体井径线型-颜色 +} + void FormInfo::paintEvent(QPaintEvent* event) { QPainter painter(this); @@ -981,62 +1107,19 @@ void FormInfo::s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString } void FormInfo::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - QString strGroup, QString strProperty, QVariant variant) + QObject *pTvd) { - if("井斜数据表参数" == strGroup) + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) { - if("标题名" == strProperty) - m_Title_table = variant.value(); - else if("头记录高度(cm)" == strProperty) - m_Head_Height = variant.value(); - else if("数据记录高度(cm)" == strProperty) - m_Rec_Height = variant.value(); - } - else if("立体轨迹图参数" == strGroup) - { - if("标题名" == strProperty) - m_Title_ltgj = variant.value(); - else if("最大位移(m)" == strProperty) - m_MaxWy1 = variant.value(); - else if("起始垂深(m)" == strProperty) - m_LTTTVD = variant.value(); - else if("垂深间隔(m)" == strProperty) - m_DepSpace1 = variant.value(); - else if("是否绘制立体框" == strProperty) - m_is3DFrame = variant.value(); - else if("俯视角(度)" == strProperty) - m_LttAngle_X = variant.value(); - else if("侧视角(度)" == strProperty) - m_LttAngle = variant.value(); - else if("倾斜角(度)" == strProperty) - m_LttAngle_Z = variant.value(); - else if("竖线间隔" == strProperty) - m_LTTTVD = variant.value(); - else if("俯视南北间隔数" == strProperty) - m_YD = variant.value(); - else if("俯视东西间隔数" == strProperty) - m_XD = variant.value(); - else if("附加属性类型" == strProperty) - m_IsDrawProperty = variant.value(); - else if("选择井曲线1" == strProperty) - m_CurveName1 = variant.value(); - else if("选择井曲线2" == strProperty) - m_CurveName2 = variant.value(); - else if("调色板参数设置" == strProperty) - m_ColorTableIndex = variant.value(); - else if("直径放大系数" == strProperty) - m_calscale = variant.value(); - else if("波形基值" == strProperty) - m_baseval = variant.value(); - else if("波形最大值" == strProperty) - m_maxval = variant.value(); - else if("连续填充" == strProperty) - m_isBlock = variant.value(); - } - else if("立体轨迹图参数" == strGroup) - { - if("最小深度间隔(m)" == strProperty) - m_Rlev = variant.value(); + m_pTvd = dynamic_cast(pTvd); + if (m_pTvd) + { + m_pTvd->m_AliasWellName = m_strWellName; + } } } diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index e1663d6..963ec01 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -8,6 +8,7 @@ #include #include #include +#include "DrawTvd.h" #pragma execution_character_set("utf-8") @@ -58,10 +59,9 @@ public slots: void s_ChangeDrawPoint(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawPoint); //绘制对称曲线 void s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry); - //斜井三图一表 void s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - QString strGroup, QString strProperty, QVariant variant); + QObject *pTvd); //岩性填充-不填充 void s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); @@ -192,35 +192,8 @@ public: float m_inD_Tubing = 121.36; //套管内径 float m_OutD_Tubing = 139.7; //套管外径 - //tvd //斜井三图一表(井斜数据表参数) - QString m_Title_table; - float m_Head_Height; - float m_Rec_Height; - //斜井三图一表(立体轨迹图参数) - QString m_Title_ltgj; - double m_MaxWy1; - double m_LTTTVD; - double m_DepSpace1; - double m_LttAngle; - double m_LttAngle_X; - double m_LttAngle_Z; - bool m_is3DFrame; - double m_LttxDela; - - double m_XD; - double m_YD; - int m_IsDrawProperty; - QString m_CurveName1; - QString m_CurveName2; - - int m_ColorTableIndex; - double m_calscale; - double m_baseval; - double m_maxval; - double m_Rlev; - bool m_isBlock; - //tvd + CDrawTvd *m_pTvd; // 深度 // ---------------- 基础配置 ---------------- @@ -265,6 +238,7 @@ public: int getFillTypeIndex(); QJsonObject makeJson(); + void makeTvdJson(QJsonObject& rootObj); //右键菜单响应函数 virtual void contextMenuEvent(QContextMenuEvent *event); diff --git a/logPlus/formline.cpp b/logPlus/formline.cpp index b000dad..f3c7214 100644 --- a/logPlus/formline.cpp +++ b/logPlus/formline.cpp @@ -16,7 +16,8 @@ FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QSt m_strTrackName = strTrackName; m_strLineName = strLineName; - m_drawTvd = NULL; + m_drawTvd = new CDrawTvd(); + m_parent = parent; //斜井三图一表 connect(CallManage::getInstance(), SIGNAL(sig_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant)), this, SLOT(s_ChangeTvdProperty(QString, QString, QString, QString, QString, QString, QString, QVariant))); @@ -45,6 +46,7 @@ void FormLine::paintEvent(QPaintEvent*) // QPainter painter(this); QRect rect = this->rect(); + // QRect rect = m_parent->rect(); //背景透明 painter.fillRect(rect.left(), rect.top(), rect.width(), rect.height(), QColor(0, 0, 0, 0)); //QColor(67, 67, 67, 100) @@ -75,6 +77,14 @@ void FormLine::paintEvent(QPaintEvent*) void FormLine::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strGroup, QString strProperty, QVariant variant) { + if(m_strUuid != strUuid || + m_strSlfName != strSlfName || + m_strWellName != strWellName || + m_strTrackName != strTrackName || + m_strLineName != strLineName) + { + return; + } if("通常" == strGroup) { // if("选择井斜数据" == strProperty) @@ -192,7 +202,7 @@ void FormLine::s_ChangeTvdProperty(QString strUuid, QString strSlfName, QString else if("立体轨迹图参数" == strGroup) { if("标题名" == strProperty) - m_drawTvd->objViewInfo->m_Title_ltgj = variant.value(); + m_drawTvd->m_Title_ltgj = variant.value(); else if("最大位移(m)" == strProperty) m_drawTvd->objViewInfo->m_MaxWy1 = variant.value(); else if("起始垂深(m)" == strProperty) diff --git a/logPlus/formline.h b/logPlus/formline.h index ceb0c7e..add65db 100644 --- a/logPlus/formline.h +++ b/logPlus/formline.h @@ -30,6 +30,7 @@ public: QString m_strTrackName; QString m_strLineName; CDrawTvd *m_drawTvd; + QWidget *m_parent; public: void DrawTvd(); From 252e44d046a011e2a3b5437ee64d23c869353067 Mon Sep 17 00:00:00 2001 From: jiayulong Date: Mon, 23 Mar 2026 17:46:26 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.=E5=A5=97=E7=AE=A1=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E4=E4=B8=AA=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84=E3=80=82?= =?UTF-8?q?=202.=E5=B7=A5=E5=85=B7=E6=A0=8F=EF=BC=8C=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E2=80=9C=E9=80=89=E6=8B=A9=E4=BA=95=E2=80=9D=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E6=96=B0=E5=BB=BA=E5=A4=9A=E4=BA=95?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugin/PluginUnit/PluginUnit.pro | 4 +- Slfio/src/commonutils.cpp | 17 +- logPlus/logPlus.pro | 5 +- logPlus/mainwindowcurve.cpp | 86 ++++++++- logPlus/mainwindowcurve.h | 3 +- logPlus/qmycustomplot.cpp | 301 ++++++++++++++++++++++++++++++- logPlus/qmycustomplot.h | 7 +- logPlus/selectwelldialog.cpp | 74 ++++++++ logPlus/selectwelldialog.h | 30 +++ logPlus/selectwelldialog.ui | 70 +++++++ 10 files changed, 572 insertions(+), 25 deletions(-) create mode 100644 logPlus/selectwelldialog.cpp create mode 100644 logPlus/selectwelldialog.h create mode 100644 logPlus/selectwelldialog.ui diff --git a/Plugin/PluginUnit/PluginUnit.pro b/Plugin/PluginUnit/PluginUnit.pro index cc08823..da58604 100644 --- a/Plugin/PluginUnit/PluginUnit.pro +++ b/Plugin/PluginUnit/PluginUnit.pro @@ -39,11 +39,11 @@ CONFIG(debug, debug|release){ LIBS += -L$$PWD/../../Bin/ -lCallPlugind -lHPluginManaged -lslfiod } else { TARGET = PluginUnit - DESTDIR = $$PWD/../../Bin/customPlugin + DESTDIR = $$PWD/../../BinR/customPlugin MOC_DIR = ../tmp/PluginUnit UI_DIR = ../tmp/PluginUnit OBJECTS_DIR = ../tmp/PluginUnit - LIBS += -L$$PWD/../../Bin/ -lCallPlugin -lHPluginManage -lslfio + LIBS += -L$$PWD/../../BinR/ -lCallPlugin -lHPluginManage -lslfio } RESOURCES += \ diff --git a/Slfio/src/commonutils.cpp b/Slfio/src/commonutils.cpp index e7f9993..6fb5a5c 100644 --- a/Slfio/src/commonutils.cpp +++ b/Slfio/src/commonutils.cpp @@ -144,22 +144,23 @@ bool CCommonUtils::getAllSlf(QString prjname, QVector &vecSlfList, QVec continue; } QString wellnameSLf=mssageSlf.Item; - if (wellnameSLf.isEmpty()||wellnameSLf.length()>64||wellnameSLf.indexOf('&')>-1) + //if (wellnameSLf.isEmpty()||wellnameSLf.length()>64||wellnameSLf.indexOf('&')>-1) { QFileInfo fileinfo; fileinfo = QFileInfo(slfFile1); wellnameSLf = fileinfo.completeBaseName(); } - if(wellnameSLf != wellname) - { - //井次名称不一致 - //qDebug() << "井次名称不一致"; - delete logioSLf; - continue; - } +// if(wellnameSLf != wellname) +// { +// //井次名称不一致 +// //qDebug() << "井次名称不一致"; +// delete logioSLf; +// continue; +// } vecSlfList.append(slfFile1); delete logioSLf; + break; } } } diff --git a/logPlus/logPlus.pro b/logPlus/logPlus.pro index 3c5979d..9dd7277 100644 --- a/logPlus/logPlus.pro +++ b/logPlus/logPlus.pro @@ -81,6 +81,7 @@ SOURCES += \ qmytreewidget.cpp \ qtcommonclass.cpp \ qtprojectwidgets.cpp \ + selectwelldialog.cpp \ totalTitleBar.cpp \ transparentdraggableGuan.cpp \ transparentdraggableRightList.cpp \ @@ -144,6 +145,7 @@ HEADERS += \ qmytreewidget.h \ qtcommonclass.h \ qtprojectwidgets.h \ + selectwelldialog.h \ totalTitleBar.h \ transparentdraggableGuan.h \ transparentdraggableRightList.h \ @@ -168,7 +170,8 @@ FORMS += \ mainwindowcurve.ui \ mainwindowsplitter.ui \ newheaddialog.ui \ - qtprojectwidgets.ui + qtprojectwidgets.ui \ + selectwelldialog.ui INCLUDEPATH += ../include/ \ ../CallManage \ diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index bc0469c..d116af0 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -14,6 +14,7 @@ #include "LogModuleConsole.h" #include "DepPairs.h" #include "mainwindowsplitter.h" +#include "selectwelldialog.h" extern int g_iOneWidth; //道宽 extern QString g_prjname; @@ -23,6 +24,7 @@ extern QString g_prjname; extern double g_dPixelPerCm;//每厘米像素数 extern int g_iShow; //显示刻度 +extern int g_SelectWellIndex; //图头 //extern int g_iRows; //extern int g_iCols; @@ -188,6 +190,7 @@ void MainWindowCurve::initMainToolBar() QSize toolIconSize(18, 18); ui->mainToolBar->setIconSize(toolIconSize); //设置工具栏图标大小 + QIcon selectWellIcon(::GetImagePath()+"icon/WellTops.png"); QIcon fixwellsectionHeaderIcon(::GetImagePath()+"icon/fixwellsectionHeader.png"); QIcon currtempliteIcon(::GetImagePath()+"icon/currtemplite.png"); QIcon saveastemplateIcon(::GetImagePath()+"icon/saveastemplate.png"); @@ -200,6 +203,7 @@ void MainWindowCurve::initMainToolBar() QIcon loadIcon(":/image/export.png"); //Main工具栏 + QAction* m_selectWellAc = nullptr; //选择井 QAction* m_fixwellsectionHeaderAc = nullptr; //锁头 QAction* m_currtempliteAc = nullptr; //加载图文件 QAction* m_saveastemplateAc = nullptr; //另存为图文件 @@ -211,6 +215,7 @@ void MainWindowCurve::initMainToolBar() // QAction* m_debugAc = nullptr; // // QAction* m_loadAc = nullptr; //加载 + m_selectWellAc = new QAction(selectWellIcon, "选择井", this); m_fixwellsectionHeaderAc = new QAction(fixwellsectionHeaderIcon, "锁头", this); m_currtempliteAc = new QAction(currtempliteIcon, "加载图文件", this); m_saveastemplateAc = new QAction(saveastemplateIcon, "另存为图文件", this); @@ -225,6 +230,7 @@ void MainWindowCurve::initMainToolBar() ui->mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); //此种方式为文字显示在图标右侧 //add QAction to Widget. + ui->mainToolBar->addAction(m_selectWellAc); ui->mainToolBar->addAction(m_fixwellsectionHeaderAc); //ui->mainToolBar->addAction(m_currtempliteAc); ui->mainToolBar->addAction(m_saveastemplateAc); @@ -237,6 +243,7 @@ void MainWindowCurve::initMainToolBar() // ui->mainToolBar->addAction(m_loadAc); //ui->mainToolBar->addAction(m_openAc); + connect(m_selectWellAc, &QAction::triggered, this, &MainWindowCurve::s_selectWell); connect(m_fixwellsectionHeaderAc, &QAction::triggered, this, &MainWindowCurve::s_showHeadTable); connect(m_currtempliteAc, &QAction::triggered, this, &MainWindowCurve::s_currtemplite); connect(m_saveastemplateAc, &QAction::triggered, this, &MainWindowCurve::s_Save); @@ -2318,6 +2325,65 @@ void MainWindowCurve::s_ModuleOpen() //} +//选择井 +void MainWindowCurve::s_selectWell() +{ + QStringList listSlf; + QStringList listWell; + + //直方图,获取当前工程下的slf + QVector vecSlfList; + QVector vecWellList; + bool bRet = getAllSlf(g_prjname, vecSlfList, vecWellList); + if(bRet) + { + for(int i=0; isetInfo(listWell, listSlf); + // + dlg->setAttribute(Qt::WA_DeleteOnClose);//关闭时,自动删除窗口对象 + int result = dlg->exec();//模态对话框 + if (result == QDialog::Accepted) { + // 处理用户点击了确定按钮的逻辑 + qDebug() << "Accepted="; + + //井没创建,创建井+道+曲线 + //新建井 + s_NewWell(listWell[g_SelectWellIndex], listSlf[g_SelectWellIndex]); + //新建道 + emit CallManage::getInstance()->sig_NewTrack(m_strUuid, listWell[g_SelectWellIndex], "", "", ""); + } + else if (result == QDialog::Rejected) { + // 处理用户点击了取消按钮的逻辑 + qDebug() << "Rejected="; + } + else { + // 处理其他情况的逻辑 + qDebug() << "other="; + } +} + //显示/隐藏图头 void MainWindowCurve::s_showHeadTable() { @@ -2854,8 +2920,8 @@ void MainWindowCurve::s_NewSantuyibiao() //选中道 if(m_SelectTableItem.m_iTableType==2) { - //新建表格曲线 - emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "IMAGE_DATA"); + //斜井三图一表 + emit CallManage::getInstance()->sig_AddSantuyibiao(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "Santuyibiao"); return; } @@ -3203,8 +3269,8 @@ void MainWindowCurve::s_NewJiegutext() //选中道 if(m_SelectTableItem.m_iTableType==2) { - //新建表格曲线 - emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "IMAGE_DATA"); + //气测/FMT/射孔/文本 + emit CallManage::getInstance()->sig_AddJiegutext(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "GASLOG"); return; } @@ -3225,8 +3291,8 @@ void MainWindowCurve::s_NewLogface() //选中道 if(m_SelectTableItem.m_iTableType==2) { - //新建表格曲线 - emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "IMAGE_DATA"); + //沉积相 + emit CallManage::getInstance()->sig_AddLogface(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "LITHA"); return; } @@ -3258,8 +3324,8 @@ void MainWindowCurve::s_NewTubingstring() //选中道 if(m_SelectTableItem.m_iTableType==2) { - //新建表格曲线 - emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "IMAGE_DATA"); + //套管组件 + emit CallManage::getInstance()->sig_AddTubingstring(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "TUBTOOLS"); return; } @@ -4386,12 +4452,12 @@ void MainWindowCurve::slotContextMenu(QPoint pos) if(iCurrentRow == 0) { QMenu menu(ui->tableWidget_2); - menu.addAction(QIcon(::GetImagePath() + "antialiasing.png"), "删除当前测井图", this, &MainWindowCurve::slotDeleteSelectTrack); + menu.addAction(QIcon(::GetImagePath() + "antialiasing.png"), "删除当前测井图", this, &MainWindowCurve::slotDeleteSelectWell); menu.exec(ui->tableWidget_2->mapToGlobal(pos)); } } -void MainWindowCurve::slotDeleteSelectTrack() +void MainWindowCurve::slotDeleteSelectWell() { int colCount = ui->tableWidget_2->columnCount(); diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 65efbed..af843ff 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -164,7 +164,7 @@ public slots: //右键菜单响应函数 void slotContextMenu(QPoint pos); - void slotDeleteSelectTrack(); + void slotDeleteSelectWell(); public slots: void s_NewWell(QString strWellName, QString strSlfName);//新建井 @@ -236,6 +236,7 @@ public slots: void s_EShiftDepth(QString strSlfName, QString strLineName, int count, QList left_Low_List, QList right_Hight_List); // + void s_selectWell(); //选择井 void s_showHeadTable(); //显示/隐藏图头 void s_currtemplite(); //加载图文件 void s_Save(); //保存图文件 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 7a9c7e7..117bf70 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -1354,7 +1354,12 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) pSubMenu->addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), str, this, &QMyCustomPlot::addItem_Tubing); } } - //menu.addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), "添加偏配", this, &QMyCustomPlot::addItem_Tubing); + menu.addSeparator(); + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Tubing); + menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems); + menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Tubing); + menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Tubing); + menu.exec(event->globalPos()); } } @@ -4694,6 +4699,8 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist) this->replot(); } } + +//校深线段 void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor) { QtCommonClass *qtCommon = new QtCommonClass(this); @@ -8364,6 +8371,13 @@ void QMyCustomPlot::addItem_Tubing() //保存 SaveToSLF_Tubing(); + + if(!mRect_Tubing || !mRect2_Tubing) + { + //绘制结构 + DrawStruct(); + } + //检查套管组件名称,是否需要更新套管图形 //画管柱 if(str == "管底部" || @@ -8374,6 +8388,10 @@ void QMyCustomPlot::addItem_Tubing() //组件改变后,重绘管柱 LoadFromSLF_ReDrawTubing(m_strSlfName, m_strLineName); } + else{ + //刷新 + this->replot(); + } } } } @@ -8603,6 +8621,12 @@ bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve) m_pResultList_Tubing.clear(); cclimgpath_Tubing=GetSymbolDir()+"\\管柱组件\\"; + //先删除 + if(mPixmap_Tubing) + { + removeItem(mPixmap_Tubing); + mPixmap_Tubing = nullptr; + } Slf_JIEGUPOS *m_pResult=NULL; CMemRdWt *logio=new CMemRdWt(); @@ -8932,3 +8956,278 @@ bool QMyCustomPlot::checkTubingName(QString m_Result) } return false; } + +//粘贴数据成取心 +void QMyCustomPlot::addItems_Tubing() +{ + int hasNO=0; + int isSK=0; + bool bReDraw = false; + { + QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 + QString originalTubingstring = clipboard->text(); //获取剪贴板上文本信息 + int isspace=originalTubingstring.indexOf(" "); + int istab=originalTubingstring.indexOf("\t"); + int isd=originalTubingstring.indexOf(","); + + if((istab>-1|isd>-1)&&isspace>-1) + { + QMessageBox::information(NULL,"提示","\",\"或制表符与空格键并存,自动分解可能有误!\n建议用单一符号风格!"); + } + originalTubingstring.replace("\t"," "); + originalTubingstring.replace(","," "); + originalTubingstring.replace("\r\n","\n"); + originalTubingstring.replace("\r","\n"); + QStringList line=originalTubingstring.split("\n"); + line.removeAll(""); + if(line.size()<1) return; + QString TableName; + QStringList temp1; + + if(line.size()>1) { + temp1=line[0].split(" "); + temp1.removeAll(""); + if(temp1.size()==1&&temp1.at(0).length()&&!temp1.at(0).at(0).isDigit()) { + TableName=temp1.at(0); + line.removeAt(0); + //CoreObj->SetName(TableName); + } + } + QString ss = m_strSlfName; + CMemRdWt *logio=new CMemRdWt(); + if(ss==""||!logio->Open(ss.toStdString().c_str(),CSlfIO::modeReadWrite)) + { + delete logio; + QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); + return; + } + int k=0; + QStringList coredat=line[0].split(" "); + if((istab==-1||isd==-1)&&isspace>=0) coredat.removeAll(""); + int iIndex=logio->OpenTable(m_strLineName.toStdString().c_str()); + if(iIndex>=0) { + int count=logio->GetTableFieldCount(iIndex); + if(count!=coredat.size()) { + logio->DiscardObject(m_strLineName.toStdString().c_str()); + } + iIndex=-1; + } + bool isfirst=false; + if(iIndex<0) + { + QString name,Length,type,temp; + bool ret=false; + QStringList css; + if(coredat.size()&&!coredat[0].isEmpty()) { + int NUM=0; + if(!coredat.at(0).at(0).isDigit()){ + if(coredat.at(0).indexOf("NO",0,Qt::CaseInsensitive)<0 + &&coredat.at(0).indexOf("序号")<0 + &&coredat.at(0).indexOf("INDEX")<0 + &&coredat.at(0).indexOf("ORDER")<0 + ) + { + coredat.insert(0,"NO"); + hasNO=true; + } + } + else { + if(hasNO) coredat.insert(0,QString::number(1)); + } + if(m_strLineName=="SK"&&(coredat.size()==4||coredat.size()==5)) + { + isSK=1; + name="NO,SDEP,EDEP,ZONE,RESULT,THICK,TT,ZONENO,LAYER,DEST"; + Length="4,4,4,8,4,4,4,64,64,64"; + type= "1,4,4,6,1,4,4,6,6,6"; + temp= "0,0,0,0,1,0,0,0,0,0"; + NUM=10; + } + else { + for(int j=0;jj) + { + for (int k=0;k-1) temp+="8"; + else temp+"0"; + if(j!=coredat.size()) + { + name+=","; + Length+=","; + type+=","; + temp+=","; + } + } + if(!coredat.at(0).at(0).isDigit()&&coredat.at(0).at(0)!='.'&&coredat.at(0).at(0)!='-') name=coredat.join(","); + NUM=coredat.size(); + } + iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,NUM, + (char*)name.toStdString().c_str(), + (char*)Length.toStdString().c_str(),//字段长度 + (char*)type.toStdString().c_str(),//字段类型 + (char*)temp.toStdString().c_str());//字段备注,1-枚举 + isfirst=true; + logio->SetTableRecordCount(iIndex,0); + } + } + int count=logio->GetTableFieldCount(iIndex); + Slf_TABLE_FIELD*pField=new Slf_TABLE_FIELD[logio->GetTableFieldCount(iIndex)]; + logio->GetTableFieldInfo(iIndex,pField); + float yy; + for(int i=0;i=0) coredat.removeAll(""); + if(coredat.size()<1) continue; + if(coredat[0].isEmpty()) continue; + if(coredat.size()<2)continue; + if(!coredat.at(0).at(0).isDigit()) continue; + if(hasNO) coredat.insert(0,QString::number(0)); +// for(int j=0;jSetTableFieldData(iIndex,j,(char*)&yy,k+1); +// } +// else if(j==3) logio->SetTableFieldData(iIndex,7,(char*)coredat[j].toStdString().c_str(),k+1); +// else if(j==4) logio->SetTableFieldData(iIndex,8,(char*)coredat[j].toStdString().c_str(),k+1); +// else if(j==5) logio->SetTableFieldData(iIndex,9,(char*)coredat[j].toStdString().c_str(),k+1); +// } +// else { +// if(pField[j].RepCode==6) { +// logio->SetTableFieldData(iIndex,j,(char*)coredat[j].toStdString().c_str(),k+1); +// } +// else { +// yy=coredat[j].toFloat(); +// logio->SetTableFieldData(iIndex,j,(char*)&yy,k+1); +// } +// } +// } +// k++; + //AddItem(coredat); + // + double Depth = coredat[1].toDouble(); + int Number = coredat[2].toDouble(); + Slf_JIEGUPOS result; + result.Depth = Depth; + result.Order = 0; + result.Number = Number; + // + drawOne_Tubing(result); + + //还没有画管柱 + if(Number == zoneOrder_Tubing.value("管底部").toInt()|| + Number == zoneOrder_Tubing.value("油管深").toInt()|| + Number == zoneOrder_Tubing.value("喇叭口").toInt()|| + Number == zoneOrder_Tubing.value("剌叭口").toInt()) + { + bReDraw = true;//重画管柱 + } + } + delete logio; + delete []pField; + + if(isfirst) + { + AddTableToWellRound(); + //绘制结构 + DrawStruct(); + } + + //保存 + SaveToSLF_Tubing(); + + if(bReDraw) + { + //组件改变后,重绘管柱 + LoadFromSLF_ReDrawTubing(m_strSlfName, m_strLineName); + } + else + { + //刷新 + this->replot(); + } + + //属性清空 + PropertyService()->InitCurrentViewInfo(); + } +} + +//全部清空 +void QMyCustomPlot::DeleteItems_Tubing() +{ + 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(); + + //删除对象 + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + pDraggableRect->deleteRect(); + } + + //刷新 + //this->replot(); + + //保存 + SaveToSLF_Tubing(); + + //重新加载 + LoadFromSLF_Tubing(m_strSlfName, m_strLineName); + + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + +//刷新数据 +void QMyCustomPlot::RefreshItems_Tubing() +{ + //删除对象 + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + pDraggableRect->deleteRect(); + } + + //重新加载 + LoadFromSLF_Tubing(m_strSlfName, m_strLineName); + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 62c52c3..1645525 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -348,7 +348,8 @@ public: //套管组件 void addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in, bool bRefresh=true); - // + + //校深线段 void addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80)); //框选并编辑曲线 @@ -476,7 +477,9 @@ public slots: //右键--套管组件 void addItem_Tubing(); //添加套管组件 - //void RefreshItems_Tubing(); //刷新数据 + void addItems_Tubing(); //从剪切板文本数据粘贴 + void DeleteItems_Tubing();//全部清空 + void RefreshItems_Tubing(); //刷新数据 //右键--解释结论 void onOpenEditResult(); diff --git a/logPlus/selectwelldialog.cpp b/logPlus/selectwelldialog.cpp new file mode 100644 index 0000000..55d0d97 --- /dev/null +++ b/logPlus/selectwelldialog.cpp @@ -0,0 +1,74 @@ +#include "selectwelldialog.h" +#include "ui_selectwelldialog.h" +#include +#include + +int g_SelectWellIndex = 0; + +SelectWellDialog::SelectWellDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SelectWellDialog) +{ + ui->setupUi(this); + loadStyle(":/qrc/qss/flatgray.css"); + + // + connect(ui->ok, SIGNAL(clicked()), this, SLOT(slotOkClicked())); + connect(ui->cancel, SIGNAL(clicked()), this, SLOT(slotCancelClicked())); +} + +SelectWellDialog::~SelectWellDialog() +{ + delete ui; +} + + +void SelectWellDialog::loadStyle(const QString &qssFile) +{ + //加载样式表 + QString qss; + QFile file(qssFile); + if (file.open(QFile::ReadOnly)) { + //用QTextStream读取样式文件不用区分文件编码 带bom也行 + QStringList list; + QTextStream in(&file); + //in.setCodec("utf-8"); + while (!in.atEnd()) { + QString line; + in >> line; + list << line; + } + + file.close(); + qss = list.join("\n"); + QString paletteColor = qss.mid(20, 7); + this->setPalette(QPalette(paletteColor)); + //用时主要在下面这句 + this->setStyleSheet(qss); + } +} + +void SelectWellDialog::setInfo(QStringList listWell, QStringList listSlf) +{ + for(int i=0; icomboBox->addItem(listWell[i]); + } +} + +// +void SelectWellDialog::slotOkClicked() +{ + g_SelectWellIndex = ui->comboBox->currentIndex(); + + //关闭 + accept(); // 让 QDialog::exec() 返回 QDialog::Accepted + //QDialog::close(); +} + +// +void SelectWellDialog::slotCancelClicked() +{ + reject(); // 让 QDialog::exec() 返回 QDialog::Rejected + //QDialog::close(); +} diff --git a/logPlus/selectwelldialog.h b/logPlus/selectwelldialog.h new file mode 100644 index 0000000..9ffb041 --- /dev/null +++ b/logPlus/selectwelldialog.h @@ -0,0 +1,30 @@ +#ifndef SELECTWELLDIALOG_H +#define SELECTWELLDIALOG_H + +#include + +namespace Ui { +class SelectWellDialog; +} + +class SelectWellDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SelectWellDialog(QWidget *parent = nullptr); + ~SelectWellDialog(); + +private: + Ui::SelectWellDialog *ui; + +public: + void loadStyle(const QString &qssFile); + void setInfo(QStringList listWell, QStringList listSlf); + +public slots: + void slotOkClicked(); + void slotCancelClicked(); +}; + +#endif // SELECTWELLDIALOG_H diff --git a/logPlus/selectwelldialog.ui b/logPlus/selectwelldialog.ui new file mode 100644 index 0000000..b860203 --- /dev/null +++ b/logPlus/selectwelldialog.ui @@ -0,0 +1,70 @@ + + + SelectWellDialog + + + + 0 + 0 + 400 + 300 + + + + 选择井 + + + + + + + + + + 选择井: + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 选择 + + + + + + + 取消 + + + + + + + + + + + +