diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 945045a..6188f1a 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -3375,8 +3375,8 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo) _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); _CreateVariantPropertyItem("显示设置", "显示单位", formInfo->m_strUnit, QVariant::String); - _CreateVariantPropertyItem("显示设置", "左刻度", formInfo->m_vmin, QVariant::Double); - _CreateVariantPropertyItem("显示设置", "右刻度", formInfo->m_vmax, QVariant::Double); +// _CreateVariantPropertyItem("显示设置", "左刻度", formInfo->m_vmin, QVariant::Double); +// _CreateVariantPropertyItem("显示设置", "右刻度", formInfo->m_vmax, QVariant::Double); _CreateVariantPropertyItem("绘制方式", "绘制结构", formInfo->m_bDrawStruct_Tubing, QVariant::Bool); _CreateVariantPropertyItem("绘制方式", "绘制管柱", formInfo->m_bDrawTubing_Tubing, QVariant::Bool); @@ -3417,9 +3417,18 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do _CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color); _CreateVariantPropertyItem("显示设置", "显示单位", formInfo->m_strUnit, QVariant::String); - _CreateVariantPropertyItem("显示设置", "左刻度", formInfo->m_vmin, QVariant::Double); - _CreateVariantPropertyItem("显示设置", "右刻度", formInfo->m_vmax, QVariant::Double); +// _CreateVariantPropertyItem("显示设置", "左刻度", formInfo->m_vmin, QVariant::Double); +// _CreateVariantPropertyItem("显示设置", "右刻度", formInfo->m_vmax, QVariant::Double); + _CreateVariantPropertyItem("绘制方式", "绘制结构", formInfo->m_bDrawStruct_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制管柱", formInfo->m_bDrawTubing_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制工具", formInfo->m_bDrawTools_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "标注工具", formInfo->m_bDrawSPTool_Tubing, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制接箍", formInfo->m_bDrawCCL_Tubing, QVariant::Bool); + + _CreateVariantPropertyItem("绘制方式", "油管外径", formInfo->m_Oguan_Tubing, QVariant::Double); + _CreateVariantPropertyItem("绘制方式", "套管内径", formInfo->m_inD_Tubing, QVariant::Double); + _CreateVariantPropertyItem("绘制方式", "套管外径", formInfo->m_OutD_Tubing, QVariant::Double); } //当前属性类型 diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 87e20dd..a4eca50 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -1087,6 +1087,27 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) } } + //左刻度,右刻度 + double newLeftScale = 0;//左刻度 + double newRightScale = 500;//右刻度 + // + if (lineObjInfo.contains("vmin")) + { + QJsonValue value = lineObjInfo.value("vmin"); + if (value.isDouble()) { + newLeftScale = value.toDouble(); + //qDebug() << "vmin:" << QString::number(newLeftScale); + } + } + if (lineObjInfo.contains("vmax")) + { + QJsonValue value = lineObjInfo.value("vmax"); + if (value.isDouble()) { + newRightScale = value.toDouble(); + //qDebug() << "vmax:" << QString::number(newRightScale); + } + } + QString folderPath = GetLogdataPath(); folderPath = folderPath + g_prjname; strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName; @@ -1154,6 +1175,9 @@ void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo) listOtherProperty.append(QString::number(Oguan_Tubing));//油管外径 listOtherProperty.append(QString::number(inD_Tubing));//套管内径 listOtherProperty.append(QString::number(OutD_Tubing));//套管外径 + // + listOtherProperty.append(QString::number(newLeftScale));//左刻度 + listOtherProperty.append(QString::number(newRightScale));//右刻度 //套管組件 this->s_addTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); // } @@ -3979,7 +4003,9 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st //------------------- int iMyWidth = curv->m_OutD_Tubing; //暂时按照套管外径 //curv->axisRect(0)->width(); - if(listOtherProperty.size()>=14) + + // + if(listOtherProperty.size()>=16) { // if(listOtherProperty[6]=="DrawStruct") @@ -4032,13 +4058,19 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st curv->m_OutD_Tubing = listOtherProperty[13].toDouble(); // iMyWidth = listOtherProperty[13].toDouble(); +// m_LeftVal = listOtherProperty[14].toDouble(); +// m_RightVal = listOtherProperty[15].toDouble(); + // +// vmin = m_LeftVal; +// vmax = m_RightVal; } - + // + float vmin = 0; + float vmax = iMyWidth; + // m_LeftVal = 0; m_RightVal = iMyWidth; - - float vmax = iMyWidth; - float vmin = 0; + // curv->m_iX1 = vmin; curv->m_iX2 = vmax; curv->m_iY1 = m_iY1; @@ -4066,6 +4098,11 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st //套管组件 //QString strWaveName = "TUBTOOLS"; curv->LoadFromSLF_Tubing(strSlfName, strLineName); +// //先画图,再改变左右刻度 +// curv->m_iX1 = m_LeftVal; +// curv->m_iX2 = m_RightVal; +// curv->yAxis->setRange(curv->m_iX1, curv->m_iX2); +// curv->replot(); // connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 613e902..786580d 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -244,7 +244,9 @@ QJsonObject FormInfo::makeJson() rootObj["Oguan"] = m_Oguan_Tubing; rootObj["inD"] = m_inD_Tubing; rootObj["OutD"] = m_OutD_Tubing; - + // + rootObj["vmax"] = m_vmax;//右刻度 + rootObj["vmin"] = m_vmin;//左刻度 //item属性写入slf文件,不需要此次记录 return rootObj; } @@ -252,8 +254,8 @@ QJsonObject FormInfo::makeJson() rootObj["Unit"] = m_strUnit; rootObj["Width"] = m_dWidth; rootObj["lineStyle"] = m_lineStyle; - rootObj["vmax"] = m_vmax; - rootObj["vmin"] = m_vmin; + rootObj["vmax"] = m_vmax;//右刻度 + rootObj["vmin"] = m_vmin;//左刻度 rootObj["ScaleType"] = m_strScaleType; rootObj["ShowScale"] = m_bShowScale; diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 86b8735..843da04 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -6468,23 +6468,41 @@ void QMyCustomPlot::DrawStruct() //绘制套管 float upper = this->xAxis->range().upper; float lower = this->xAxis->range().lower; - double lY1 = this->yAxis->range().lower; - double lY2 = this->yAxis->range().upper; +// double lY1 = 0;//this->yAxis->range().lower; +// double lY2 = m_OutD_Tubing;//this->yAxis->range().upper - this->yAxis->range().lower; //this->yAxis->range().upper; // 创建矩形 mRect_Tubing = new QCPItemRect(this); mRect_Tubing->setLayer("overlay"); // 确保在最上层 mRect_Tubing->setBrush(QBrush(QColor(0, 0, 0, 255))); mRect_Tubing->setPen(QPen(QColor(0, 0, 0, 255))); - mRect_Tubing->topLeft->setCoords(lower, lY1 + (lY2-lY1-m_OutD_Tubing)/2.0); - mRect_Tubing->bottomRight->setCoords(upper, lY1 + (lY2-lY1-m_inD_Tubing)/2.0); + // + double lyTmp = 0; //lY1 + (lY2-lY1-m_OutD_Tubing)/2.0; + if(lyTmp<0) + { + lyTmp=0; + } + mRect_Tubing->topLeft->setCoords(lower, lyTmp); + // + double lyTmp2 = (m_OutD_Tubing-m_inD_Tubing)/2.0; //lY1 + (lY2-lY1-m_inD_Tubing)/2.0; + if(lyTmp2<0) + { + lyTmp2=0; + } + mRect_Tubing->bottomRight->setCoords(upper, lyTmp2); // 创建矩形 mRect2_Tubing = new QCPItemRect(this); mRect2_Tubing->setLayer("overlay"); // 确保在最上层 mRect2_Tubing->setBrush(QBrush(QColor(0, 0, 0, 255))); mRect2_Tubing->setPen(QPen(QColor(0, 0, 0, 255))); - mRect2_Tubing->topLeft->setCoords(lower, lY2 - (lY2-lY1-m_OutD_Tubing)/2.0); - mRect2_Tubing->bottomRight->setCoords(upper, lY2 - (lY2-lY1-m_inD_Tubing)/2.0); + lyTmp = m_OutD_Tubing/2.0 + m_inD_Tubing/2.0; //lY2 - (lY2-lY1-m_OutD_Tubing)/2.0 + mRect2_Tubing->topLeft->setCoords(lower, lyTmp); + // + lyTmp2 = m_OutD_Tubing; //lY2 - (lY2-lY1-m_inD_Tubing)/2.0; + mRect2_Tubing->bottomRight->setCoords(upper, lyTmp2); + + // + } } @@ -6501,8 +6519,8 @@ void QMyCustomPlot::DrawTubing() { QString shotimgfile=GetSymbolDir()+"\\管柱组件\\管柱.png"; - double lY1 = this->yAxis->range().lower;//+10 - double lY2 = this->yAxis->range().upper; + double lY1 = 0;//this->yAxis->range().lower;//+10 + double lY2 = m_OutD_Tubing;//this->yAxis->range().upper - this->yAxis->range().lower; //this->yAxis->range().upper; // mPixmap_Tubing = new QCPItemPixmap(this); @@ -6517,7 +6535,7 @@ void QMyCustomPlot::DrawTubing() } } -//改变沉积相属性,是否显示 +//改变套管组件属性,是否显示 void QMyCustomPlot::s_changeGuanShow(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, bool bShow) { if(m_strUuid == strUuid && @@ -6621,7 +6639,7 @@ void QMyCustomPlot::s_changeGuanShow(QString strUuid, QString strSlfName, QStrin //不清空属性窗口 } -//改变沉积相属性,是否显示 +//改变套管组件属性,是否显示 void QMyCustomPlot::s_changeGuanD(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString propertyData, double newD) { if(m_strUuid == strUuid && @@ -6698,6 +6716,33 @@ void QMyCustomPlot::s_changeGuanD(QString strUuid, QString strSlfName, QString s m_OutD_Tubing = newD; //绘制结构 DrawStruct(); + //先画图,再改变左右刻度 + this->m_iX1 = 0; + this->m_iX2 = m_OutD_Tubing; + this->yAxis->setRange(this->m_iX1, this->m_iX2); + + //绘制管柱 + DrawTubing(); + //绘制工具 + TransparentDraggableGuan *pDraggableRect =NULL; + QMap::Iterator it = m_mapDraggable_Guan.begin(); + while( it != m_mapDraggable_Guan.end() ) + { + pDraggableRect = (TransparentDraggableGuan*)it.value(); + it++; + //刷新 + QCPRange tmpRange = pDraggableRect->getRange(); +// if(m_bDrawCCL_Tubing) +// { +// pDraggableRect->mIn = m_inD_Tubing+1; +// } +// else +// { +// pDraggableRect->mIn = m_Oguan_Tubing+1; +// } + + pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false); + } //刷新 replot(); } diff --git a/logPlus/transparentdraggableGuan.cpp b/logPlus/transparentdraggableGuan.cpp index 47bab48..2dc29bc 100644 --- a/logPlus/transparentdraggableGuan.cpp +++ b/logPlus/transparentdraggableGuan.cpp @@ -194,8 +194,8 @@ void TransparentDraggableGuan::setRange(double left_Low, double right_Hight, boo //套管组件高度 mH = right_Hight-left_Low; - double lY1 = mPlot->yAxis->range().lower;//+10 - double lY2 = mPlot->yAxis->range().upper; + double lY1 = 0;//mPlot->yAxis->range().lower;//+10 + double lY2 = mPlot->m_OutD_Tubing;//mPlot->yAxis->range().upper - mPlot->yAxis->range().lower; //mPlot->yAxis->range().upper; mRect->topLeft->setCoords(left_Low, lY1 + (lY2-lY1-mIn)/2.0); mRect->bottomRight->setCoords(right_Hight, lY2 - (lY2-lY1-mIn)/2.0);