岩心分析 属性读取json

This commit is contained in:
crqiqi77 2026-03-27 18:06:40 +08:00
parent 67aa780e4d
commit b953c11135
11 changed files with 271 additions and 63 deletions

View File

@ -182,6 +182,9 @@ signals:
//改变深度属性
void sig_changeDepthProperty(QVariantList vlist);
//改变岩心分析
void sig_changeCorePhysicsProperty(QVariantList vlist);
//右键--添加分段线
void sig_AddShiftLine(QString strUuid, double left_Low, double right_Hight);
//校深线段

View File

@ -284,7 +284,7 @@ void PropertyWidget::changedYxzpItemProperty(QtProperty *qtProperty, const QVari
}
}
void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QVariant &variant)
void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QVariant &variant, bool isItem)
{
if("例区高度" == m_propertyData[qtProperty])
{
@ -297,6 +297,9 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV
int temp = variant.toInt();
this->m_formInfo->m_cp_lineWidth = temp;
this->m_tdCorePhysics->setCpLineWidth(temp);
QVariantList listCond;
emit CallManage::getInstance()->sig_changeCorePhysicsProperty(listCond);
}
else if("颜色" == m_propertyData[qtProperty])
{
@ -517,7 +520,10 @@ void PropertyWidget::changedCorePhysicsProperty(QtProperty *qtProperty, const QV
this->m_tdCorePhysics->setCpCurveScale(temp);
}
this->m_tdCorePhysics->update();
if(isItem)
{
this->m_tdCorePhysics->update();
}
}
void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant &variant )
@ -983,11 +989,17 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
CommonPropertyChanged(pProperty, variant);
changedYxzpItemProperty(pProperty, variant);
}
else if (m_strCurrentProperty == CORE_PHYSICS_ITEM_PROPERTY || m_strCurrentProperty == CORE_PHYSICS_PROPERTY) // 岩心分析
else if (m_strCurrentProperty == CORE_PHYSICS_ITEM_PROPERTY) // 岩心分析
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
changedCorePhysicsProperty(pProperty, variant);
changedCorePhysicsProperty(pProperty, variant, true);
}
else if (m_strCurrentProperty == CORE_PHYSICS_PROPERTY) // 岩心分析
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
changedCorePhysicsProperty(pProperty, variant, false);
}
else if (m_strCurrentProperty == SwallCoreItem_Property)
{
@ -3182,7 +3194,7 @@ void PropertyWidget::initLayerItemProperty(TransparentDraggableLayer* tdLayer, d
_CreateVariantPropertyItem("当前项", "岩性", ::GetLithSymbolDir(), VariantManager::filePathTypeId());
}
void PropertyWidget::initGujingProperty(FormInfo *formInfo)
void PropertyWidget:: initGujingProperty(FormInfo *formInfo)
{
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);

View File

@ -242,7 +242,7 @@ public:
void changedDepthProperty(QString strProName, QVariant val);
// 岩心分析
void changedCorePhysicsProperty(QtProperty *pProperty, const QVariant &variant);
void changedCorePhysicsProperty(QtProperty *pProperty, const QVariant &variant, bool isItem = false);
public slots:
void SlotPropertyChanged(QtProperty *property, const QVariant &variant);
void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle);

View File

