diff --git a/CallManage/CallManage.h b/CallManage/CallManage.h index 6e31821..443d342 100644 --- a/CallManage/CallManage.h +++ b/CallManage/CallManage.h @@ -42,7 +42,7 @@ signals: void sig_NewTrack_No_Line(QString strUuid, QString strWellName, QString strTrackName);//新建空白道,没有曲线 void sig_AddLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);//新建曲线 void sig_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 void sig_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName);//删除曲线 //属性 //左刻度 diff --git a/logPlus/PropertyWidget.cpp b/logPlus/PropertyWidget.cpp index 625908a..341c5d7 100644 --- a/logPlus/PropertyWidget.cpp +++ b/logPlus/PropertyWidget.cpp @@ -487,23 +487,26 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt InitCurrentViewInfo(); m_strUuid = formInfo->m_strUuid; - QString strSlfName = formInfo->m_strSlfName; - QString strWellName = formInfo->m_strWellName; - QString strTrackName = formInfo->m_strTrackName; - QString strLineName = formInfo->m_strLineName; - QColor lineColor = formInfo->m_lineColor; - double dWidth = formInfo->m_dWidth; - float vmax = formInfo->m_vmax; - float vmin = formInfo->m_vmin; - QString strScaleType = formInfo->m_strScaleType; - QColor frontColor = formInfo->m_frontColor; - QColor backColor = formInfo->m_backColor; +// QString strSlfName = formInfo->m_strSlfName; +// QString strWellName = formInfo->m_strWellName; +// QString strTrackName = formInfo->m_strTrackName; +// QString strLineName = formInfo->m_strLineName; +// int ilineStyle = formInfo->m_lineStyle; +// QString newHeadFill = formInfo->m_newHeadFill; + +// QColor lineColor = formInfo->m_lineColor; +// double dWidth = formInfo->m_dWidth; +// float vmax = formInfo->m_vmax; +// float vmin = formInfo->m_vmin; +// QString strScaleType = formInfo->m_strScaleType; +// QColor frontColor = formInfo->m_frontColor; +// QColor backColor = formInfo->m_backColor; // - m_strSlfName = strSlfName; - m_strWellName = strWellName; - m_strTrackName = strTrackName; - m_strLineName = strLineName; + m_strSlfName = formInfo->m_strSlfName; + m_strWellName = formInfo->m_strWellName; + m_strTrackName = formInfo->m_strTrackName; + m_strLineName = formInfo->m_strLineName; //其他曲线 m_strListOtherLine.clear(); @@ -520,6 +523,7 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt m_strCurrentProperty = Curve_Property; QStringList listStyle; + listStyle.append("无"); listStyle.append("实线"); listStyle.append("虚线"); listStyle.append("点线"); @@ -539,7 +543,7 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt QStringList listFillType; listFillType.append("岩性模式"); listFillType.append("颜色模式"); - listFillType.append("成像化"); + //listFillType.append("成像化"); // QStringList listFillMode; listFillMode.append("无填充"); @@ -552,25 +556,25 @@ void PropertyWidget::initCurveProperty(FormInfo *formInfo, QStringList strListOt listScaleType.append("对数"); // - _CreateVariantPropertyItem("通常", "井曲线", strLineName + "@"+strSlfName, QVariant::String); + _CreateVariantPropertyItem("通常", "井曲线", m_strLineName + "@"+m_strSlfName, QVariant::String); _CreateVariantPropertyItem("通常", "显示名称", "", QVariant::String); _CreateVariantPropertyItem("通常", "显示单位", "", QVariant::String); // - _CreateVariantPropertyItem("刻度设置", "左刻度", vmin, QVariant::Double); - _CreateVariantPropertyItem("刻度设置", "右刻度", vmax, QVariant::Double); - _CreateEnumPropertyItem("刻度设置", "刻度类型", 0, listScaleType); + _CreateVariantPropertyItem("刻度设置", "左刻度", formInfo->m_vmin, QVariant::Double); + _CreateVariantPropertyItem("刻度设置", "右刻度", formInfo->m_vmax, QVariant::Double); + _CreateEnumPropertyItem("刻度设置", "刻度类型", listScaleType.indexOf(formInfo->m_strScaleType), listScaleType); // - _CreateVariantPropertyItem("曲线线型", "线宽", dWidth, QVariant::Double, 1, 20); - _CreateVariantPropertyItem("曲线线型", "颜色", lineColor, QVariant::Color); - _CreateEnumPropertyItem("曲线线型", "线型", 0, listStyle); + _CreateVariantPropertyItem("曲线线型", "线宽", formInfo->m_dWidth, QVariant::Double, 1, 20); + _CreateVariantPropertyItem("曲线线型", "颜色", formInfo->m_lineColor, QVariant::Color); + _CreateEnumPropertyItem("曲线线型", "线型", (int)formInfo->m_lineStyle, listStyle); // - _CreateEnumPropertyItem("岩性填充", "头部图例", 0, listHeadFill); - _CreateEnumPropertyItem("岩性填充", "目标曲线", 0, listTargetLine); - _CreateEnumPropertyItem("岩性填充", "填充类型", 0, listFillType); - _CreateEnumPropertyItem("岩性填充", "填充模式", 0, listFillMode); - _CreateVariantPropertyItem("岩性填充", "填充颜色", lineColor, QVariant::Color); - _CreateVariantPropertyItem("岩性填充", "填充岩性", "./image/胜利符号库/岩性符号/砂岩.png", VariantManager::filePathTypeId()); + _CreateEnumPropertyItem("岩性填充", "头部图例", listHeadFill.indexOf(formInfo->m_newHeadFill), listHeadFill); + _CreateEnumPropertyItem("岩性填充", "目标曲线", listTargetLine.indexOf(formInfo->m_newTargetLine), listTargetLine); + _CreateEnumPropertyItem("岩性填充", "填充类型", listFillType.indexOf(formInfo->m_newFillType), listFillType); + _CreateEnumPropertyItem("岩性填充", "填充模式", listFillMode.indexOf(formInfo->m_newFillMode), listFillMode); + _CreateVariantPropertyItem("岩性填充", "填充颜色", formInfo->m_newColor, QVariant::Color); + _CreateVariantPropertyItem("岩性填充", "填充岩性", formInfo->m_newLithosImage, VariantManager::filePathTypeId()); //"./image/胜利符号库/岩性符号/砂岩.png" - _CreateVariantPropertyItem("岩性填充", "岩性前景色", frontColor, QVariant::Color); - _CreateVariantPropertyItem("岩性填充", "岩性背景色", backColor, QVariant::Color); + _CreateVariantPropertyItem("岩性填充", "岩性前景色", formInfo->m_frontColor, QVariant::Color); + _CreateVariantPropertyItem("岩性填充", "岩性背景色", formInfo->m_backColor, QVariant::Color); } diff --git a/logPlus/formdraw.cpp b/logPlus/formdraw.cpp index 4196f98..2d667e8 100644 --- a/logPlus/formdraw.cpp +++ b/logPlus/formdraw.cpp @@ -45,8 +45,8 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) : connect(CallManage::getInstance(), SIGNAL(sig_AddLine(QString, QString, QString, QString, QString)), this, SLOT(s_addLine(QString, QString, QString, QString, QString))); - connect(CallManage::getInstance(), SIGNAL(sig_AddLine_Property(QString, QString, QString, QString, QString, double, double, QColor, double, Qt::PenStyle)), - this, SLOT(s_AddLine_Property(QString, QString, QString, QString, QString, double, double, QColor, double, Qt::PenStyle))); + connect(CallManage::getInstance(), SIGNAL(sig_AddLine_Property(QString, QString, QString, QString, QString, double, double, QString, QColor, double, Qt::PenStyle)), + this, SLOT(s_AddLine_Property(QString, QString, QString, QString, QString, double, double, QString, QColor, double, Qt::PenStyle))); connect(CallManage::getInstance(), SIGNAL(sig_delLine(QString, QString, QString, QString)), this, SLOT(s_delLine(QString, QString, QString, QString))); connect(CallManage::getInstance(), SIGNAL(sig_MouseMove(QString, QString, QString, float)), this, SLOT(s_MouseMove(QString, QString, QString, float))); } @@ -134,9 +134,8 @@ void FormDraw::s_addLine(QString strUuid, QString strSlfName, QString strWellNam } void FormDraw::s_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle) { - //井名&道名不一致 if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName) { @@ -185,7 +184,7 @@ AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property"); curv->show(); initForm(curv, strSlfName, strLineName, - newLeftScale, newRightScale, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); @@ -457,7 +456,7 @@ void FormDraw::s_selectionRectAccepted(const QRect &rect, QMouseEvent *event) } void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName, - double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle) { //AppendConsole(PAI_INFO, "FormDraw initForm"); @@ -554,7 +553,7 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi widget->m_iY2 = g_iY2; // widget->xAxis->setRange(vmin, vmax); - widget->yAxis->setRange(g_iY1, g_iY2); + widget->yAxis->setRange(g_iY1, g_iY2); widget->axisRect()->setupFullAxesBox(); // widget->xAxis->ticker()->setTickCount(10);//x个主刻度 @@ -565,7 +564,15 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi QCPAxis *xAxis = widget->xAxis; widget->xAxis = yAxis; widget->yAxis = xAxis; - + // + if(strScaleType=="对数") + { + widget->yAxis->setScaleType(QCPAxis::stLogarithmic); + } + else //if(m_strScaleType=="线性") + { + widget->yAxis->setScaleType(QCPAxis::stLinear); + } // // // widget->yAxis->setRange(vmin, vmax); @@ -586,7 +593,7 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi if(newLeftScale!=-9999) { addRandomGraph(widget, x, y, strSlfName, strLineName, - newLeftScale, newRightScale, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); } else { addRandomGraph(widget, x, y, strSlfName, strLineName); @@ -602,7 +609,7 @@ void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLi } void FormDraw::addRandomGraph(QMyCustomPlot *widget, QVector x, QVector y, QString strSlfName, QString strLineName, - double newLeftScale, double newRightScale, QColor newlineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor newlineColor, double width, Qt::PenStyle lineStyle) { //AppendConsole(PAI_INFO, "FormDraw addRandomGraph"); @@ -652,7 +659,7 @@ void FormDraw::addRandomGraph(QMyCustomPlot *widget, QVector x, QVector< //widget->replot(); } //道-对象 - m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, newlineColor, width, m_vmax, m_vmin); + m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, newlineColor, width, m_vmax, m_vmin, strScaleType); //AppendConsole(PAI_INFO, "FormDraw addRandomGraph end"); } diff --git a/logPlus/formdraw.h b/logPlus/formdraw.h index 3bbdc4a..47b3b0a 100644 --- a/logPlus/formdraw.h +++ b/logPlus/formdraw.h @@ -51,9 +51,9 @@ public: public: void initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName, - double newLeftScale=-9999, double newRightScale=-9999, QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine); + double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine); void addRandomGraph(QMyCustomPlot *widget, QVector x, QVector y, QString strSlfName, QString strLineName, - double newLeftScale=-9999, double newRightScale=-9999, QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine); + double newLeftScale=-9999, double newRightScale=-9999, QString strScaleType="线性", QColor lineColor=QColor(0,0,0), double width=1, Qt::PenStyle lineStyle=Qt::SolidLine); void setupLineStyleDemo(QMyCustomPlot *customPlot); void setupSelectionDemo(QMyCustomPlot *customPlot); @@ -64,7 +64,7 @@ signals: public slots: void s_addLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); void s_AddLine_Property(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 void s_delLine(QString strUuid, QString strWellName, QString strTrackName, QString strLineName); void s_MouseMove(QString strUuid, QString strWellName, QString strTrackName, float dep); diff --git a/logPlus/forminfo.cpp b/logPlus/forminfo.cpp index 53f8710..a851bab 100644 --- a/logPlus/forminfo.cpp +++ b/logPlus/forminfo.cpp @@ -79,15 +79,28 @@ QJsonObject FormInfo::makeJson() rootObj["lineStyle"] = m_lineStyle; rootObj["vmax"] = m_vmax; rootObj["vmin"] = m_vmin; + rootObj["ScaleType"] = m_strScaleType; //岩性填充 rootObj["newFillMode"] = m_newFillMode; rootObj["newHeadFill"] = m_newHeadFill; + rootObj["newTargetLine"] = m_newTargetLine; rootObj["newFillType"] = m_newFillType; + //填充颜色 rootObj["newColorRed"] = m_newColor.red(); rootObj["newColorGreen"] = m_newColor.green(); rootObj["newColorBlue"] = m_newColor.blue(); rootObj["newColorAlpha"] = m_newColor.alpha(); rootObj["newLithosImage"] = m_newLithosImage; + //岩性前景色 + rootObj["frontColorRed"] = m_frontColor.red(); + rootObj["frontColorGreen"] = m_frontColor.green(); + rootObj["frontColorBlue"] = m_frontColor.blue(); + rootObj["frontColorAlpha"] = m_frontColor.alpha(); + //岩性背景色 + rootObj["backColorRed"] = m_backColor.red(); + rootObj["backColorGreen"] = m_backColor.green(); + rootObj["backColorBlue"] = m_backColor.blue(); + rootObj["backColorAlpha"] = m_backColor.alpha(); return rootObj; } @@ -405,14 +418,17 @@ void FormInfo::s_ChangeFillMode(QString strUuid, QString strSlfName, QString str m_strTrackName == strTrackName && m_strLineName == strLineName) { - m_newFillMode = newFillMode;//"填充"; - m_newHeadFill = newHeadFill; m_newFillType = newFillType; + m_newTargetLine = newTargetLine; m_newColor = newColor; m_newLithosImage = newLithosImage; - + m_newHeadFill = newHeadFill; + m_new_vMin = vMin; + m_new_vMax = vMax; + m_strOtherScaleType = strOtherScaleType; m_frontColor = frontColor; m_backColor = backColor; + m_newFillMode = newFillMode;//"填充"; update(); diff --git a/logPlus/forminfo.h b/logPlus/forminfo.h index ddbec4e..516fa62 100644 --- a/logPlus/forminfo.h +++ b/logPlus/forminfo.h @@ -60,21 +60,25 @@ public: QString m_strWellName; QString m_strTrackName; QString m_strLineName; - QColor m_lineColor; // - double m_dWidth; - Qt::PenStyle m_lineStyle; + double m_dWidth;//线宽 + QColor m_lineColor;//颜色 + Qt::PenStyle m_lineStyle;//线形 //X坐标 - float m_vmax; - float m_vmin; + float m_vmin;//左刻度 + float m_vmax;//右刻度 QString m_strScaleType;//刻度类型(线性,对数) //岩性填充 - QString m_newFillMode; - QString m_newHeadFill; - QString m_newFillType; + QString m_newHeadFill;//头部图例 + QString m_newTargetLine;//目标曲线 + QString m_newFillType;//填充类型 + QString m_newFillMode;//填充模式 QColor m_newColor;//填充颜色 QString m_newLithosImage = "";//岩性图片 + float m_new_vMin;//其他目标曲线 + float m_new_vMax;//其他目标曲线 + QString m_strOtherScaleType;//其他目标曲线,刻度类型(线性,对数) QColor m_frontColor;//岩性前景色 QColor m_backColor;//岩性背景色 diff --git a/logPlus/formtrack.cpp b/logPlus/formtrack.cpp index 61bdc72..fe6a96e 100644 --- a/logPlus/formtrack.cpp +++ b/logPlus/formtrack.cpp @@ -39,8 +39,8 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName) header->setSectionResizeMode(i, QHeaderView::Stretch); } - connect(this, SIGNAL(sig_AddLine(QString, QString, QString, QString, QColor, double, float, float)), - this, SLOT(s_addLine(QString, QString, QString, QString, QColor, double, float, float))); + connect(this, SIGNAL(sig_AddLine(QString, QString, QString, QString, QColor, double, float, float, QString)), + this, SLOT(s_addLine(QString, QString, QString, QString, QColor, double, float, float, QString))); //曲线选中,置顶 connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString))); @@ -66,15 +66,15 @@ FormTrack::~FormTrack() delete ui; } -void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin) +void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType) { qDebug()<< "Add"; - emit sig_AddLine(strSlfName, strWellName, m_strTrackName, strLineName, lineColor, dWidth, vmax, vmin); + emit sig_AddLine(strSlfName, strWellName, m_strTrackName, strLineName, lineColor, dWidth, vmax, vmin, strScaleType); } -void FormTrack::s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin) +void FormTrack::s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType) { qDebug() << "FormTrack s_addLine"; @@ -85,6 +85,7 @@ void FormTrack::s_addLine(QString strSlfName, QString strWellName, QString strTr //曲线信息栏 FormInfo *formInfo = new FormInfo(this, strSlfName, strWellName, strTrackName, strLineName, lineColor); formInfo->m_strUuid = m_strUuid; + formInfo->m_strScaleType = strScaleType; formInfo->setLineWidth(dWidth); formInfo->setVMax(vmax); formInfo->setVMin(vmin); diff --git a/logPlus/formtrack.h b/logPlus/formtrack.h index c8b3297..6f8c7fe 100644 --- a/logPlus/formtrack.h +++ b/logPlus/formtrack.h @@ -60,15 +60,15 @@ public: //NoLRBorderDelegate *m_delegate; public: - void Add(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin); + void Add(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); QJsonObject makeJson(); signals: - void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin); + void sig_AddLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); public slots: - void s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin); + void s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType); void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName); }; diff --git a/logPlus/logPlus.pro b/logPlus/logPlus.pro index 4f4c0d1..f41a6cc 100644 --- a/logPlus/logPlus.pro +++ b/logPlus/logPlus.pro @@ -37,7 +37,6 @@ SOURCES += \ customtabbar.cpp \ customtabwidget.cpp \ fileedit.cpp \ - fileopenthread.cpp \ formdraw.cpp \ formhead.cpp \ forminfo.cpp \ @@ -75,7 +74,6 @@ HEADERS += \ customtabbar.h \ customtabwidget.h \ fileedit.h \ - fileopenthread.h \ formdraw.h \ formhead.h \ forminfo.h \ diff --git a/logPlus/mainwindowcurve.cpp b/logPlus/mainwindowcurve.cpp index 7842b3d..a3afbd7 100644 --- a/logPlus/mainwindowcurve.cpp +++ b/logPlus/mainwindowcurve.cpp @@ -459,10 +459,10 @@ void MainWindowCurve::s_NewTrack_No_Line(QString strWellName, QString strTrackNa //新建曲线,带属性 void MainWindowCurve::s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle) + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle) { emit CallManage::getInstance()->sig_AddLine_Property(m_strUuid, strSlfName, strWellName, strTrackName, strLineName, - newLeftScale, newRightScale, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); } //新建井+道+曲线(首条) @@ -1129,11 +1129,26 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo) QString strWellName = ""; QString strTrackName = ""; QString strLineName = ""; - double newLeftScale = 0; - double newRightScale = 500; - QColor lineColor = QColor(0,0,0); - double width = 3; - Qt::PenStyle lineStyle = Qt::SolidLine; + // + double newLeftScale = 0;//左刻度 + double newRightScale = 500;//右刻度 + QString strScaleType;//刻度类型(线性,对数) + // + double width = 3;//线宽 + QColor lineColor = QColor(0,0,0);//颜色 + Qt::PenStyle lineStyle = Qt::SolidLine;//线形 + //岩性填充 + QString newHeadFill;//头部图例 + QString newTargetLine;//目标曲线 + QString newFillType;//填充类型 + QString newFillMode;//填充模式 + QColor newColor;//填充颜色 + QString newLithosImage = "";//岩性图片 + float new_vMin;//其他目标曲线 + float new_vMax;//其他目标曲线 + QString strOtherScaleType;//其他目标曲线,刻度类型(线性,对数) + QColor frontColor;//岩性前景色 + QColor backColor;//岩性背景色 if (lineObjInfo.contains("SlfName")) { @@ -1184,6 +1199,14 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo) qDebug() << "vmax:" << QString::number(newRightScale); } } + if (lineObjInfo.contains("ScaleType")) + { + QJsonValue value = lineObjInfo.value("ScaleType"); + if (value.isString()) { + strScaleType = value.toString(); + qDebug() << "ScaleType:" << strScaleType; + } + } if (lineObjInfo.contains("Width")) { QJsonValue value = lineObjInfo.value("Width"); @@ -1242,6 +1265,20 @@ void MainWindowCurve::DisplayLine_One(QJsonObject lineObjInfo) { //新建曲线 s_AddLine_Property(strSlfName, strWellName, strTrackName, strLineName, - newLeftScale, newRightScale, lineColor, width, lineStyle); + newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle); + } + + //--------------- + + // + if(newFillMode=="无填充") + { + //emit CallManage::getInstance()->sig_ClearFillMode(m_strUuid, strSlfName, strWellName, strTrackName, strLineName); + } + else //if(newFillMode=="填充") + { + emit CallManage::getInstance()->sig_ChangeFillMode(m_strUuid, strSlfName, strWellName, strTrackName, strLineName, + newFillType, newTargetLine, newColor, newLithosImage, newHeadFill, + new_vMin, new_vMax, strOtherScaleType, frontColor, backColor, newFillMode); } } diff --git a/logPlus/mainwindowcurve.h b/logPlus/mainwindowcurve.h index 2880349..14ef464 100644 --- a/logPlus/mainwindowcurve.h +++ b/logPlus/mainwindowcurve.h @@ -85,7 +85,7 @@ public slots: void s_NewTrackChangeWidth(QString strWellName);//新建道后,改变井宽 void s_NewTrack_No_Line(QString strWellName, QString strTrackName);//新建空白道,没有曲线 void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, - double newLeftScale, double newRightScale, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 + double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性 void s_NewTrack();//新建道 // diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 85dbc76..be00f67 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -371,28 +371,28 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin if(newTargetLine=="左界道") { - this->addGraph(); - x.append(m_iY1); y.append(m_iX1); // x.append(m_iY2); y.append(m_iX1); + + // + this->addGraph(); } else if(newTargetLine=="右界道") { - this->addGraph(); - x.append(m_iY1); y.append(m_iX2); // x.append(m_iY2); y.append(m_iX2); + + // + this->addGraph(); } else if(newTargetLine=="对称线") { - this->addGraph(); - CLogIO *logio=new CLogIO(); logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead); int index=logio->OpenCurve(strLineName.toStdString().c_str()); @@ -421,11 +421,29 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin for(int i=0; iyAxis2->setRange(m_iY1, m_iY2); + if(m_strScaleType=="对数") + { + this->xAxis2->setRange(log(m_iX1), log(m_iX2)); + } + else //if(m_strScaleType=="线性") + { + this->xAxis2->setRange(m_iX1, m_iX2); + } + this->addGraph(yAxis2, xAxis2); } - else + else//其他曲线 { if(newFillMode=="左填充") { @@ -474,12 +492,26 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin //读完基线再关闭 // delete logio; + float vMax_Tmp=vMax; + float vMin_Tmp=vMin; + if(strOtherScaleType=="对数") + { + vMax_Tmp=log(vMax); + vMin_Tmp=log(vMin); + } + float newVal = 0.0; for(int i=0; iyAxis2->setRange(m_iY1, m_iY2); - this->xAxis2->setRange(vMin, vMax); + this->xAxis2->setRange(vMin_Tmp, vMax_Tmp); this->addGraph(yAxis2, xAxis2); } } @@ -623,12 +661,26 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin //读完基线再关闭 // delete logio; + float vMax_Tmp=vMax; + float vMin_Tmp=vMin; + if(strOtherScaleType=="对数") + { + vMax_Tmp=log(vMax); + vMin_Tmp=log(vMin); + } + float newVal = 0.0; for(int i=0; iyAxis2->setRange(m_iY1, m_iY2); - this->xAxis2->setRange(vMin, vMax); + this->xAxis2->setRange(vMin_Tmp, vMax_Tmp); this->addGraph(yAxis2, xAxis2); } } @@ -754,16 +812,29 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin logio->CloseCurve(index); delete logio; + float vMax_Tmp=vMax; + float vMin_Tmp=vMin; + if(strOtherScaleType=="对数") + { + vMax_Tmp=log(vMax); + vMin_Tmp=log(vMin); + } + float newVal = 0.0; for(int i=0; iyAxis2->setRange(m_iY1, m_iY2); - this->xAxis2->setRange(vMin, vMax); + this->xAxis2->setRange(vMin_Tmp, vMax_Tmp); this->addGraph(yAxis2, xAxis2); } }