Compare commits
2 Commits
252e44d046
...
4bc1e77a31
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bc1e77a31 | ||
|
|
5d647c3d26 |
|
|
@ -3433,7 +3433,12 @@ void PropertyWidget::initTubingItemProperty(TransparentDraggableGuan* tdGuan, do
|
|||
|
||||
void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
|
||||
{
|
||||
if ("主刻度线长度" == strProperty)
|
||||
if ("显示单位" == strProperty)
|
||||
{
|
||||
this->m_formInfo->m_strUnit = varVal.toString();
|
||||
this->m_formInfo->repaint();
|
||||
}
|
||||
else if ("主刻度线长度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
this->m_formInfo->m_sdMajorTickLineLength = temp;
|
||||
|
|
@ -3479,11 +3484,6 @@ void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
|
|||
bool temp = varVal.toBool();
|
||||
this->m_formInfo->m_sdMeasuredDepth = temp;
|
||||
}
|
||||
else if ("显示单位" == strProperty)
|
||||
{
|
||||
this->m_formInfo->m_strUnit = varVal.toString();
|
||||
this->m_formInfo->repaint();
|
||||
}
|
||||
else if ("单位" == strProperty)
|
||||
{
|
||||
QFont temp = varVal.value<QFont>();
|
||||
|
|
@ -3517,4 +3517,56 @@ void PropertyWidget::changedDepthProperty(QString strProperty, QVariant varVal)
|
|||
}
|
||||
this->m_formInfo->m_sdMeasuredDepthPosition = newStyle;
|
||||
}
|
||||
else if ("垂深位置" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
int newStyle = 0;
|
||||
switch(temp)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
newStyle = Qt::NoPen;
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
newStyle = Qt::SolidLine;
|
||||
break;
|
||||
case 2:
|
||||
// 偏右
|
||||
newStyle = Qt::DashLine;
|
||||
break;
|
||||
}
|
||||
this->m_formInfo->m_sdVerticalDepthPosition = newStyle;
|
||||
}
|
||||
else if ("海拔垂深位置" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
int newStyle = 0;
|
||||
switch(temp)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
newStyle = Qt::NoPen;
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
newStyle = Qt::SolidLine;
|
||||
break;
|
||||
case 2:
|
||||
// 偏右
|
||||
newStyle = Qt::DashLine;
|
||||
break;
|
||||
}
|
||||
this->m_formInfo->m_sdElevationVerticalDepthPosition = newStyle;
|
||||
}
|
||||
else if ("垂深" == strProperty)
|
||||
{
|
||||
bool temp = varVal.toBool();
|
||||
this->m_formInfo->m_sdVerticalDepth = temp;
|
||||
}
|
||||
else if ("海拔垂深" == strProperty)
|
||||
{
|
||||
bool temp = varVal.toBool();
|
||||
this->m_formInfo->m_sdElevationVerticalDepth = temp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,9 +183,286 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
|
|||
else if("depthObject" == strType)
|
||||
{
|
||||
// 在s_addDepth方法设置单位无效
|
||||
pInfo->m_strUnit = "(米)";
|
||||
pInfo->m_strUnitFont = QFont("微软雅黑", 8);
|
||||
|
||||
// 读取json
|
||||
// 设置左侧显示属性 设置界面样式
|
||||
// if(pInfo->m_strUnit.isEmpty()){
|
||||
// pInfo->m_strUnit = "(米)";
|
||||
// pInfo->m_strUnitFont = QFont("微软雅黑", 16);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// bool m_sdDrawStartDepth; // 绘制起点深度
|
||||
// bool m_sdDrawEndDepth; // 绘制终点深度
|
||||
|
||||
|
||||
|
||||
|
||||
// int m_sdMajorTickLineLength = 3; // 主刻度线长度
|
||||
// int m_sdMajorTickLineWidth = 1; // 主刻度线宽度
|
||||
// int m_sdMinorTickLineLength = 1; // 次刻度线长度
|
||||
// int m_sdMinorTickLineWidth = 1; // 次刻度线宽度
|
||||
|
||||
initDepth(curv);
|
||||
// 读json后 重新设置样式
|
||||
// 头部高度
|
||||
pInfo->setFixedHeight(pInfo->m_headHeight);
|
||||
// 标尺颜色
|
||||
curv->yAxis->setTickLabelColor(pInfo->m_sdRulerColor);
|
||||
// 间隔
|
||||
QSharedPointer<QCPAxisTickerFixed> fixedTicker(new QCPAxisTickerFixed);
|
||||
fixedTicker->setTickStep(pInfo->m_sdInterval);
|
||||
fixedTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone);
|
||||
curv->yAxis->setTicker(fixedTicker);
|
||||
// 标注字体
|
||||
curv->yAxis->setTickLabelFont(pInfo->m_sdLabelFont);
|
||||
// 旋转(°)
|
||||
curv->yAxis->setTickLabelRotation(pInfo->m_sdRotationAngle);
|
||||
// 斜深
|
||||
curv->yAxis->setTickLabels(pInfo->m_sdMeasuredDepth);
|
||||
// 海拔垂深
|
||||
{
|
||||
bool temp = pInfo->m_sdElevationVerticalDepth;
|
||||
if(!curv->m_yAxis2)
|
||||
{
|
||||
curv->m_yAxis2 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
|
||||
curv->axisRect()->addAxis(QCPAxis::atLeft, curv->m_yAxis2);
|
||||
curv->m_yAxis2->setRange(0, 100);
|
||||
curv->m_yAxis2->setOffset(40);
|
||||
curv->m_yAxis2->setTickLabelPadding(10);
|
||||
}
|
||||
curv->m_yAxis2->setVisible(temp);
|
||||
curv->m_yAxis2->setTickLabels(temp);
|
||||
curv->m_yAxis2->setTickLabelSide(QCPAxis::lsInside);
|
||||
}
|
||||
// 垂深
|
||||
bool temp2 = pInfo->m_sdVerticalDepth;
|
||||
if(!curv->m_yAxis3)
|
||||
{
|
||||
curv->m_yAxis3 = new QCPAxis(curv->axisRect(), QCPAxis::atLeft);
|
||||
curv->axisRect()->addAxis(QCPAxis::atLeft, curv->m_yAxis3);
|
||||
curv->m_yAxis3->setRange(0, 100);
|
||||
curv->m_yAxis3->setOffset(40);
|
||||
curv->m_yAxis3->setTickLabelPadding(10);
|
||||
}
|
||||
curv->m_yAxis3->setVisible(temp2); // 显示第三个Y轴
|
||||
curv->m_yAxis3->setTickLabels(temp2);
|
||||
curv->m_yAxis3->setTickLabelSide(QCPAxis::lsInside);
|
||||
// 斜深位置
|
||||
switch(pInfo->m_sdMeasuredDepthPosition)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
curv->yAxis->setTickLabelPadding(5);
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
curv->yAxis->setTickLabelPadding(30);
|
||||
break;
|
||||
case 2:
|
||||
curv->yAxis->setTickLabelPadding(50);
|
||||
break;
|
||||
}
|
||||
|
||||
// 垂深位置
|
||||
switch(pInfo->m_sdVerticalDepthPosition)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
curv->m_yAxis3->setTickLabelPadding(5 + 10);
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
curv->m_yAxis3->setTickLabelPadding(30 + 10);
|
||||
break;
|
||||
case 2:
|
||||
curv->m_yAxis3->setTickLabelPadding(50 + 10);
|
||||
break;
|
||||
}
|
||||
// 海拔垂深位置
|
||||
switch(pInfo->m_sdElevationVerticalDepthPosition)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
curv->m_yAxis2->setTickLabelPadding(5 + 10);
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
curv->m_yAxis2->setTickLabelPadding(30);
|
||||
break;
|
||||
case 2:
|
||||
curv->m_yAxis2->setTickLabelPadding(50 + 10);
|
||||
break;
|
||||
}
|
||||
// 主刻度线长度
|
||||
{
|
||||
int temp = pInfo->m_sdMajorTickLineLength;
|
||||
curv->yAxis->setTickLength(temp, 0);
|
||||
}
|
||||
// 主刻度线宽度
|
||||
{
|
||||
int temp = pInfo->m_sdMajorTickLineWidth;
|
||||
QPen tickPen = curv->yAxis->tickPen();
|
||||
tickPen.setWidth(temp);
|
||||
curv->yAxis->setTickPen(tickPen);
|
||||
}
|
||||
// 次刻度线长度
|
||||
{
|
||||
int temp = pInfo->m_sdMinorTickLineLength;
|
||||
curv->yAxis->setSubTickLength(temp, 0);
|
||||
}
|
||||
// 次刻度线宽度
|
||||
{
|
||||
int temp = pInfo->m_sdMinorTickLineWidth;
|
||||
QPen tickPen = curv->yAxis->subTickPen();
|
||||
tickPen.setWidth(temp);
|
||||
curv->yAxis->setSubTickPen(tickPen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if("plObject" == strType)
|
||||
{
|
||||
initFgrq(curv);
|
||||
}
|
||||
else if("roseObject" == strType)
|
||||
{
|
||||
initRose(curv);
|
||||
}
|
||||
else if("dcaObject" == strType)
|
||||
{
|
||||
initDCA(curv);
|
||||
}
|
||||
else if("tdtObject" == strType)
|
||||
{
|
||||
initTDT(curv);
|
||||
|
||||
if(m_iY1 == 0.0)
|
||||
{
|
||||
QTimer::singleShot(200, this, [=]() {
|
||||
m_iY2 = -2000;
|
||||
m_iY1 = -2030;
|
||||
emit CallManage::getInstance()->sig_changeDepth(m_strUuid, m_strSlfName, m_strWellName, m_iY1, m_iY2);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
else if (strType == "tableObject")
|
||||
{
|
||||
//新建表格曲线
|
||||
emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName);
|
||||
}
|
||||
curv->replot();
|
||||
|
||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||
|
||||
QTimer::singleShot(100, this, [=]() {
|
||||
emit CallManage::getInstance()->sig_ReplotFinished(m_strUuid);
|
||||
});
|
||||
|
||||
//
|
||||
m_listLineName.push_back(strLineName);
|
||||
}
|
||||
|
||||
|
||||
void FormDraw::setDrawPropert(QJsonObject objInfo)
|
||||
{
|
||||
if (objInfo.contains("formInfos"))
|
||||
{
|
||||
QJsonValue value = objInfo.value("formInfos");
|
||||
if (value.isArray()) {
|
||||
QJsonArray linesArray = value.toArray();
|
||||
qDebug() << "linesArray number:" << QString::number(linesArray.size());
|
||||
//展示所有曲线
|
||||
DisplayLines(linesArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormDraw::DisplayLines(QJsonArray linesArray)
|
||||
{
|
||||
QMap<int, int> mapLines;
|
||||
|
||||
int id = 0;
|
||||
int iCount = linesArray.size();
|
||||
for (int i = 0; i < iCount; i++)
|
||||
{
|
||||
QJsonValue lineValue = linesArray[i];
|
||||
|
||||
QJsonObject lineObj = lineValue.toObject();
|
||||
//
|
||||
if (lineObj.contains("id"))
|
||||
{
|
||||
QJsonValue value = lineObj.value("id");
|
||||
if (value.isDouble()) {
|
||||
id = value.toInt();
|
||||
qDebug() << "id:" << QString::number(id);
|
||||
//
|
||||
mapLines.insert(id, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int id = 0; id < iCount; id++)
|
||||
{
|
||||
if (mapLines.contains(id))
|
||||
{
|
||||
int iNum = mapLines.value(id);
|
||||
//按照id顺序,展示曲线
|
||||
QJsonValue lineValue = linesArray[iNum];
|
||||
QJsonObject lineObj = lineValue.toObject();
|
||||
//
|
||||
if (lineObj.contains("info"))
|
||||
{
|
||||
QJsonValue value = lineObj.value("info");
|
||||
if (value.isObject()) {
|
||||
QJsonObject lineObjInfo = value.toObject();
|
||||
|
||||
QString strType = lineObjInfo.value("Type").toString();
|
||||
|
||||
//展示其中一条曲线
|
||||
if (strType == "curveObject")
|
||||
{
|
||||
DisplayLine_One(lineObjInfo);
|
||||
}
|
||||
else if (strType == "tableObject")
|
||||
{
|
||||
QString strLineName = "";
|
||||
if (lineObjInfo.contains("LineName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("LineName");
|
||||
if (value.isString()) {
|
||||
strLineName = value.toString();
|
||||
//qDebug() << "LineName:" << strLineName;
|
||||
}
|
||||
}
|
||||
if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT"
|
||||
|| strLineName == "WORDS_RELUST" || strLineName == "GEO_LITH" || strLineName == "SWALL_CORE"
|
||||
|| strLineName == "LAYER_DATA")
|
||||
{
|
||||
//固井结论/井壁取心/录井剖面/文字结论/地质分层
|
||||
DisplayTable_One(lineObjInfo);
|
||||
}
|
||||
}
|
||||
else if (strType == "JiegutextObject")
|
||||
{
|
||||
//气测/FMT/射孔/文本
|
||||
DisplayJiegutext_One(lineObjInfo);
|
||||
}
|
||||
else if (strType == "LogfaceObject")
|
||||
{
|
||||
//沉积相
|
||||
DisplayFac_One(lineObjInfo);
|
||||
}
|
||||
else if (strType == "TubingstringObject")
|
||||
{
|
||||
//套管组件
|
||||
DisplayTubing_One(lineObjInfo);
|
||||
}
|
||||
}
|
||||
else if("plObject" == strType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ public:
|
|||
void DisplayLine_One(QJsonObject lineObjInfo);
|
||||
//波列
|
||||
void DisplayType_One(QJsonObject objInfo);
|
||||
|
||||
// 深度
|
||||
void DisplayDepth_One(QJsonObject lineObjInfo);
|
||||
//表格:固井结论等
|
||||
void DisplayTable_One(QJsonObject lineObjInfo);
|
||||
|
||||
|
|
|
|||
|
|
@ -115,6 +115,52 @@ void FormInfo::initProperty(QJsonObject obj)
|
|||
m_nWaveJg = obj.value("WaveJg").toInt();
|
||||
m_fWaveHei = obj.value("WaveHei").toDouble();
|
||||
}
|
||||
else if ("depthObject" == strType)
|
||||
{
|
||||
m_bVerticaDrawing = obj["bVerticaDrawing"].toBool(); // 垂向绘制
|
||||
m_nRotationAngle = obj["nRotationAngle"].toInt(); // 旋转角度
|
||||
m_headHeight = obj["headHeight"].toInt();
|
||||
m_strUnit = obj["strUnit"].toString(); // 单位
|
||||
{
|
||||
QStringList fontParts = obj["curveNameFont"].toString().split(","); // 按逗号拆分
|
||||
if (fontParts.size() >= 2) {
|
||||
m_curveNameFont.setFamily(fontParts[0]); // 设置字体名称
|
||||
m_curveNameFont.setPointSize(fontParts[1].toInt()); // 设置字号
|
||||
}
|
||||
}
|
||||
{
|
||||
QStringList fontParts = obj["strUnitFont"].toString().split(","); // 按逗号拆分
|
||||
if (fontParts.size() >= 2) {
|
||||
m_strUnitFont.setFamily(fontParts[0]); // 设置字体名称
|
||||
m_strUnitFont.setPointSize(fontParts[1].toInt()); // 设置字号
|
||||
}
|
||||
}
|
||||
m_headHeight = obj["headHeight"].toInt();
|
||||
m_sdRulerColor = obj["sdRulerColor"].toString(); // 标尺颜色
|
||||
m_sdInterval = obj["sdInterval"].toDouble(); // 间隔
|
||||
// 标注字体
|
||||
{
|
||||
QStringList fontParts = obj["sdLabelFont"].toString().split(","); // 按逗号拆分
|
||||
if (fontParts.size() >= 2) {
|
||||
m_sdLabelFont.setFamily(fontParts[0]); // 设置字体名称
|
||||
m_sdLabelFont.setPointSize(fontParts[1].toInt()); // 设置字号
|
||||
}
|
||||
}
|
||||
m_sdRotationAngle = obj["sdRotationAngle"].toDouble(); // 旋转(°)
|
||||
m_sdDrawStartDepth = obj["sdDrawStartDepth"].toBool(); // 绘制起点深度
|
||||
m_sdDrawEndDepth = obj["sdDrawEndDepth"].toBool(); // 绘制终点深度
|
||||
m_sdMeasuredDepth = obj["sdMeasuredDepth"].toBool(); // 斜深
|
||||
m_sdElevationVerticalDepth = obj["sdElevationVerticalDepth"].toBool(); // 海拔垂深
|
||||
m_sdVerticalDepth = obj["sdVerticalDepth"].toBool(); // 垂深
|
||||
m_sdMeasuredDepthPosition = obj["sdMeasuredDepthPosition"].toInt(); // 斜深位置
|
||||
m_sdVerticalDepthPosition = obj["sdVerticalDepthPosition"].toInt(); // 垂深位置
|
||||
m_sdElevationVerticalDepthPosition = obj["sdElevationVerticalDepthPosition"].toInt(); // 海拔垂深位置
|
||||
m_sdMajorTickLineLength = obj["sdMajorTickLineLength"].toInt(); // 主刻度线长度
|
||||
m_sdMajorTickLineWidth = obj["sdMajorTickLineWidth"].toInt(); // 主刻度线宽度
|
||||
m_sdMinorTickLineLength = obj["sdMinorTickLineLength"].toInt(); // 次刻度线长度
|
||||
m_sdMinorTickLineWidth = obj["sdMinorTickLineWidth"].toInt(); // 次刻度线宽度
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QJsonObject FormInfo::makeJson()
|
||||
|
|
@ -255,6 +301,31 @@ QJsonObject FormInfo::makeJson()
|
|||
makeTvdJson(rootObj);
|
||||
}
|
||||
|
||||
else if (m_strType == "depthObject")
|
||||
{
|
||||
rootObj["bVerticaDrawing"] = m_bVerticaDrawing; // 垂向绘制
|
||||
rootObj["nRotationAngle"] = m_nRotationAngle; // 旋转角度
|
||||
rootObj["strUnit"] = m_strUnit; // 单位
|
||||
rootObj["curveNameFont"] = m_curveNameFont.toString();
|
||||
rootObj["strUnitFont"] = m_strUnitFont.toString(); //单位字体
|
||||
rootObj["headHeight"] = m_headHeight;
|
||||
rootObj["sdRulerColor"] = m_sdRulerColor.name(); // 标尺颜色
|
||||
rootObj["sdInterval"] = m_sdInterval; // 间隔
|
||||
rootObj["sdLabelFont"] = m_sdLabelFont.toString(); // 标注字体
|
||||
rootObj["sdRotationAngle"] = m_sdRotationAngle; // 旋转(°)
|
||||
rootObj["sdDrawStartDepth"] = m_sdDrawStartDepth; // 绘制起点深度
|
||||
rootObj["sdDrawEndDepth"] = m_sdDrawEndDepth; // 绘制终点深度
|
||||
rootObj["sdMeasuredDepth"] = m_sdMeasuredDepth; // 斜深
|
||||
rootObj["sdElevationVerticalDepth"] = m_sdElevationVerticalDepth; // 海拔垂深
|
||||
rootObj["sdVerticalDepth"] = m_sdVerticalDepth; // 垂深
|
||||
rootObj["sdMeasuredDepthPosition"] = m_sdMeasuredDepthPosition; // 斜深位置
|
||||
rootObj["sdVerticalDepthPosition"] = m_sdVerticalDepthPosition; // 垂深位置
|
||||
rootObj["sdElevationVerticalDepthPosition"] = m_sdElevationVerticalDepthPosition; // 海拔垂深位置
|
||||
rootObj["sdMajorTickLineLength"] = m_sdMajorTickLineLength; // 主刻度线长度
|
||||
rootObj["sdMajorTickLineWidth"] = m_sdMajorTickLineWidth; // 主刻度线宽度
|
||||
rootObj["sdMinorTickLineLength"] = m_sdMinorTickLineLength; // 次刻度线长度
|
||||
rootObj["sdMinorTickLineWidth"] = m_sdMinorTickLineWidth; // 次刻度线宽度
|
||||
}
|
||||
return rootObj;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,16 +196,15 @@ public:
|
|||
CDrawTvd *m_pTvd;
|
||||
|
||||
// 深度
|
||||
// ---------------- 基础配置 ----------------
|
||||
QColor m_sdRulerColor; // 标尺颜色
|
||||
double m_sdInterval = 1; // 间隔
|
||||
double m_sdInterval = 20; // 间隔
|
||||
QFont m_sdLabelFont = QFont("微软雅黑", 16); // 标注字体
|
||||
double m_sdRotationAngle = 0.0; // 旋转(°)
|
||||
double m_sdDrawStartDepth; // 绘制起点深度
|
||||
double m_sdDrawEndDepth; // 绘制终点深度
|
||||
double m_sdMeasuredDepth = true; // 斜深
|
||||
double m_sdElevationVerticalDepth; // 海拔垂深
|
||||
double m_sdVerticalDepth; // 垂深
|
||||
bool m_sdDrawStartDepth; // 绘制起点深度
|
||||
bool m_sdDrawEndDepth; // 绘制终点深度
|
||||
bool m_sdMeasuredDepth = true; // 斜深
|
||||
bool m_sdElevationVerticalDepth = false; // 海拔垂深
|
||||
bool m_sdVerticalDepth = false; // 垂深
|
||||
int m_sdMeasuredDepthPosition = 0; // 斜深位置
|
||||
int m_sdVerticalDepthPosition = 0; // 垂深位置
|
||||
int m_sdElevationVerticalDepthPosition; // 海拔垂深位置
|
||||
|
|
|
|||
|
|
@ -4561,31 +4561,7 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
|
|||
{
|
||||
QString strProperty = vlist.at(5).toString();
|
||||
QVariant varVal = vlist.at(6).toString();
|
||||
if ("主刻度线长度" == strProperty)
|
||||
{
|
||||
int height = varVal.toInt();
|
||||
this->yAxis->setTickLength(height, 0);
|
||||
}
|
||||
else if ("主刻度线宽度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
QPen tickPen = this->yAxis->tickPen();
|
||||
tickPen.setWidth(temp);
|
||||
this->yAxis->setTickPen(tickPen);
|
||||
}
|
||||
else if ("次刻度线长度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
this->yAxis->setSubTickLength(temp, 0);
|
||||
}
|
||||
else if ("次刻度线宽度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
QPen tickPen = this->yAxis->subTickPen();
|
||||
tickPen.setWidth(temp);
|
||||
this->yAxis->setSubTickPen(tickPen);
|
||||
}
|
||||
else if ("标尺颜色" == strProperty)
|
||||
if ("标尺颜色" == strProperty)
|
||||
{
|
||||
QColor newColor = varVal.value<QColor>();
|
||||
this->yAxis->setTickLabelColor(newColor);
|
||||
|
|
@ -4617,33 +4593,21 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
|
|||
bool temp = varVal.toBool();
|
||||
this->yAxis->setTickLabels(temp);
|
||||
}
|
||||
else if ("斜深位置" == strProperty)
|
||||
{
|
||||
// 没有直接设置偏移方法 动态计算太麻烦
|
||||
int temp = varVal.toInt();
|
||||
switch(temp)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
this->yAxis->setTickLabelPadding(5);
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
this->yAxis->setTickLabelPadding(30);
|
||||
break;
|
||||
case 2:
|
||||
this->yAxis->setTickLabelPadding(50);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ("海拔垂深" == strProperty)
|
||||
{
|
||||
bool temp = varVal.toBool();
|
||||
this->yAxis2->setTickLabels(temp);
|
||||
this->yAxis2->setVisible(temp);
|
||||
this->yAxis2->setTickLabelSide(QCPAxis::lsInside);
|
||||
// this->yAxis2->setAxisType(QCPAxis::atLeft);
|
||||
// this->yAxis2->setPosition(QCPAxis::atLeft);
|
||||
if(!this->m_yAxis2)
|
||||
{
|
||||
this->m_yAxis2 = new QCPAxis(this->axisRect(), QCPAxis::atLeft);
|
||||
this->axisRect()->addAxis(QCPAxis::atLeft, this->m_yAxis2);
|
||||
this->m_yAxis2->setRange(0, 100);
|
||||
this->m_yAxis2->setOffset(40);
|
||||
this->m_yAxis2->setTickLabelPadding(10);
|
||||
}
|
||||
// 设置旋转 间隔
|
||||
this->m_yAxis2->setVisible(temp); // 显示第三个Y轴
|
||||
this->m_yAxis2->setTickLabels(temp);
|
||||
this->m_yAxis2->setTickLabelSide(QCPAxis::lsInside);
|
||||
}
|
||||
else if ("垂深" == strProperty)
|
||||
{
|
||||
|
|
@ -4660,21 +4624,22 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
|
|||
this->m_yAxis3->setTickLabels(temp);
|
||||
this->m_yAxis3->setTickLabelSide(QCPAxis::lsInside);
|
||||
}
|
||||
else if ("海拔垂深位置" == strProperty)
|
||||
else if ("斜深位置" == strProperty)
|
||||
{
|
||||
// 没有直接设置偏移方法 动态计算太麻烦
|
||||
int temp = varVal.toInt();
|
||||
switch(temp)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
this->yAxis2->setTickLabelPadding(50);
|
||||
this->yAxis->setTickLabelPadding(5);
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
this->yAxis2->setTickLabelPadding(30);
|
||||
this->yAxis->setTickLabelPadding(30);
|
||||
break;
|
||||
case 2:
|
||||
this->yAxis2->setTickLabelPadding(5);
|
||||
this->yAxis->setTickLabelPadding(50);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -4696,6 +4661,51 @@ void QMyCustomPlot::s_changeDepthProperty(QVariantList vlist)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if ("海拔垂深位置" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
switch(temp)
|
||||
{
|
||||
case 0:
|
||||
// 偏左
|
||||
this->m_yAxis2->setTickLabelPadding(5 + 10);
|
||||
break;
|
||||
case 1:
|
||||
// 居中
|
||||
this->m_yAxis2->setTickLabelPadding(30);
|
||||
break;
|
||||
case 2:
|
||||
this->m_yAxis2->setTickLabelPadding(50 + 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ("主刻度线长度" == strProperty)
|
||||
{
|
||||
int height = varVal.toInt();
|
||||
this->yAxis->setTickLength(height, 0);
|
||||
}
|
||||
else if ("主刻度线宽度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
QPen tickPen = this->yAxis->tickPen();
|
||||
tickPen.setWidth(temp);
|
||||
this->yAxis->setTickPen(tickPen);
|
||||
}
|
||||
else if ("次刻度线长度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
this->yAxis->setSubTickLength(temp, 0);
|
||||
}
|
||||
else if ("次刻度线宽度" == strProperty)
|
||||
{
|
||||
int temp = varVal.toInt();
|
||||
QPen tickPen = this->yAxis->subTickPen();
|
||||
tickPen.setWidth(temp);
|
||||
this->yAxis->setSubTickPen(tickPen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this->replot();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ public:
|
|||
int m_nWaveHei = 1;
|
||||
|
||||
// 深度 第三个轴
|
||||
QCPAxis *m_yAxis2 = nullptr;
|
||||
QCPAxis *m_yAxis3 = nullptr; // 保存指针
|
||||
public:
|
||||
bool m_bEditor = false; // 编辑状态
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user