diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index aec6787..27f2dd6 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -115,6 +115,17 @@ signals: void sig_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width); //线型 void sig_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle); + + //绘制方式 + //曲线 + void sig_ChangeDrawLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawLine); + //杆状 + void sig_ChangeDrawGan(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawGan); + //点状 + void sig_ChangeDrawPoint(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawPoint); + //绘制对称曲线 + void sig_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry); + //岩性填充-不填充 void sig_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); //岩性填充-填充 diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 8ea75c8..8098183 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -200,29 +200,29 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant } return; } - else if (m_strCurrentProperty == Table_Property) - { - if("显示名称" == m_propertyData[pProperty]) - { - QString newAliasName = variant.value(); - m_formInfo->m_strAliasName = newAliasName; - m_formInfo->update(); - } - else if("字体" == m_propertyData[pProperty]) - { - //字体 - // 假设variant已经被设置为包含QColor - QFont newFont = variant.value(); - m_formInfo->m_curveNameFont = newFont; - m_formInfo->update(); - } - else if("颜色" == m_propertyData[pProperty]) - { - QColor newColor = variant.value(); - m_formInfo->m_lineColor = newColor; - m_formInfo->update(); - } - } +// else if (m_strCurrentProperty == Table_Property) +// { +// if("显示名称" == m_propertyData[pProperty]) +// { +// QString newAliasName = variant.value(); +// m_formInfo->m_strAliasName = newAliasName; +// m_formInfo->update(); +// } +// else if("字体" == m_propertyData[pProperty]) +// { +// //字体 +// // 假设variant已经被设置为包含QColor +// QFont newFont = variant.value(); +// m_formInfo->m_curveNameFont = newFont; +// m_formInfo->update(); +// } +// else if("颜色" == m_propertyData[pProperty]) +// { +// QColor newColor = variant.value(); +// m_formInfo->m_lineColor = newColor; +// m_formInfo->update(); +// } +// } else if (m_strCurrentProperty == GujingItem_Property) { //固井结论item @@ -506,6 +506,47 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant emit CallManage::getInstance()->sig_ChangeLineStyle(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, newStyle); } } + else if("曲线" == m_propertyData[pProperty]) + { + //qDebug() << "曲线->改变"; + //当前属性类型 + if(m_strCurrentProperty == Curve_Property) + { + bool bDraw = variant.value(); + emit CallManage::getInstance()->sig_ChangeDrawLine(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, bDraw); + } + } + else if("杆状" == m_propertyData[pProperty]) + { + //qDebug() << "杆状->改变"; + //当前属性类型 + if(m_strCurrentProperty == Curve_Property) + { + bool bDraw = variant.value(); + emit CallManage::getInstance()->sig_ChangeDrawGan(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, bDraw); + } + } + else if("点状" == m_propertyData[pProperty]) + { + //qDebug() << "点状->改变"; + //当前属性类型 + if(m_strCurrentProperty == Curve_Property) + { + bool bDraw = variant.value(); + emit CallManage::getInstance()->sig_ChangeDrawPoint(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, bDraw); + } + } + else if("绘制对称曲线" == m_propertyData[pProperty]) + { + //qDebug() << "绘制对称曲线->改变"; + //当前属性类型 + if(m_strCurrentProperty == Curve_Property) + { + bool bDraw = variant.value(); + emit CallManage::getInstance()->sig_ChangeDrawSymmetry(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, m_strLineName, bDraw); + } + } + else if("填充模式" == m_propertyData[pProperty]) { //qDebug() << "填充模式->改变"; @@ -1194,10 +1235,10 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt _CreateVariantPropertyItem("曲线线型", "颜色", formInfo->m_lineColor, QVariant::Color); _CreateEnumPropertyItem("曲线线型", "线型", (int)formInfo->m_lineStyle, listStyle); //绘制方式 -// _CreateVariantPropertyItem("绘制方式", "曲线", formInfo->m_bDrawLine, QVariant::Bool); -// _CreateVariantPropertyItem("绘制方式", "绘制对称曲线", formInfo->m_bDrawSymmetry, QVariant::Bool); -// _CreateVariantPropertyItem("绘制方式", "杆状", formInfo->m_bDrawGan, QVariant::Bool); -// _CreateVariantPropertyItem("绘制方式", "点状", formInfo->m_bDrawPoint, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "曲线", formInfo->m_bDrawLine, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "绘制对称曲线", formInfo->m_bDrawSymmetry, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "杆状", formInfo->m_bDrawGan, QVariant::Bool); + _CreateVariantPropertyItem("绘制方式", "点状", formInfo->m_bDrawPoint, QVariant::Bool); // _CreateEnumPropertyItem("岩性填充", "头部图例", listHeadFill.indexOf(formInfo->m_newHeadFill), listHeadFill); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index ea5c21c..91a5542 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -51,6 +51,17 @@ FormInfo::FormInfo(QWidget *parent, QString strSlfName, QString strWellName, QSt connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineWidth(QString, QString, QString, QString, QString, double)), this, SLOT(s_ChangeLineWidth(QString, QString, QString, QString, QString, double))); //线型 connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineStyle(QString, QString, QString, QString, QString, Qt::PenStyle)), this, SLOT(s_ChangeLineStyle(QString, QString, QString, QString, QString, Qt::PenStyle))); + + //绘制方式 + //曲线 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawLine(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawLine(QString, QString, QString, QString, QString, bool))); + //杆状 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawGan(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawGan(QString, QString, QString, QString, QString, bool))); + //点状 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawPoint(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawPoint(QString, QString, QString, QString, QString, bool))); + //绘制对称曲线 + 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_ClearFillMode(QString, QString, QString, QString, QString)), this, SLOT(s_ClearFillMode(QString, QString, QString, QString, QString))); //岩性填充-填充 @@ -834,6 +845,30 @@ void FormInfo::s_ChangeLineStyle(QString strUuid, QString strSlfName, QString st } } +//曲线 +void FormInfo::s_ChangeDrawLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawLine) +{ + m_bDrawLine = bDrawLine; +} + +//杆状 +void FormInfo::s_ChangeDrawGan(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawGan) +{ + m_bDrawGan = bDrawGan; +} + +//点状 +void FormInfo::s_ChangeDrawPoint(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawPoint) +{ + m_bDrawPoint = bDrawPoint; +} + +//绘制对称曲线 +void FormInfo::s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry) +{ + m_bDrawSymmetry = bDrawSymmetry; +} + //岩性填充-不填充 void FormInfo::s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) { diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index 3de9ce4..fe33851 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -48,6 +48,17 @@ public slots: void s_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width); //线型 void s_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle); + + //绘制方式 + //曲线 + void s_ChangeDrawLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawLine); + //杆状 + void s_ChangeDrawGan(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawGan); + //点状 + 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_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); //岩性填充-填充 @@ -85,6 +96,12 @@ public: QFont m_curveUnitFont; // 曲线单位 QFont m_curveScaleFont; // 曲线刻度 + //绘制方式 + bool m_bDrawLine = true; // 曲线 + bool m_bDrawGan = false; // 杆状 + bool m_bDrawPoint = false; // 点状 + bool m_bDrawSymmetry = false; // 绘制对称曲线 + //岩性填充 QString m_newHeadFill;//头部图例 QString m_newTargetLine;//目标曲线 diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 3d4426b..01f56b7 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -83,6 +83,17 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineWidth(QString, QString, QString, QString, QString, double)), this, SLOT(s_ChangeLineWidth(QString, QString, QString, QString, QString, double))); //线型 connect(CallManage::getInstance(), SIGNAL(sig_ChangeLineStyle(QString, QString, QString, QString, QString, Qt::PenStyle)), this, SLOT(s_ChangeLineStyle(QString, QString, QString, QString, QString, Qt::PenStyle))); + + //绘制方式 + //曲线 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawLine(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawLine(QString, QString, QString, QString, QString, bool))); + //杆状 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawGan(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawGan(QString, QString, QString, QString, QString, bool))); + //点状 + connect(CallManage::getInstance(), SIGNAL(sig_ChangeDrawPoint(QString, QString, QString, QString, QString, bool)), this, SLOT(s_ChangeDrawPoint(QString, QString, QString, QString, QString, bool))); + //绘制对称曲线 + 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_ClearFillMode(QString, QString, QString, QString, QString)), this, SLOT(s_ClearFillMode(QString, QString, QString, QString, QString))); //岩性填充-填充 @@ -885,6 +896,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event) //固井 menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑固井结论", this, &QMyCustomPlot::onEditGujing); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_Gujing); + menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_Gujing); menu.addAction(QIcon(::GetImagePath() + "development.png"), "合并结论", this, &QMyCustomPlot::MegResult_Gujing); @@ -1295,6 +1307,13 @@ void QMyCustomPlot::addItems_Gujing() PropertyService()->InitCurrentViewInfo(); } +//取消选中 +void QMyCustomPlot::ClearSelectItems_Gujing() +{ + //属性清空 + PropertyService()->InitCurrentViewInfo(); +} + //全部清空 void QMyCustomPlot::DeleteItems_Gujing() { @@ -2445,6 +2464,95 @@ void QMyCustomPlot::s_ChangeLineStyle(QString strUuid, QString strSlfName, QStri } } +//绘制方式 +void QMyCustomPlot::ChangeDrawMethod(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) +{ + if(m_strUuid == strUuid && + m_strSlfName == strSlfName && + m_strWellName == strWellName && + m_strTrackName == strTrackName && + m_strLineName == strLineName) + { + QCPGraph* graph =this->graph(0); + if(graph) + { + //勾选3个 + if(m_bDrawLine && m_bDrawGan && m_bDrawPoint) + { + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsImpulse));//杆状线 + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssCircle)));//圆圈 + } + //勾选2个 + else if(m_bDrawLine && m_bDrawGan && !m_bDrawPoint){//曲线+杆状 + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsImpulse)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssDot))); + } + else if(m_bDrawLine && !m_bDrawGan && m_bDrawPoint){//曲线+点状 + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsLine)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssCircle)));//圆圈 + } + else if(!m_bDrawLine && m_bDrawGan && m_bDrawPoint){//杆状+点状 + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsImpulse)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssCircle)));//圆圈 + } + //勾选1个 + else if(m_bDrawLine && !m_bDrawGan && !m_bDrawPoint)//曲线 + { + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsLine)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssDot))); + } + else if(!m_bDrawLine && m_bDrawGan && !m_bDrawPoint)//杆状 + { + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsImpulse)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssDot))); + } + else if(!m_bDrawLine && !m_bDrawGan && m_bDrawPoint)//点状 + { + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsNone)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssCircle)));//圆圈 + } + //勾选0个 + else if(!m_bDrawLine && !m_bDrawGan && !m_bDrawPoint)//曲线 + { + graph->setLineStyle((QCPGraph::LineStyle)(QCPGraph::lsNone)); + graph->setScatterStyle(QCPScatterStyle((QCPScatterStyle::ScatterShape)(QCPScatterStyle::ssNone))); + } + // + replot(); + } + } +} + +//曲线 +void QMyCustomPlot::s_ChangeDrawLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawLine) +{ + m_bDrawLine = bDrawLine; + //绘制方式 + ChangeDrawMethod(strUuid, strSlfName, strWellName, strTrackName, strLineName); +} + +//杆状 +void QMyCustomPlot::s_ChangeDrawGan(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawGan) +{ + m_bDrawGan = bDrawGan; + //绘制方式 + ChangeDrawMethod(strUuid, strSlfName, strWellName, strTrackName, strLineName); +} + +//点状 +void QMyCustomPlot::s_ChangeDrawPoint(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawPoint) +{ + m_bDrawPoint = bDrawPoint; + //绘制方式 + ChangeDrawMethod(strUuid, strSlfName, strWellName, strTrackName, strLineName); +} + +//绘制对称曲线 +void QMyCustomPlot::s_ChangeDrawSymmetry(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawSymmetry) +{ + m_bDrawSymmetry = bDrawSymmetry; +} + //岩性填充-不填充 void QMyCustomPlot::s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) { diff --git a/logPlus/qmycustomplot.h b/logPlus/qmycustomplot.h index b20c2b2..0f240bd 100644 --- a/logPlus/qmycustomplot.h +++ b/logPlus/qmycustomplot.h @@ -66,6 +66,12 @@ public: QString m_strOtherScaleType; QString m_strScaleType="线性";//刻度类型(线性,对数) + //绘制方式 + bool m_bDrawLine = true; // 曲线 + bool m_bDrawGan = false; // 杆状 + bool m_bDrawPoint = false; // 点状 + bool m_bDrawSymmetry = false; // 绘制对称曲线 + QColor m_frontColor;//岩性前景色 QColor m_backColor;//岩性背景色 QString m_newFillMode; @@ -103,13 +109,13 @@ public: int m_nWaveJg = 100; int m_nWaveHei = 1; public: - //分段刷新 QString m_strGroupUid = ""; // 解释结论终止深度 float m_fResultEndDepth = 0.0f; QVector m_x; QVector m_y; int m_iCurNum=0; + //分段刷新 int m_iSplitNum=2000; //2000000; //2000; bool m_addRandomGraph=false;//当前是否绘制曲线 true:是。 bool m_bEditRect=false; //当前是否正在编辑曲线。 @@ -143,7 +149,8 @@ public: QString GetIntResult_Gujing(QString result); void AddTableToWellRound(); //将固井结论表,添加到左侧树图 void addItems_Gujing(); //从剪切板文本数据粘贴 - void DeleteItems_Gujing(); //全部删除 + void ClearSelectItems_Gujing(); //取消选中 + void DeleteItems_Gujing(); //全部清空 void RefreshItems_Gujing(); //刷新数据 void MegResult_Gujing(); //合并结论 bool CopyToSLFFile(QString targetSLFFileName, bool deleteFromSrc, char*newCurveName); @@ -208,6 +215,18 @@ public slots: void s_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width); //线型 void s_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle); + + //绘制方式 + void ChangeDrawMethod(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); + //曲线 + void s_ChangeDrawLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawLine); + //杆状 + void s_ChangeDrawGan(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, bool bDrawGan); + //点状 + 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_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); //岩性填充-填充