深度 属性修改

This commit is contained in:
crqiqi77 2026-04-29 15:48:17 +08:00
parent 944a16725d
commit 018bb2d40d
6 changed files with 137 additions and 35 deletions

View File

@ -646,6 +646,22 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
listCond << variant;
emit CallManage::getInstance()->sig_changeTrackProperty(listCond);
}
if("道宽(cm)" == m_propertyData[pProperty])
{
m_strLineName = "深度";
QVariantList listCond;
listCond << m_strUuid;
listCond << m_strSlfName;
listCond << m_strWellName;
listCond << m_strTrackName;
listCond << m_strLineName;
listCond << m_propertyData[pProperty];
listCond << variant;
listCond << m_sdMeasuredDepthPosition;
listCond << m_sdVerticalDepthPosition;
listCond << m_sdElevationVerticalDepthPosition;
emit CallManage::getInstance()->sig_changeDepthProperty(listCond);
}
return;
}
else if (m_strCurrentProperty == Wave_Property)
@ -3166,8 +3182,9 @@ void PropertyWidget::initDepthProperty(FormInfo *formInfo)
_CreateVariantPropertyItem("次刻度线", "次刻度线长度", formInfo->m_sdMinorTickLineLength, QVariant::Int);
_CreateVariantPropertyItem("次刻度线", "次刻度线宽度", formInfo->m_sdMinorTickLineWidth, QVariant::Int);
m_sdMeasuredDepthPosition = formInfo->m_sdMeasuredDepthPosition;
m_sdVerticalDepthPosition = formInfo->m_sdVerticalDepthPosition;
m_sdElevationVerticalDepthPosition = formInfo->m_sdElevationVerticalDepthPosition;
m_strCurrentProperty = Depth_Property;
}
@ -4340,15 +4357,18 @@ void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
}
else if ("斜深位置" == strProperty)
{
this->m_formInfo->m_sdMeasuredDepthPosition = varVal.toInt();
this->m_formInfo->m_sdMeasuredDepthPosition = varVal.toInt();
m_sdMeasuredDepthPosition = varVal.toInt();
}
else if ("垂深位置" == strProperty)
{
this->m_formInfo->m_sdVerticalDepthPosition = varVal.toInt();
this->m_formInfo->m_sdVerticalDepthPosition = varVal.toInt();
m_sdVerticalDepthPosition = varVal.toInt();
}
else if ("海拔垂深位置" == strProperty)
{
this->m_formInfo->m_sdElevationVerticalDepthPosition = varVal.toInt();
this->m_formInfo->m_sdElevationVerticalDepthPosition = varVal.toInt();
m_sdElevationVerticalDepthPosition = varVal.toInt();
}
else if ("垂深" == strProperty)
{

View File

@ -162,6 +162,10 @@ public:
TransparentDraggableGuan* m_tdGuan;
TransparentDraggableCorePhysics* m_tdCorePhysics;
int m_sdMeasuredDepthPosition = 0;
int m_sdVerticalDepthPosition = 0;
int m_sdElevationVerticalDepthPosition = 0;
public:
QWidget* GetPropertyWidget();

View File

@ -5958,8 +5958,9 @@ void FormDraw::initDepth(QMyCustomPlot *curv)
curv->m_yAxis2->setRange(0, 100);
curv->m_yAxis2->setOffset(40);
curv->m_yAxis2->setTickLabelPadding(10);
curv->m_yAxis2->ticker()->setTickCount(60);
curv->m_yAxis2->setTickLabelPadding(5);
}
if(!curv->m_yAxis3)
{
curv->m_yAxis3 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
@ -5967,8 +5968,9 @@ void FormDraw::initDepth(QMyCustomPlot *curv)
curv->m_yAxis3->setRange(0, 100);
curv->m_yAxis3->setOffset(40);
curv->m_yAxis3->setTickLabelPadding(10);
curv->m_yAxis3->ticker()->setTickCount(60);
curv->m_yAxis3->setTickLabelPadding(5);
}
}
void FormDraw::initFgrq(QMyCustomPlot *widget)

View File

@ -151,7 +151,10 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
if(dW <= 0)
dW = g_iOneWidth;
if(strType == "depthObject")
{
dW = 1.2;
}
//增加1列
int columnCount = this->insertColumn(dW);
@ -161,7 +164,9 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
QStringList listTrackName = getTrackNameList();
//
if(strType == "depthObject")
{
strTrackName = "深度";
}
else if(strType == "roseObject")
strTrackName = "玫瑰图" + QString::number(columnCount+1);
else if(strType == "dcaObject")
@ -225,21 +230,9 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
trackTop->m_strUuid = m_strUuid;
trackTop->m_nTrackW = dW;// / static_cast<int>(g_dPixelPerCm);
if(strTrackName.contains("深度"))
{
trackTop->m_nTrackW = 1.2;
QVariantList listCond;
listCond << strUuid;
listCond << strSlfName;
listCond << strWellName;
listCond << columnCount;
listCond << "道宽(cm)";
listCond << "1.2";
emit CallManage::getInstance()->sig_changeTrackProperty(listCond);
}
ui->tableWidget->setCellWidget(i, columnCount, trackTop);
}
else if(i==1)
{
@ -309,6 +302,18 @@ QVector<QWidget *> FormWell::new_track(QStringList listdt, QString strTrackName)
}
}
m_mapFormDraw.insert(formTrack->getTrackUuid(), vec);
if(strTrackName.contains("深度"))
{
QVariantList listCond;
listCond << strUuid;
listCond << strSlfName;
listCond << strWellName;
listCond << columnCount;
listCond << "道宽(cm)";
listCond << "1.2";
emit CallManage::getInstance()->sig_changeTrackProperty(listCond);
}
return vec;
}

