This commit is contained in:
DESKTOP-450PEFP\mainc 2026-03-20 11:22:10 +08:00
commit c7a8392ffd
7 changed files with 97 additions and 59 deletions

View File

@ -1287,7 +1287,9 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
{ {
//先处理通用属性 //先处理通用属性
CommonPropertyChanged(pProperty, variant); CommonPropertyChanged(pProperty, variant);
// changedDepthProperty(pProperty, variant);
// 先修改属性值 在修改页面样式
changedDepthProperty(m_propertyData[pProperty], variant);
QVariantList listCond; QVariantList listCond;
listCond << m_strUuid; listCond << m_strUuid;
@ -2419,32 +2421,32 @@ void PropertyWidget::initTableProperty(FormInfo *formInfo)
void PropertyWidget::initDepthProperty(FormInfo *formInfo) void PropertyWidget::initDepthProperty(FormInfo *formInfo)
{ {
_CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String); _CreateVariantPropertyItem("通常", "显示名称", formInfo->m_strAliasName, QVariant::String);
_CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_bVerticaDrawing, QVariant::Bool); _CreateVariantPropertyItem("通常", "头部高度(cm)", formInfo->m_bVerticaDrawing, QVariant::Double);
_CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool); _CreateVariantPropertyItem("通常", "垂向绘制", formInfo->m_bVerticaDrawing, QVariant::Bool);
_CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int); _CreateVariantPropertyItem("通常", "旋转角度(°)", formInfo->m_nRotationAngle, QVariant::Int);
_CreateVariantPropertyItem("通常", "显示单位", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("通常", "显示单位", formInfo->m_sdUnit, QVariant::String);
_CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_lineColor, QVariant::Color); _CreateVariantPropertyItem("通常", "标尺颜色", formInfo->m_sdRulerColor, QVariant::Color);
_CreateVariantPropertyItem("字体", "字体", formInfo->m_curveNameFont, QVariant::Font);//名称 _CreateVariantPropertyItem("字体", "字体", formInfo->m_curveNameFont, QVariant::Font);
_CreateVariantPropertyItem("字体", "单位", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("字体", "单位", formInfo->m_nJg, QVariant::String);
_CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_nJg, QVariant::Double); _CreateVariantPropertyItem("深度标注", "间隔", formInfo->m_sdInterval, QVariant::Double);
_CreateVariantPropertyItem("深度标注", "标注字体", formInfo->m_curveNameFont, QVariant::Font); _CreateVariantPropertyItem("深度标注", "标注字体", formInfo->m_sdLabelFont, QVariant::Font);
_CreateVariantPropertyItem("深度标注", "旋转(°)", formInfo->m_nJg, QVariant::Double); _CreateVariantPropertyItem("深度标注", "旋转(°)", formInfo->m_sdRotationAngle, QVariant::Double);
_CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_nJg, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "绘制起点深度", formInfo->m_sdDrawStartDepth, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_nJg, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "绘制终点深度", formInfo->m_sdDrawEndDepth, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_nJg, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "斜深", formInfo->m_sdMeasuredDepth, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_nJg, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "海拔垂深", formInfo->m_sdElevationVerticalDepth, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_strAliasName, QVariant::Bool); _CreateVariantPropertyItem("深度标注", "垂深", formInfo->m_sdVerticalDepth, QVariant::Bool);
_CreateVariantPropertyItem("深度标注", "斜深位置", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("深度标注", "斜深位置", formInfo->m_sdMeasuredDepthPosition, QVariant::String);
_CreateVariantPropertyItem("深度标注", "垂深位置", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("深度标注", "垂深位置", formInfo->m_sdVerticalDepthPosition, QVariant::String);
_CreateVariantPropertyItem("深度标注", "海拔垂深位置", formInfo->m_nJg, QVariant::String); _CreateVariantPropertyItem("深度标注", "海拔垂深位置", formInfo->m_sdElevationVerticalDepthPosition, QVariant::String);
_CreateVariantPropertyItem("主刻度线", "主刻度线长度", formInfo->m_nJg, QVariant::Double); _CreateVariantPropertyItem("主刻度线", "主刻度线长度", formInfo->m_sdMajorTickLineLength, QVariant::Int);
_CreateVariantPropertyItem("主刻度线", "主刻度线宽度", formInfo->m_nJg, QVariant::Double); _CreateVariantPropertyItem("主刻度线", "主刻度线宽度", formInfo->m_sdMajorTickLineWidth, QVariant::Int);
_CreateVariantPropertyItem("次刻度线", "次刻度线长度", formInfo->m_nJg, QVariant::Double); _CreateVariantPropertyItem("次刻度线", "次刻度线长度", formInfo->m_sdMinorTickLineLength, QVariant::Int);
_CreateVariantPropertyItem("次刻度线", "次刻度线宽度", formInfo->m_nJg, QVariant::Double); _CreateVariantPropertyItem("次刻度线", "次刻度线宽度", formInfo->m_sdMinorTickLineWidth, QVariant::Int);
m_strCurrentProperty = Depth_Property; m_strCurrentProperty = Depth_Property;
} }
@ -3261,18 +3263,52 @@ void PropertyWidget::initTubingProperty(FormInfo *formInfo)
m_strCurrentProperty = Tubing_Property; m_strCurrentProperty = Tubing_Property;
} }
void PropertyWidget::changedDepthProperty(QtProperty *pProperty, const QVariant &variant) void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
{ {
if("长度" == m_propertyData[pProperty]) if ("主刻度线长度" == strProperty)
{ {
int height = variant.toInt(); int temp = varVal.toInt();
this->m_formInfo->m_sdMajorTickLineLength = temp;
m_formInfo->update();
} }
else if("长度" == m_propertyData[pProperty]) else if ("主刻度线宽度" == strProperty)
{ {
int height = variant.toInt(); int temp = varVal.toInt();
this->m_formInfo->m_sdMajorTickLineWidth = temp;
m_formInfo->update(); }
else if ("次刻度线长度" == strProperty)
{
int temp = varVal.toInt();
this->m_formInfo->m_sdMinorTickLineLength = temp;
}
else if ("次刻度线宽度" == strProperty)
{
int temp = varVal.toInt();
this->m_formInfo->m_sdMinorTickLineWidth = temp;
}
else if ("标尺颜色" == strProperty)
{
QColor newColor = varVal.value<QColor>();
this->m_formInfo->m_sdRulerColor = newColor;
}
else if ("间隔" == strProperty)
{
double temp = varVal.toDouble();
// 应用到Y轴
this->m_formInfo->m_sdInterval = temp;
}
else if ("标注字体" == strProperty)
{
QFont newFont = varVal.value<QFont>();
this->m_formInfo->m_sdLabelFont = newFont;
}
else if ("旋转(°)" == strProperty)
{
double temp = varVal.toDouble();
this->m_formInfo->m_sdRotationAngle = temp;
}
else if ("斜深" == strProperty)
{
bool temp = varVal.toBool();
this->m_formInfo->m_sdMeasuredDepth = temp;
} }
} }

View File

@ -137,7 +137,6 @@ public:
bool m_bSelfChange=false; bool m_bSelfChange=false;
TransparentGroupResult* m_tdJieshi; TransparentGroupResult* m_tdJieshi;
//
TransparentDraggableGujing* m_tdGujing; TransparentDraggableGujing* m_tdGujing;
TransparentDraggableImage* m_tdImage; TransparentDraggableImage* m_tdImage;
TransparentDraggableSwallCore* m_tdSwallCore; TransparentDraggableSwallCore* m_tdSwallCore;
@ -145,7 +144,6 @@ public:
TransparentDraggableRect* m_tdText; TransparentDraggableRect* m_tdText;
TransparentDraggableLayer* m_tdLayer; TransparentDraggableLayer* m_tdLayer;
TransparentDraggableJiegutext* m_tdJiegutext; TransparentDraggableJiegutext* m_tdJiegutext;
QMyCustomPlot m_depthMyCustomPlot;
public: public:
QWidget* GetPropertyWidget(); QWidget* GetPropertyWidget();
@ -229,8 +227,7 @@ public:
void changedYxzpItemProperty(QtProperty *pProperty, const QVariant &variant); void changedYxzpItemProperty(QtProperty *pProperty, const QVariant &variant);
// 深度 // 深度
void changedDepthProperty(QtProperty *pProperty, const QVariant &variant); void changedDepthProperty(QString strProName, QVariant val);
public slots: public slots:
void SlotPropertyChanged(QtProperty *property, const QVariant &variant); void SlotPropertyChanged(QtProperty *property, const QVariant &variant);
void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle); void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle);

View File

@ -4378,6 +4378,7 @@ void FormDraw::initGujing(QMyCustomPlot *widget, QString strSlfName, QString str
void FormDraw::initDepth(QMyCustomPlot *curv) void FormDraw::initDepth(QMyCustomPlot *curv)
{ {
// x轴隐藏
curv->xAxis->setTicks(false); curv->xAxis->setTicks(false);
curv->xAxis->setSubTicks(false); curv->xAxis->setSubTicks(false);
curv->xAxis->setTickLabels(false); curv->xAxis->setTickLabels(false);
@ -4386,20 +4387,10 @@ void FormDraw::initDepth(QMyCustomPlot *curv)
curv->yAxis->setTickLabelSide(QCPAxis::lsInside); curv->yAxis->setTickLabelSide(QCPAxis::lsInside);
QFont font1("微软雅黑", 16); //fontSize 16 QFont font1("微软雅黑", 16); //fontSize 16
curv->yAxis->setTickLabelFont(font1); curv->yAxis->setTickLabelFont(font1);
curv->yAxis->setRange(m_iY1, m_iY2); curv->yAxis->setRange(m_iY1, m_iY2);
curv->axisRect()->setupFullAxesBox(); 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; curv->m_bX2Y = false;
//对调XY轴在最前面设置
// QCPAxis *yAxis = curv->yAxis;
// QCPAxis *xAxis = curv->xAxis;
// curv->xAxis = yAxis;
// curv->yAxis = xAxis;
} }
//void FormDraw::initDepth(QMyCustomPlot *curv) //void FormDraw::initDepth(QMyCustomPlot *curv)

View File

@ -209,6 +209,28 @@ public:
bool m_isBlock; bool m_isBlock;
//tvd //tvd
// 深度
// 头部高度
double m_sdHeadHeight;
// ---------------- 基础配置 ----------------
QColor m_sdRulerColor; // 标尺颜色
QString m_sdUnit; // 显示单位
double m_sdInterval; // 间隔
QFont m_sdLabelFont = QFont("微软雅黑", 16); // 标注字体
double m_sdRotationAngle = 0.0; // 旋转(°)
double m_sdDrawStartDepth; // 绘制起点深度
double m_sdDrawEndDepth; // 绘制终点深度
double m_sdMeasuredDepth; // 斜深
double m_sdElevationVerticalDepth; // 海拔垂深
double m_sdVerticalDepth; // 垂深
QPointF m_sdMeasuredDepthPosition; // 斜深位置
QPointF m_sdVerticalDepthPosition; // 垂深位置
QPointF m_sdElevationVerticalDepthPosition; // 海拔垂深位置
int m_sdMajorTickLineLength = 3; // 主刻度线长度
int m_sdMajorTickLineWidth = 1; // 主刻度线宽度
int m_sdMinorTickLineLength = 1; // 次刻度线长度
int m_sdMinorTickLineWidth = 1; // 次刻度线宽度
public: public:
void setLineWidth(double dWidth); void setLineWidth(double dWidth);
double getLineWidth(); double getLineWidth();

View File

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

View File

@ -134,7 +134,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
//Plot重新加载数据 //Plot重新加载数据
connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString))); 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_changeDepthProperty(QVariantList)), this, SLOT(s_changeDepthProperty(QVariantList)));
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList))); connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
//改变固井曲线名 //改变固井曲线名
@ -4522,36 +4522,26 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
QVariant varVal = vlist.at(6).toString(); QVariant varVal = vlist.at(6).toString();
if ("主刻度线长度" == strProperty) if ("主刻度线长度" == strProperty)
{ {
double height = varVal.toDouble(); int height = varVal.toInt();
this->yAxis->setTickLength(height, 0); 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) else if ("主刻度线宽度" == strProperty)
{ {
double temp = varVal.toDouble(); int temp = varVal.toInt();
QPen tickPen = this->yAxis->tickPen(); QPen tickPen = this->yAxis->tickPen();
// 4. 仅修改画笔宽度(核心:不改动其他属性)
tickPen.setWidth(temp); tickPen.setWidth(temp);
// 5. 重新应用画笔到主刻度(仅影响主刻度)
this->yAxis->setTickPen(tickPen); this->yAxis->setTickPen(tickPen);
} }
else if ("次刻度线长度" == strProperty) else if ("次刻度线长度" == strProperty)
{ {
double temp = varVal.toDouble(); int temp = varVal.toInt();
this->yAxis->setSubTickLength(temp, 0); this->yAxis->setSubTickLength(temp, 0);
} }
else if ("次刻度线宽度" == strProperty) else if ("次刻度线宽度" == strProperty)
{ {
double temp = varVal.toDouble(); int temp = varVal.toInt();
QPen tickPen = this->yAxis->subTickPen(); QPen tickPen = this->yAxis->subTickPen();
// 4. 仅修改画笔宽度(核心:不改动其他属性)
tickPen.setWidth(temp); tickPen.setWidth(temp);
// 5. 重新应用画笔到主刻度(仅影响主刻度)
this->yAxis->setSubTickPen(tickPen); this->yAxis->setSubTickPen(tickPen);
} }
else if ("标尺颜色" == strProperty) else if ("标尺颜色" == strProperty)

View File

@ -285,6 +285,8 @@ public:
void drawOne_Tubing(Slf_JIEGUPOS result); void drawOne_Tubing(Slf_JIEGUPOS result);
bool SaveToSLF_Tubing(); bool SaveToSLF_Tubing();
public slots: public slots:
void slot_time(); void slot_time();