@ -165,12 +165,19 @@ void TransparentDraggableCorePhysics::onMousePress(QMouseEvent *event)
{
//之前的选中线段,恢复黑色
TransparentDraggableCorePhysics *tmpLine = (TransparentDraggableCorePhysics*)mPlot->m_SelectShiftLine;
tmpLine->qcpItemLine->setPen(QPen(Qt::black));
QPen pen = tmpLine->qcpItemLine->pen();
// pen.setWidth(getCpLineWidth());
pen.setColor(Qt::black); // 线宽
tmpLine->qcpItemLine->setPen(pen);
// tmpLine->qcpItemLine->setPen(QPen(Qt::black));
}
//重新设置选中线段
mPlot->m_SelectShiftLine = this;
qcpItemLine->setPen(QPen(Qt::red));
QPen pen = qcpItemLine->pen();
// pen.setWidth(getCpLineWidth());
pen.setColor(Qt::red);
qcpItemLine->setPen(pen);
double delta = (lY2-m_lY1)/10.0;
if(x < m_lY1+delta)
@ -338,9 +345,12 @@ int TransparentDraggableCorePhysics::getCpLineWidth() const
void TransparentDraggableCorePhysics::setCpLineWidth(int value)
{
this->m_cp_lineWidth = value;
QPen pen = this->qcpItemLine->pen();
pen.setWidth(value); // 线宽
this->qcpItemLine->setPen(pen);
QList<QCPItemLine*> itemLine = this->mPlot->findChildren<QCPItemLine*>();
foreach (QCPItemLine *tracer, itemLine) {
QPen pen = tracer->pen();
pen.setWidth(value); // 线宽
tracer->setPen(pen);
}
}
QColor TransparentDraggableCorePhysics::getCpLineColor() const
@ -351,9 +361,13 @@ QColor TransparentDraggableCorePhysics::getCpLineColor() const
void TransparentDraggableCorePhysics::setCpLineColor(QColor value)
{
this->m_cp_lineColor = value;
QPen pen = this->qcpItemLine->pen();
pen.setColor(value); // 颜色
this->qcpItemLine->setPen(pen);
QList<QCPItemLine*> itemLine = this->mPlot->findChildren<QCPItemLine*>();
foreach (QCPItemLine *tracer, itemLine) {
QPen pen = tracer->pen();
pen.setColor(value);
tracer->setPen(pen);
}
}
Qt::PenStyle TransparentDraggableCorePhysics::getCpLineStyle() const
@ -365,9 +379,12 @@ void TransparentDraggableCorePhysics::setCpLineStyle(Qt::PenStyle value)
{
this->m_cp_lineStyle = value;
QPen pen = this->qcpItemLine->pen();
pen.setStyle(value); // 线形
this->qcpItemLine->setPen(pen);
QList<QCPItemLine*> itemLine = this->mPlot->findChildren<QCPItemLine*>();
foreach (QCPItemLine *tracer, itemLine) {
QPen pen = tracer->pen();
pen.setStyle(value);
tracer->setPen(pen);
}
}
double TransparentDraggableCorePhysics::getCpLeftScale() const

View File

