深度属性

This commit is contained in:
crqiqi77 2026-03-20 09:10:07 +08:00
parent b146ad5857
commit 729f608f89
8 changed files with 177 additions and 27 deletions

View File

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

View File

@ -1257,7 +1257,17 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
{
//先处理通用属性
CommonPropertyChanged(pProperty, variant);
changedDepthProperty(pProperty, variant);
// changedDepthProperty(pProperty, variant);
QVariantList listCond;
listCond << m_strUuid;
listCond << m_strSlfName;
listCond << m_strWellName;
listCond << m_strTrackName;
listCond << m_strLineName;
listCond << m_propertyData[pProperty];
listCond << variant;
emit CallManage::getInstance()->sig_changeDepthProperty(listCond);
}
if("深度比例尺" == m_propertyData[pProperty])
@ -2379,32 +2389,32 @@ void PropertyWidget::initTableProperty(FormInfo *formInfo)
void PropertyWidget::initDepthProperty(FormInfo *formInfo)
{
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_bVerticaDrawing, QVariant::Bool);
_CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool);
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
_CreateVariantPropertyItem("通常", "显示单位", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_lineColor, QVariant::Color);
_CreateVariantPropertyItem("字体", "名称", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("字体", "字体", formInfo->m_curveNameFont, QVariant::Font);//名称
_CreateVariantPropertyItem("字体", "单位", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "字体", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("深度标注", "旋转", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::Double);
_CreateVariantPropertyItem("深度标注", "标注字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("深度标注", "旋转(°)", formInfo->m_nJg, QVariant::Double);
_CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_nJg, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_nJg, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_nJg, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_nJg, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_strAliasName, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "斜深位置", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "垂深位置", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "海拔垂深位置", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("主刻度线", "长度", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("主刻度线", "宽度", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("主刻度线", "主刻度线长度", formInfo->m_nJg, QVariant::Double);
_CreateVariantPropertyItem("主刻度线", "主刻度线宽度", formInfo->m_nJg, QVariant::Double);
_CreateVariantPropertyItem("次刻度线", "长度", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("次刻度线", "宽度", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("次刻度线", "次刻度线长度", formInfo->m_nJg, QVariant::Double);
_CreateVariantPropertyItem("次刻度线", "次刻度线宽度", formInfo->m_nJg, QVariant::Double);
m_strCurrentProperty = Depth_Property;
}
@ -3219,5 +3229,16 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo)
void PropertyWidget::changedDepthProperty(QtProperty *pProperty, const QVariant &variant)
{
if("长度" == m_propertyData[pProperty])
{
int height = variant.toInt();
m_formInfo->update();
}
else if("长度" == m_propertyData[pProperty])
{
int height = variant.toInt();
m_formInfo->update();
}
}

View File

@ -145,6 +145,7 @@ public:
TransparentDraggableRect* m_tdText;
TransparentDraggableLayer* m_tdLayer;
TransparentDraggableJiegutext* m_tdJiegutext;
QMyCustomPlot m_depthMyCustomPlot;
public:
QWidget* GetPropertyWidget();

View File

@ -4369,25 +4369,54 @@ void FormDraw::initGujing(QMyCustomPlot *widget, QString strSlfName, QString str
void FormDraw::initDepth(QMyCustomPlot *curv)
{
curv->xAxis->setTicks(false);
curv->xAxis->setSubTicks(false);
curv->xAxis->setTickLabels(false);
curv->yAxis->setTickLabels(true);
curv->yAxis->setTickLabelSide(QCPAxis::lsInside);
QFont font1("微软雅黑", 16); //fontSize 10
QFont font1("微软雅黑", 16); //fontSize 16
curv->yAxis->setTickLabelFont(font1);
curv->yAxis->setRange(m_iY1, m_iY2);
curv->axisRect()->setupFullAxesBox();
//
// curv->xAxis->ticker()->setTickCount(10);//x个主刻度
// curv->yAxis->ticker()->setTickCount(60);//y个主刻度
curv->yAxis->ticker()->setTickCount(60);//y个主刻度
curv->m_bX2Y = false;
//对调XY轴在最前面设置
QCPAxis *yAxis = curv->yAxis;
QCPAxis *xAxis = curv->xAxis;
curv->xAxis = yAxis;
curv->yAxis = xAxis;
// QCPAxis *yAxis = curv->yAxis;
// QCPAxis *xAxis = curv->xAxis;
// curv->xAxis = yAxis;
// curv->yAxis = xAxis;
}
//void FormDraw::initDepth(QMyCustomPlot *curv)
//{
// curv->xAxis->setTicks(true); // 显示X轴主刻度默认true
// curv->yAxis->setTicks(false); // 隐藏Y轴主刻度
// curv->xAxis->setSubTicks(true); // 显示X轴副刻度
// curv->yAxis->setSubTicks(false); // 隐藏Y轴副刻度
// curv->xAxis->setTickLabels(true);
// curv->yAxis->setTickLabels(false);
// curv->xAxis->setTickLabelSide(QCPAxis::lsInside);
//// curv->yAxis->setTickLabelSide(QCPAxis::lsInside);
// curv->xAxis->setTickLength(25, 0); // X轴主刻度内侧15px外侧0px隐藏
//// curv->yAxis->setTickLength(25, 0);
// QPen tickPen;
// tickPen.setColor(Qt::red); // 主刻度颜色(红色)
// tickPen.setWidth(2); // 主刻度线宽2像素
// tickPen.setStyle(Qt::SolidLine); // 刻度线样式实线可选虚线Qt::DashLine
// curv->xAxis->setTickPen(tickPen); // 应用到X轴主刻度
// //对调XY轴在最前面设置
// QCPAxis *yAxis = curv->yAxis;
// QCPAxis *xAxis = curv->xAxis;
// curv->xAxis = yAxis;
// curv->yAxis = xAxis;
//}
void FormDraw::initFgrq(QMyCustomPlot *widget)
{
widget->m_iX1 = 0;

View File

@ -292,7 +292,7 @@ FormInfo* FormTrack::setDrawDt(QStringList listdt, QJsonObject obj)
{
if ("depthObject" == strType)
{
strAliasName = "深度";
strAliasName = "深度22";
}
else if ("plObject" == strType)
{

View File

@ -2429,7 +2429,8 @@ void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName)
//增加1列
ui->tableWidget_2->setColumnCount(columnCount+1);
}
else {
else
{
//增加1列(空白)
ui->tableWidget_2->setColumnCount(columnCount+1);
//设置列宽

View File

@ -135,6 +135,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
//Plot重新加载数据
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_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString)));
@ -4501,6 +4502,98 @@ 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();
QString strTrackName = vlist.at(3).toString();
QString strLineName = vlist.at(4).toString();
if (m_strUuid == strUuid &&
m_strSlfName == strSlfName &&
m_strWellName == strWellName &&
m_strTrackName == strTrackName &&
m_strLineName == strLineName)
{
QString strProperty = vlist.at(5).toString();
QVariant varVal = vlist.at(6).toString();
if ("主刻度线长度" == strProperty)
{
double height = varVal.toDouble();
this->yAxis->setTickLength(height, 0);
// QPen tickPen;
// tickPen.setColor(Qt::green); // 主刻度颜色(红色)
// tickPen.setWidth(2); // 主刻度线宽2像素
// tickPen.setStyle(Qt::SolidLine); // 刻度线样式实线可选虚线Qt::DashLine
// this->xAxis->setTickPen(tickPen); // 应用到X轴主刻度
}
else if ("主刻度线宽度" == strProperty)
{
double temp = varVal.toDouble();
QPen tickPen = this->yAxis->tickPen();
// 4. 仅修改画笔宽度(核心:不改动其他属性)
tickPen.setWidth(temp);
// 5. 重新应用画笔到主刻度(仅影响主刻度)
this->yAxis->setTickPen(tickPen);
}
else if ("次刻度线长度" == strProperty)
{
double temp = varVal.toDouble();
this->yAxis->setSubTickLength(temp, 0);
}
else if ("次刻度线宽度" == strProperty)
{
double temp = varVal.toDouble();
QPen tickPen = this->yAxis->subTickPen();
// 4. 仅修改画笔宽度(核心:不改动其他属性)
tickPen.setWidth(temp);
// 5. 重新应用画笔到主刻度(仅影响主刻度)
this->yAxis->setSubTickPen(tickPen);
}
else if ("标尺颜色" == strProperty)
{
QColor newColor = varVal.value<QColor>();
this->yAxis->setTickLabelColor(newColor);
}
else if ("间隔" == strProperty)
{
double temp = varVal.toDouble();
// 创建固定间隔刻度器
QSharedPointer<QCPAxisTickerFixed> fixedTicker(new QCPAxisTickerFixed);
// 设置刻度间隔为50
fixedTicker->setTickStep(temp);
// 设置刻度步长策略为固定值
fixedTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone);
// 应用到Y轴
this->yAxis->setTicker(fixedTicker);
}
else if ("标注字体" == strProperty)
{
QFont newFont = varVal.value<QFont>();
this->yAxis->setTickLabelFont(newFont);
}
else if ("旋转(°)" == strProperty)
{
double temp = varVal.toDouble();
this->yAxis->setTickLabelRotation(temp);
}
else if ("斜深" == strProperty)
{
bool temp = varVal.toBool();
this->yAxis->setTickLabels(temp);
}
this->replot();
}
}
void QMyCustomPlot::addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor)
{
QtCommonClass *qtCommon = new QtCommonClass(this);

View File

@ -493,6 +493,8 @@ public slots:
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
void s_changeDrawProperty(QVariantList vlist);
// 深度
void s_changeDepthProperty(QVariantList vlist);
void onAddRect();