View File

@ -3456,7 +3456,7 @@ void MainWindowCurve::s_NewTrack()
void MainWindowCurve::s_NewDepth()
{
int column = -1;
int nW = 2;
int nW = 1.2;
QStringList sret = this->insertCol(nW);
if (sret.length() <= 0)
return;

View File

@ -5412,14 +5412,14 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
this->m_yAxis3->setTickLabels(temp);
this->m_yAxis3->setTickLabelSide(QCPAxis::lsInside);
}
else if ("斜深位置" == strProperty)
else if ("斜深位置" == strProperty || "道宽(cm)" == strProperty)
{
QSize size = this->size(); // 包含宽高的QSize对象
int width2 = size.width();
int center = width2 / 2 - this->yAxis->tickLabelFont().pointSize();
int right = width2 - this->yAxis->tickLabelFont().pointSize() - 5;
int width2 = this->size().width();
QFontMetrics fm(this->yAxis->tickLabelFont());
int h = fm.height();
int center = width2 / 2 - h / 2;
int right = width2 - h - 5;
// 没有直接设置偏移方法 动态计算太麻烦
int temp = varVal.toInt();
switch(temp)
{
@ -5436,8 +5436,14 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
break;
}
}
else if ("垂深位置" == strProperty)
else if ("垂深位置" == strProperty || "道宽(cm)" == strProperty)
{
int width2 = this->size().width();
QFontMetrics fm(this->yAxis->tickLabelFont());
int h = fm.height();
int center = width2 / 2 - h / 2;
int right = width2 - h - 5;
int temp = varVal.toInt();
switch(temp)
{
@ -5447,15 +5453,21 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
break;
case 1:
// 居中
this->m_yAxis3->setTickLabelPadding(30 + 10);
this->m_yAxis3->setTickLabelPadding(center);
break;
case 2:
this->m_yAxis3->setTickLabelPadding(50 + 10);
this->m_yAxis3->setTickLabelPadding(right);
break;
}
}
else if ("海拔垂深位置" == strProperty)
else if ("海拔垂深位置" == strProperty || "道宽(cm)" == strProperty)
{
int width2 = this->size().width();
QFontMetrics fm(this->yAxis->tickLabelFont());
int h = fm.height();
int center = width2 / 2 - h / 2;
int right = width2 - h - 5;
int temp = varVal.toInt();
switch(temp)
{
@ -5465,10 +5477,10 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
break;
case 1:
// 居中
this->m_yAxis2->setTickLabelPadding(30);
this->m_yAxis2->setTickLabelPadding(center);
break;
case 2:
this->m_yAxis2->setTickLabelPadding(50 + 10);
this->m_yAxis2->setTickLabelPadding(right);
break;
}
}
@ -5496,6 +5508,65 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
tickPen.setWidth(temp);
this->yAxis->setSubTickPen(tickPen);
}
if ("道宽(cm)" == strProperty && vlist.size() > 6)
{
int temp1 = vlist.at(7).toInt();
int temp2 = vlist.at(8).toInt();
int temp3 = vlist.at(9).toInt();
int width2 = this->size().width();
QFontMetrics fm(this->yAxis->tickLabelFont());
int h = fm.height();
int center = width2 / 2 - h / 2;
int right = width2 - h - 5;
switch(temp1)
{
case 0:
// 靠左
this->yAxis->setTickLabelPadding(5);
break;
case 1:
// 居中
this->yAxis->setTickLabelPadding(center);
break;
case 2:
this->yAxis->setTickLabelPadding(right);
break;
}
switch(temp2)
{
case 0:
// 偏左
this->m_yAxis3->setTickLabelPadding(5 + 10);
break;
case 1:
// 居中
this->m_yAxis3->setTickLabelPadding(center);
break;
case 2:
this->m_yAxis3->setTickLabelPadding(right);
break;
}
switch(temp3)
{
case 0:
// 偏左
this->m_yAxis2->setTickLabelPadding(5 + 10);
break;
case 1:
// 居中
this->m_yAxis2->setTickLabelPadding(center);
break;
case 2:
this->m_yAxis2->setTickLabelPadding(right);
break;
}
}
this->replot();
}
}