@ -309,11 +309,6 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
tickPen.setWidth(temp);
curv->yAxis->setSubTickPen(tickPen);
}
}
else if("plObject" == strType)
{
@ -438,6 +433,11 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
//固井结论/井壁取心/录井剖面/文字结论/地质分层
DisplayTable_One(lineObjInfo);
}
else if (strLineName == "CORE_PHYSICS")
{
// 岩心分析
displayCorePhysics(lineObjInfo);
}
}
else if (strType == "JiegutextObject")
{
@ -490,6 +490,88 @@ void FormDraw::DisplayDepth_One(QJsonObject objInfo)
this->setDrawData(dt, objInfo);
}
// 岩心分析
void FormDraw::displayCorePhysics(QJsonObject jsonObject)
{
QStringList listOtherProperty;
QString strSlfName;
QString strWellName;
QString strType = jsonObject.value("Type").toString();
QString strLineName = jsonObject.value("LineName").toString();
if (jsonObject.contains("SlfName"))
{
QJsonValue value = jsonObject.value("SlfName");
if (value.isString()) {
strSlfName = value.toString();
QString slffilename = QString("");
int ind = strSlfName.lastIndexOf('\\');
int ind2 = strSlfName.lastIndexOf('/');
if (ind2 > ind) ind = ind2;
if (ind > -1) {
slffilename = strSlfName.mid(ind + 1);
strSlfName = slffilename;
}
}
}
if (jsonObject.contains("WellName"))
{
QJsonValue value = jsonObject.value("WellName");
if (value.isString()) {
strWellName = value.toString();
//qDebug() << "WellName:" << strWellName;
}
}
QString folderPath = GetLogdataPath();
folderPath = folderPath + g_prjname;
strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName;
listOtherProperty.append(strSlfName);
// 例区高度
if (jsonObject.contains("headHeight"))
{
int value = jsonObject.value("headHeight").toInt();
listOtherProperty.append(QString::number(value));
}
// 旋转角度
if (jsonObject.contains("RotationAngle"))
{
int value = jsonObject.value("RotationAngle").toInt();
listOtherProperty.append(QString::number(value));
}
// 显示名称
if (jsonObject.contains("AliasName"))
{
QJsonValue value = jsonObject.value("AliasName");
if (value.isString()) {
listOtherProperty.append(value.toString());
}
}
// 线宽
if (jsonObject.contains("lineWidth"))
{
int value = jsonObject.value("lineWidth").toInt();
listOtherProperty.append(QString::number(value));
}
// 线条颜色
if (jsonObject.contains("lineColor"))
{
QJsonValue value = jsonObject.value("lineColor");
listOtherProperty.append(value.toString());
}
// 线型
if (jsonObject.contains("lineStyle"))
{
int value = jsonObject.value("lineStyle").toInt();
listOtherProperty.append(QString::number(value));
}
this->addTableLine(m_strUuid, m_strSlfName, m_strWellName, m_strTrackName, strLineName, listOtherProperty);
}
//表格:固井结论等
void FormDraw::DisplayTable_One(QJsonObject lineObjInfo)
{
@ -2437,17 +2519,29 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri
}
else if (strLineName == "CORE_PHYSICS")
{
//岩心实验数据
initCorePhysics(curv, strSlfName, strLineName);
// 岩心分析
if(listOtherProperty.size() >= 1)
{
initCorePhysics(curv, strSlfName, strLineName, listOtherProperty);
}
else
{
initCorePhysics(curv, strSlfName, strLineName);
}
}
else if (strLineName == "IMAGE_DATA")
{
//岩心图片
initIMAGE_DATA(curv, strSlfName, strLineName);
// 岩心图片
if(listOtherProperty.size() >= 1)
{
initIMAGE_DATA(curv, strSlfName, strLineName, listOtherProperty);
}
else
{
initIMAGE_DATA(curv, strSlfName, strLineName);
}
}
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
//
m_listTableName.push_back(strLineName);
return curv;
@ -5110,7 +5204,7 @@ void FormDraw::initLayer(QMyCustomPlot *widget, QString strSlfName, QString strL
}
void FormDraw::initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
void FormDraw::initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QStringList stringList)
{
int iMyWidth = widget->axisRect(0)->width();
@ -6568,18 +6662,11 @@ void FormDraw::initTDT(QMyCustomPlot *curv)
// curv->replot();
}
//岩心实验数据
void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
// 岩心分析
void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QStringList stringList)
{
float vmax = 100;
float vmin = 0;
// QTimer::singleShot(0, widget, [=]() {
// widget->addCorePhysicsWithParam(0,-2,-2,20);
// });
//赋值
m_vmax = vmax;
m_vmin = vmin;
@ -6638,19 +6725,7 @@ void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QStrin
widget->yAxis2->setTicker(textTicker);
// 创建固定刻度器 - 刻度位置和标签完全由你控制
// QSharedPointer<QCPAxisTickerFixed> fixedTicker(new QCPAxisTickerFixed);
// fixedTicker->setTickStep(10.0); // 固定刻度间隔
// widget->yAxis2->setTicker(fixedTicker);
// 获取当前数据范围
// double lower = widget->yAxis2->range().lower;
// double upper = widget->yAxis2->range().upper;
// widget->yAxis2->setRange(lower - 9, upper + 11);
// double margin = (upper - lower) * 0.05; // 5% 边距
// widget->yAxis2->setRange(lower - margin, upper + margin);
// 加载slf文件 开始
QVector<double> x, y;
Slf_CORE_PHYSICS *m_pResult=NULL;
@ -6728,12 +6803,30 @@ void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QStrin
delete m_pResult;
}
delete logio;
// 加载slf文件结束
QString strAliasName = "岩心实验数据";
QString strUnit = "";
widget->m_bDrawCore_PHYSICS = true;
addRandomGraph(widget, x, y, strSlfName, strLineName, strAliasName, strUnit);
// m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_vmax, m_vmin, strScaleType, "tableObject");
widget->m_bDrawCore_PHYSICS = true;
double newLeftScale=-9999;
double newRightScale=-9999;
QString strScaleType="线性";
QColor lineColor=QColor(0,0,0);
double width=1;
Qt::PenStyle lineStyle=Qt::SolidLine;
addRandomGraph(widget, x, y, strSlfName, strLineName, strAliasName, strUnit,
newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, stringList);
// if(stringList.size() >= 1)
// {
// }
// else
// {
// addRandomGraph(widget, x, y, strSlfName, strLineName, strAliasName, strUnit);
// }
//支持框选------------------
// widget->setSelectionRectMode(QCP::SelectionRectMode::srmSelect);
@ -7704,7 +7797,7 @@ void FormDraw::addRandomGraph(QMyCustomPlot *widget, QVector<double> x, QVector<
if(widget->m_bDrawCore_PHYSICS)
{
//岩心分析特殊处理
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_vmax, m_vmin, strScaleType, "tableObject");
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_vmax, m_vmin, strScaleType, "tableObject", listOtherProperty);
}
else {
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_vmax, m_vmin, strScaleType, "curveObject", listOtherProperty);

View File

