diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 0a4bd07..23d4e2e 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -275,6 +275,9 @@ signals: //改变井斜方位图属性 void sig_changeDenvProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //改变多臂井径属性 + void sig_changeMCalsProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName); + // //void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath); diff --git a/logPlus/DrawNrad.cpp b/logPlus/DrawNrad.cpp index e0548cc..fa2669b 100644 --- a/logPlus/DrawNrad.cpp +++ b/logPlus/DrawNrad.cpp @@ -122,6 +122,12 @@ void CDrawNrad::DrawNrad(QString strSlfName, QString csCurve) // 初始化 int iMyWidth = m_myCustomPlot->axisRect(0)->width(); + + //重置范围 + float vmax = iMyWidth; + float vmin = 0; + m_myCustomPlot->yAxis->setRange(vmin, vmax); + centerX = (iMyWidth+0)/2.0; centerY = 0; nWidth = iMyWidth; diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 1f9343f..52ab853 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -2392,6 +2392,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant // changedDenvProperty(m_propertyData[pProperty], variant); } + else if (m_strCurrentProperty == MCals_Property)//多臂井径 + { + //先处理通用属性 + CommonPropertyChanged(pProperty, variant); + // + changedMCalsProperty(m_propertyData[pProperty], variant); + } } void PropertyWidget::SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle) @@ -3236,6 +3243,11 @@ void PropertyWidget::initProperty(FormInfo *formInfo) { //井斜方位图 this->initDenvProperty(formInfo); + } + else if (formInfo->m_strType == "MCalsObject") + { + //多臂井径 + this->initMCalsProperty(formInfo); } else if (formInfo->m_strType == "depthObject") { @@ -5236,7 +5248,7 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal) emit CallManage::getInstance()->sig_changeRoseProperty(variantMap); } } - +//蝌蚪图 void PropertyWidget::initKedouProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5278,7 +5290,7 @@ void PropertyWidget::initKedouProperty(FormInfo *formInfo) m_strCurrentProperty = Kedou_Property; } - +//蝌蚪图 void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5483,7 +5495,7 @@ void PropertyWidget::changedKedouProperty(QString strProperty, QVariant varVal) emit CallManage::getInstance()->sig_changeKedouProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName); } } - +//杆状图 void PropertyWidget::initGanzhuangProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5509,7 +5521,7 @@ void PropertyWidget::initGanzhuangProperty(FormInfo *formInfo) m_strCurrentProperty = Ganzhuang_Property; } - +//杆状图 void PropertyWidget::changedGanzhuangProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5584,7 +5596,7 @@ void PropertyWidget::changedGanzhuangProperty(QString strProperty, QVariant varV emit CallManage::getInstance()->sig_changeGanzhuangProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName); } } - +//井眼垮塌矢量图 void PropertyWidget::initJyktProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5609,7 +5621,7 @@ void PropertyWidget::initJyktProperty(FormInfo *formInfo) m_strCurrentProperty = Jykt_Property; } - +//井眼垮塌矢量图 void PropertyWidget::changedJyktProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5695,7 +5707,7 @@ void PropertyWidget::changedJyktProperty(QString strProperty, QVariant varVal) } } - +//井斜方位图 void PropertyWidget::initDenvProperty(FormInfo *formInfo) { _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); @@ -5720,7 +5732,7 @@ void PropertyWidget::initDenvProperty(FormInfo *formInfo) m_strCurrentProperty = Denv_Property; } - +//井斜方位图 void PropertyWidget::changedDenvProperty(QString strProperty, QVariant varVal) { bool flag = false; @@ -5800,3 +5812,148 @@ void PropertyWidget::changedDenvProperty(QString strProperty, QVariant varVal) emit CallManage::getInstance()->sig_changeDenvProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName); } } + +//多臂井径 +void PropertyWidget::initMCalsProperty(FormInfo *formInfo) +{ + _CreateVariantPropertyItem("曲线图名", "显示名称", formInfo->m_strAliasName, QVariant::String); + _CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String); + + // + _CreateVariantPropertyItem("网格图", "最小井径", formInfo->m_MinVal, QVariant::Double); + _CreateVariantPropertyItem("网格图", "最大井径", formInfo->m_MaxVal, QVariant::Double); + _CreateVariantPropertyItem("网格图", "左边井径序号", formInfo->m_iStartArmPos, QVariant::Int); + _CreateVariantPropertyItem("网格图", "右边井径序号", formInfo->m_iEndArmPos, QVariant::Int); + _CreateVariantPropertyItem("网格图", "最小外径占道比例", formInfo->m_MinRatio, QVariant::Double); + _CreateVariantPropertyItem("网格图", "最大外径占道比例", formInfo->m_MaxRatio, QVariant::Double); + _CreateVariantPropertyItem("网格图", "纵向网格间隔", formInfo->m_nVertGrid, QVariant::Int); + _CreateVariantPropertyItem("网格图", "井径曲线间网格", formInfo->m_nHorzGrid, QVariant::Int); + _CreateVariantPropertyItem("网格图", "旋转井径增量", formInfo->m_nHorzStep, QVariant::Int); + _CreateVariantPropertyItem("网格图", "井柱椭圆纵横半径比", formInfo->m_flVFactor, QVariant::Double); + _CreateVariantPropertyItem("网格图", "横格线宽度", formInfo->m_nHLineWidth, QVariant::Int); + _CreateVariantPropertyItem("网格图", "横格线颜色", formInfo->m_HLineColor, QVariant::Color); + _CreateVariantPropertyItem("网格图", "纵格线宽度", formInfo->m_nVLineWidth, QVariant::Int); + _CreateVariantPropertyItem("网格图", "纵格线颜色", formInfo->m_VLineColor, QVariant::Color); + m_strCurrentProperty = MCals_Property; +} +//多臂井径 +void PropertyWidget::changedMCalsProperty(QString strProperty, QVariant varVal) +{ + bool flag = false; + + if("选择井曲线" == strProperty) + { + QString sFilePath = varVal.toString(); + if(sFilePath.indexOf("@")>-1) + { + int ind=sFilePath.indexOf("@"); + QString strLineName = sFilePath.left(ind); + sFilePath=sFilePath.mid(ind+1); + sFilePath.trimmed(); + { + QString strOldLineName = m_formInfo->m_strLineName; + QString strOldSlfName = m_formInfo->m_strSlfName; + //暂时不允许改变slf井次名称,不然不在同一口井绘制 + if(strOldSlfName != sFilePath) + { + QMessageBox::information(nullptr,"提示","不允许改变slf井次名称"); + return; + } + //名称不变 + if(strOldLineName == strLineName) + { + return; + } + if("" == strLineName) + { + return; + } + + // + m_formInfo->m_strLineName = strLineName; + //m_formInfo->m_strSlfName = sFilePath; + m_formInfo->update(); + //flag = true; + //此处需要使用strOldLineName + emit CallManage::getInstance()->sig_changeMCalsProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, strOldLineName, strLineName); + return; + } + } + } + // 网格图 + else if ("最小井径" == strProperty) + { + this->m_formInfo->m_MinVal = varVal.toDouble(); + flag = true; + } + else if ("最大井径" == strProperty) + { + this->m_formInfo->m_MaxVal = varVal.toDouble(); + flag = true; + } + else if ("左边井径序号" == strProperty) + { + this->m_formInfo->m_iStartArmPos = varVal.toInt(); + flag = true; + } + else if ("右边井径序号" == strProperty) + { + this->m_formInfo->m_iEndArmPos = varVal.toInt(); + flag = true; + } + else if ("最小外径占道比例" == strProperty) + { + this->m_formInfo->m_MinRatio = varVal.toDouble(); + flag = true; + } + else if ("最大外径占道比例" == strProperty) + { + this->m_formInfo->m_MaxRatio = varVal.toDouble(); + flag = true; + } + else if ("纵向网格间隔" == strProperty) + { + this->m_formInfo->m_nVertGrid = varVal.toInt(); + flag = true; + } + else if ("井径曲线间网格" == strProperty) + { + this->m_formInfo->m_nHorzGrid = varVal.toInt(); + flag = true; + } + else if ("旋转井径增量" == strProperty) + { + this->m_formInfo->m_nHorzStep = varVal.toInt(); + flag = true; + } + else if ("井柱椭圆纵横半径比" == strProperty) + { + this->m_formInfo->m_flVFactor = varVal.toDouble(); + flag = true; + } + else if ("横格线宽度" == strProperty) + { + this->m_formInfo->m_nHLineWidth = varVal.toInt(); + flag = true; + } + else if ("横格线颜色" == strProperty) + { + this->m_formInfo->m_HLineColor = varVal.value(); + flag = true; + } + else if ("纵格线宽度" == strProperty) + { + this->m_formInfo->m_nVLineWidth = varVal.toInt(); + flag = true; + } + else if ("纵格线颜色" == strProperty) + { + this->m_formInfo->m_VLineColor = varVal.value(); + flag = true; + } + + if(flag) + { + emit CallManage::getInstance()->sig_changeMCalsProperty(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_formInfo->m_strLineName); + } +} diff --git a/logPlus/PropertyWidget.h b/logPlus/PropertyWidget.h index 85daec9..29951f4 100644 --- a/logPlus/PropertyWidget.h +++ b/logPlus/PropertyWidget.h @@ -82,6 +82,8 @@ #define Jykt_Property "Jykt_Property" //井眼垮塌矢量图 #define Denv_Property "Denv_Property" //井斜方位图 +#define MCals_Property "MCals_Property" //多臂井径 + #pragma execution_character_set("utf-8") /** @@ -277,6 +279,10 @@ public: void initDenvProperty(FormInfo *formInfo); void changedDenvProperty(QString strProName, QVariant val); + //多臂井径 + void initMCalsProperty(FormInfo *formInfo); + void changedMCalsProperty(QString strProName, QVariant val); + public slots: void SlotPropertyChanged(QtProperty *property, const QVariant &variant); void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle); diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index fc8808d..1498e29 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -3415,7 +3415,7 @@ void FormDraw::s_mouseWheel(QWheelEvent *event) void FormDraw::setColWidth(float fNewWidth) { m_nTrackW = fNewWidth; - fNewWidth = fNewWidth * g_dPixelPerCm; + //fNewWidth = fNewWidth * g_dPixelPerCm; // 获取当前widget的所有子控件 const QObjectList &children = this->children(); //判断为空 @@ -4438,7 +4438,7 @@ void FormDraw::initMCals(QMyCustomPlot *widget, QString strSlfName, QString strL FormInfo* pInfo = m_formTrack->AddMCals(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "MCalsObject", listOtherProperty); //多臂井径 - widget->Draw_MCals(); + widget->Draw_MCals(strLineName, strLineName); } //套管组件 diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index d1bc948..1c13555 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -404,10 +404,10 @@ public: int m_nHorzGrid = 0; //井径曲线间网格 int m_nHorzStep = 5; //旋转井径增量 float m_flVFactor = 0.8; //井柱椭圆纵横半径比 - int m_nHLineWidth =1; - QColor m_HLineColor = QColor(0,0,0); - int m_nVLineWidth =1; - QColor m_VLineColor = QColor(0,0,0); + int m_nHLineWidth =1; //横格线宽度 + QColor m_HLineColor = QColor(0,0,0);//横格线颜色 + int m_nVLineWidth =1; //纵格线宽度 + QColor m_VLineColor = QColor(0,0,0);//纵格线颜色 public: void setLineWidth(double dWidth); diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 695b1ce..5498ccd 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -222,6 +222,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_changeJyktProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeJyktProperty(QString, QString, QString, QString, QString))); //改变井斜方位图属性 connect(CallManage::getInstance(), SIGNAL(sig_changeDenvProperty(QString, QString, QString, QString, QString)), this, SLOT(s_changeDenvProperty(QString, QString, QString, QString, QString))); + //改变多臂井径属性 + connect(CallManage::getInstance(), SIGNAL(sig_changeMCalsProperty(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeMCalsProperty(QString, QString, QString, QString, QString, QString))); } void QMyCustomPlot::initGeometry(QString strUuid, int nscale, double fW) @@ -10720,6 +10722,19 @@ void QMyCustomPlot::resetPosition() //地质层位 resetPosition_Layer(); + // + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + if (pInfo == NULL) + { + return; + } + + if(pInfo->m_strType == "MCalsObject") + { + //多臂井径 + Draw_MCals(m_strLineName, m_strLineName); + return; + } //刷新 replot(); } @@ -12797,21 +12812,40 @@ void QMyCustomPlot::Draw_Denv() this->replot(); } -//多臂井径 -void QMyCustomPlot::Draw_MCals() +//改变多臂井径属性 +void QMyCustomPlot::s_changeMCalsProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName) { - //this->clearGraphs(); + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + + } + else + { + return; + } + //绘制多臂井径 + Draw_MCals(strLineName, strNewLineName); +} + +//多臂井径 +void QMyCustomPlot::Draw_MCals(QString strLineName, QString strNewLineName) +{ + this->clearGraphs(); this->clearItems(); // - FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, m_strLineName); + FormInfo* pInfo = m_formTrack->getFormInfoByParameters(m_strUuid, m_strWellName, m_strTrackName, strNewLineName); if (pInfo == NULL) { return; } //多臂井径 - QString strWaveName = "FCA2"; + m_strLineName = pInfo->m_strLineName; //"FCA2"; CDrawNrad *drawNrad = new CDrawNrad(this); //属性 drawNrad->m_LeftVal = pInfo->m_MinVal;//最小井径 @@ -12829,7 +12863,7 @@ void QMyCustomPlot::Draw_MCals() drawNrad->m_nVertLineWidth = pInfo->m_nVLineWidth; drawNrad->m_crVertLine = pInfo->m_VLineColor; - drawNrad->ReadData(m_strSlfName, strWaveName); - drawNrad->DrawNrad(m_strSlfName, strWaveName); + drawNrad->ReadData(m_strSlfName, m_strLineName); + drawNrad->DrawNrad(m_strSlfName, m_strLineName); this->replot(); } diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index 3b187ac..ce40e2a 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -688,6 +688,10 @@ public slots: //改变井斜方位图属性 void s_changeDenvProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //改变多臂井径属性 + void s_changeMCalsProperty(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName); + + public: //蝌蚪图重绘网格线 bool mKedou = false; @@ -778,7 +782,7 @@ public: CPickFrac *m_cPickFrac; //多臂井径 - void Draw_MCals(); + void Draw_MCals(QString strLineName, QString strNewLineName); private: