支持从模板加载曲线属性信息

This commit is contained in:
jiayulong 2025-11-06 14:43:37 +08:00
parent 45b3b4de88
commit e956a8d469
12 changed files with 239 additions and 101 deletions

View File

@ -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);//删除曲线
//属性
//左刻度

View File

@ -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);
}

View File

@ -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<double> x, QVector<double> 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<double> 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");
}

View File

@ -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<double> x, QVector<double> 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);

View File

@ -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();

View File

@ -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;//岩性背景色

View File

@ -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);

View File

@ -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);
};

View File

@ -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 \

View File

@ -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);
}
}

View File

@ -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();//新建道
//

View File

@ -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; i<count; i++)
{
x.append(-(sdep+ rlev*i));
y.append(m_iX1+m_iX2-val[i]);
if(m_strScaleType=="对数")
{
y.append(log(m_iX1)+log(m_iX2)-log(val[i]));
}
else //if(m_strScaleType=="线性")
{
y.append(m_iX1+m_iX2-val[i]);
}
}
}
//
this->yAxis2->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; i<count; i++)
{
float x0=-(sdep+ rlev*i);
float y0_old=val[i];
float y0 = (iX2_Tmp-iX1_Tmp)*(val[i]-vMin)/(vMax-vMin) + iX1_Tmp;
float y0 = (iX2_Tmp-iX1_Tmp)*(val[i]-vMin_Tmp)/(vMax_Tmp-vMin) + iX1_Tmp;
if(strOtherScaleType=="对数")
{
//其他曲线
y0_old=log(val[i]);
y0 = (iX2_Tmp-iX1_Tmp)*(log(val[i])-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
}
//读取基线
float BaseY0=0;
@ -496,7 +528,13 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
float x1=-(sdep+ rlev*(i+1));
//float y1=val[i+1];
float y1 = (iX2_Tmp-iX1_Tmp)*(val[i+1]-vMin)/(vMax-vMin) + iX1_Tmp;
float y1 = (iX2_Tmp-iX1_Tmp)*(val[i+1]-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
if(strOtherScaleType=="对数")
{
//其他曲线
y1 = (iX2_Tmp-iX1_Tmp)*(log(val[i+1])-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
}
//读取基线
float BaseY1=0;
float BaseY1_Tmp=0;
@ -511,7 +549,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
//基线在左,采用基线值
//y0=BaseY0;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(x0);
y.append(y0_old);
@ -526,7 +564,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
//基线起点在左,采用基线值
//y0=BaseY0;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(x0);
y.append(y0_old);
@ -534,7 +572,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
//插值
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
float yNew=(y0-y1)/(x0-x1)*(xNew-x1) + y1;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(xNew);
y.append(yNew_Old);
@ -548,7 +586,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
//插值
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
float yNew=(BaseY0-BaseY1)/(x0-x1)*(xNew-x1) + BaseY1;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(xNew);
y.append(yNew_Old);
@ -561,7 +599,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
//基线在左,采用基线值
//y0=BaseY0;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
}
x.append(x0);
y.append(y0_old);
@ -571,7 +609,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
delete logio;
//
this->yAxis2->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; i<count; i++)
{
float x0=-(sdep+ rlev*i);
float y0_old=val[i];
float y0 = (iX2_Tmp-iX1_Tmp)*(val[i]-vMin)/(vMax-vMin) + iX1_Tmp;
float y0 = (iX2_Tmp-iX1_Tmp)*(val[i]-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
if(strOtherScaleType=="对数")
{
//其他曲线
y0_old=log(val[i]);
y0 = (iX2_Tmp-iX1_Tmp)*(log(val[i])-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
}
//读取基线
float BaseY0=0;
@ -645,7 +697,13 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
float x1=-(sdep+ rlev*(i+1));
//float y1=val[i+1];
float y1 = (iX2_Tmp-iX1_Tmp)*(val[i+1]-vMin)/(vMax-vMin) + iX1_Tmp;
float y1 = (iX2_Tmp-iX1_Tmp)*(val[i+1]-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
if(strOtherScaleType=="对数")
{
//其他曲线
y1 = (iX2_Tmp-iX1_Tmp)*(log(val[i+1])-vMin_Tmp)/(vMax_Tmp-vMin_Tmp) + iX1_Tmp;
}
//读取基线
float BaseY1=0;
float BaseY1_Tmp=0;
@ -666,7 +724,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
//基线在右,采用基线值
//y0=BaseY0;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(x0);
y.append(y0_old);
@ -680,7 +738,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
//插值
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
float yNew=(y0-y1)/(x0-x1)*(xNew-x1) + y1;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(xNew);
y.append(yNew_Old);
@ -689,7 +747,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
//基线在右,采用基线值
//y0=BaseY0;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(x0);
y.append(y0_old);
@ -697,7 +755,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
//插值
float xNew=x0-rlev*(y0-BaseY0)/((BaseY1-y1)+(y0-BaseY0));//(BaseY1-y1);
float yNew=(BaseY0-BaseY1)/(x0-x1)*(xNew-x1) + BaseY1;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
float yNew_Old=(yNew-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
//
x.append(xNew);
y.append(yNew_Old);
@ -710,7 +768,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
{
//基线在右,采用基线值
//y0=BaseY0;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax-vMin) + vMin;
y0_old = (BaseY0-iX1_Tmp)/(iX2_Tmp-iX1_Tmp)*(vMax_Tmp-vMin_Tmp) + vMin_Tmp;
}
x.append(x0);
y.append(y0_old);
@ -720,7 +778,7 @@ void QMyCustomPlot::s_ChangeFillMode(QString strUuid, QString strSlfName, QStrin
delete logio;
//
this->yAxis2->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; i<count; i++)
{
x.append(-(sdep+ rlev*i));
//newVal = (m_iX2-m_iX1)*(val[i]-vMin)/(vMax-vMin) + m_iX1;
newVal = val[i];
if(strOtherScaleType=="对数")
{
//其他曲线
newVal = log(val[i]);
}
y.append(newVal);
}
this->yAxis2->setRange(m_iY1, m_iY2);
this->xAxis2->setRange(vMin, vMax);
this->xAxis2->setRange(vMin_Tmp, vMax_Tmp);
this->addGraph(yAxis2, xAxis2);
}
}