@ -62,6 +62,8 @@ public:
void DisplayType_One(QJsonObject objInfo);
// 深度
void DisplayDepth_One(QJsonObject lineObjInfo);
// 岩心分析
void displayCorePhysics(QJsonObject lineObjInfo);
//表格:固井结论等
void DisplayTable_One(QJsonObject lineObjInfo);
@ -220,12 +222,15 @@ public:
void initGujing(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "固井结论", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={});
// 岩心分析
void initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
void initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QStringList listOtherProperty={});
//岩心图片数据
void initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
void initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QStringList listOtherProperty={});
bool LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//深度
void initDepth(QMyCustomPlot *widget);
//频率统计图
void initFgrq(QMyCustomPlot *widget);
//玫瑰图

View File

@ -333,6 +333,7 @@ QJsonObject FormInfo::makeJson()
}
else if (m_strType == "tableObject" && m_strLineName == "CORE_PHYSICS")
{
rootObj["headHeight"] = m_headHeight; // 例区高度
rootObj["lineWidth"] = m_cp_lineWidth; // 线宽
rootObj["lineColor"] = m_cp_lineColor.name(); // 线条颜色
rootObj["lineStyle"] = m_cp_lineStyle; // 线型
@ -895,6 +896,19 @@ void FormInfo::dropEvent(QDropEvent* event)
//QApplication::restoreOverrideCursor();
}
// Get
int FormInfo::cpLineWidth() const
{
return m_cp_lineWidth;
}
// Set
void FormInfo::setCpLineWidth(int cpLineWidth)
{
m_cp_lineWidth = cpLineWidth;
}
//线宽
void FormInfo::setLineWidth(double dWidth)
{

View File

@ -244,6 +244,9 @@ public:
double m_cp_coreValue; // 数值
QString m_cp_fieldName; // 字段名称
int cpLineWidth() const;
void setCpLineWidth(int cpLineWidth);
public:
void setLineWidth(double dWidth);
double getLineWidth();

View File

@ -663,6 +663,61 @@ void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString
}
}
else if(strLineName == "CORE_PHYSICS")
{
if(listOtherProperty.size() >= 1)
{
formInfo->m_strSlfName = listOtherProperty[0];
// 例区高度
formInfo->m_headHeight = listOtherProperty[1].toInt();
formInfo->setFixedHeight(formInfo->m_headHeight);
// 旋转角度
formInfo->m_nRotationAngle = listOtherProperty[2].toInt();
// 显示名称
formInfo->m_strAliasName = listOtherProperty[3];
// 线宽
formInfo->m_cp_lineWidth = listOtherProperty[4].toInt();
// 线条颜色
formInfo->m_cp_lineColor = listOtherProperty[5];
// 线型
Qt::PenStyle newStyle = Qt::SolidLine;
int iStyle = listOtherProperty[6].toInt();
switch(iStyle)
{
case 0:
//无
newStyle = Qt::NoPen;
break;
case 1:
//实线
newStyle = Qt::SolidLine;
break;
case 2:
//虚线
newStyle = Qt::DashLine;
break;
case 3:
//点线
newStyle = Qt::DotLine;
break;
case 4:
//虚点线
newStyle = Qt::DashDotLine;
break;
case 5:
//虚点点线
newStyle = Qt::DashDotDotLine;
break;
default:
break;
}
formInfo->m_cp_lineStyle = newStyle;
QVariantList listCond;
emit CallManage::getInstance()->sig_changeCorePhysicsProperty(listCond);
}
}
//设置高度
ui->tableWidget->setRowHeight(row, 100);
//单元格委托

View File

@ -141,7 +141,9 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString)));
// 深度属性修改
connect(CallManage::getInstance(), SIGNAL(sig_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList)));
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
// 岩心分析
connect(CallManage::getInstance(), SIGNAL(sig_changeCorePhysicsProperty(QVariantList)), this, SLOT(s_changeCorePhysicsProperty(QVariantList)));
//改变固井曲线名
connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString)));
//改变曲线名 //气测/FMT/射孔/文本
@ -4678,8 +4680,6 @@ void QMyCustomPlot::s_changeDrawProperty(QVariantList vlist)
void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
{
QString strUuid = vlist.at(0).toString();
QString strSlfName = vlist.at(1).toString();
QString strWellName = vlist.at(2).toString();
@ -4836,13 +4836,16 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
tickPen.setWidth(temp);
this->yAxis->setSubTickPen(tickPen);
}
this->replot();
}
}
void QMyCustomPlot::s_changeCorePhysicsProperty(QVariantList vlist)
{
qDebug() << "removeSelectedGraph name=";
// m_mapDraggable_CorePhysics
}
//校深线段
void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor)
{

View File

@ -538,6 +538,9 @@ public slots:
// 深度
void s_changeDepthProperty(QVariantList vlist);
// 岩心分析
void s_changeCorePhysicsProperty(QVariantList vlist);
void onAddRect();
//蝌蚪图重绘网格线