加载json模版 ,哪口井数据来源根据左侧数据树的选择。
This commit is contained in:
parent
183826b889
commit
d05575bdc9
|
|
@ -623,6 +623,24 @@ void MainWindow::s_showView()
|
|||
return;
|
||||
}
|
||||
|
||||
QString strSlfName = "";
|
||||
QString strWellName = "";
|
||||
QString strLeft = m_projectWidgets->getLeftTreeString();
|
||||
if (strLeft.length() > 0)
|
||||
{
|
||||
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
|
||||
if (list.size() > 3)
|
||||
{
|
||||
QFileInfo finfo(list[0]);
|
||||
strSlfName = finfo.fileName();
|
||||
strWellName = list[1];
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, "提示", "请先选中待处理井次!");
|
||||
return;
|
||||
}
|
||||
|
||||
//Logdata
|
||||
QString folderPath;
|
||||
folderPath = GetLogdataPath();
|
||||
|
|
@ -662,6 +680,8 @@ void MainWindow::s_showView()
|
|||
m_centerWidgets->addTab(mainSplitter, fileName);
|
||||
|
||||
MainWindowCurve *mainWindowCurve = mainSplitter->getMainWindowCurve();
|
||||
mainWindowCurve->m_strSlfName = strSlfName;
|
||||
mainWindowCurve->m_strWellName = strWellName;
|
||||
mainWindowCurve->Open(fileFull);
|
||||
|
||||
//QFuture<void> future = QtConcurrent::run(std::bind(&MainWindowCurve::s_Open, mainWindowCurve, fileFull));
|
||||
|
|
|
|||
|
|
@ -406,7 +406,8 @@ void MainWindowCurve::resizeEvent(QResizeEvent *event)
|
|||
QSize sz = event->size();
|
||||
m_nObjDrawH = sz.height() - nhei - m_nObjLayerH - 100 - 100;
|
||||
// nhei mainToolBar的高度 m_nObjLyrH,对象单元格高度 100头高度,100井头高度
|
||||
emit CallManage::getInstance()->sig_ResizeHeight(m_strUuid, m_nObjDrawH);
|
||||
int che = ui->centralwidget->height();
|
||||
emit CallManage::getInstance()->sig_ResizeHeight(m_strUuid, che);
|
||||
|
||||
//2个滚动条位置
|
||||
SetScrollBar_Geometry();
|
||||
|
|
@ -5666,27 +5667,29 @@ void MainWindowCurve::DisplayWells(QJsonArray wellsArray)
|
|||
//展示其中一口井
|
||||
void MainWindowCurve::DisplayWell_One(QJsonObject wellObjInfo)
|
||||
{
|
||||
QString strWellName = "";
|
||||
QString strSlfName = "";
|
||||
QString strWellName = m_strWellName;
|
||||
QString strSlfName = m_strSlfName;
|
||||
QJsonArray tracksArray;
|
||||
if (strSlfName.length() <= 0)
|
||||
{
|
||||
if (wellObjInfo.contains("WellName"))
|
||||
{
|
||||
QJsonValue value = wellObjInfo.value("WellName");
|
||||
if (value.isString()) {
|
||||
strWellName = value.toString();
|
||||
qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
|
||||
if (wellObjInfo.contains("WellName"))
|
||||
{
|
||||
QJsonValue value = wellObjInfo.value("WellName");
|
||||
if (value.isString()) {
|
||||
strWellName = value.toString();
|
||||
qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
|
||||
if (wellObjInfo.contains("SlfName"))
|
||||
{
|
||||
QJsonValue value = wellObjInfo.value("SlfName");
|
||||
if (value.isString()) {
|
||||
strSlfName = value.toString();
|
||||
qDebug() << "strSlfName:" << strSlfName;
|
||||
}
|
||||
}
|
||||
if (wellObjInfo.contains("SlfName"))
|
||||
{
|
||||
QJsonValue value = wellObjInfo.value("SlfName");
|
||||
if (value.isString()) {
|
||||
strSlfName = value.toString();
|
||||
qDebug() << "strSlfName:" << strSlfName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wellObjInfo.contains("bShowTrackHead"))
|
||||
{
|
||||
|
|
@ -5759,6 +5762,8 @@ void MainWindowCurve::DisplayTracks(QJsonArray tracksArray)
|
|||
if (topVal.isObject() && infoVal.isObject()) {
|
||||
QJsonObject topObj = topVal.toObject();
|
||||
QJsonObject infoObj = infoVal.toObject();
|
||||
|
||||
topObj["WellName"] = m_strWellName;
|
||||
//展示其中一道
|
||||
DisplayTrack_Top(id, topObj, infoObj);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ public slots:
|
|||
|
||||
public:
|
||||
MainWindowSplitter* m_pParentWin = NULL;
|
||||
QString m_strSlfName = "";
|
||||
QString m_strWellName = "";
|
||||
|
||||
QString m_strUuid;
|
||||
QStringList m_listWell;
|
||||
|
|
|
|||
|
|
@ -6,14 +6,17 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>681</width>
|
||||
<height>513</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
|
|
@ -32,8 +35,15 @@
|
|||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="tableWidget_2"/>
|
||||
<widget class="QTableWidget" name="tableWidget_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,6">
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
|||
|
||||
// ===== 性能优化: 启用 OpenGL 硬件加速 =====
|
||||
// 优先尝试 OpenGL, 如果硬件不支持会自动回退到软件渲染
|
||||
this->setOpenGl(true, 16);
|
||||
//this->setOpenGl(true, 16);
|
||||
|
||||
m_newColor = Qt::black;
|
||||
// ===== 性能优化: 仅对曲线开抗锯齿, 关闭轴/网格/图例抗锯齿 =====
|
||||
|
|
@ -876,7 +876,7 @@ void QMyCustomPlot::mouseMoveEvent(QMouseEvent *event)
|
|||
y_val = xAxis->pixelToCoord(y_pos);
|
||||
else
|
||||
y_val = yAxis->pixelToCoord(y_pos);
|
||||
//qDebug() << "MouseMove:" << y_pos;
|
||||
//qDebug() << "MouseMove pixel:" << y_pos << "Y轴: " << y_val;
|
||||
emit CallManage::getInstance()->sig_MouseMove(m_strUuid, m_strWellName, m_strTrackName, 0-y_val);
|
||||
}
|
||||
}
|
||||
|
|
@ -12274,9 +12274,33 @@ void QMyCustomPlot::vertScrollBarChanged_setGeometry(QString strUuid, double val
|
|||
|
||||
//move(0, -(dPercent*geoRect.height()));
|
||||
setGeometry(0, -(dPercent*geoRect.height()), geoRect.width(), geoRect.height());
|
||||
|
||||
//qDebug() << "visibleTopDepth: " << visibleTopDepth();
|
||||
//qDebug() << "visibleBottomDepth: " << visibleBottomDepth();
|
||||
return;
|
||||
}
|
||||
|
||||
float QMyCustomPlot::visibleTopDepth() const
|
||||
{
|
||||
// widget 被父容器从顶部裁切的像素量 = -geometry().y()
|
||||
int pixTop = -geometry().y();
|
||||
if (m_bX2Y)
|
||||
return (float)xAxis->pixelToCoord(pixTop);
|
||||
else
|
||||
return (float)yAxis->pixelToCoord(pixTop);
|
||||
}
|
||||
|
||||
float QMyCustomPlot::visibleBottomDepth() const
|
||||
{
|
||||
QWidget* p = parentWidget();
|
||||
int viewportH = p ? p->height() : height();
|
||||
int pixBottom = -geometry().y() + viewportH;
|
||||
if (m_bX2Y)
|
||||
return (float)xAxis->pixelToCoord(pixBottom);
|
||||
else
|
||||
return (float)yAxis->pixelToCoord(pixBottom);
|
||||
}
|
||||
|
||||
void QMyCustomPlot::s_ResizeHeight(QString strUuid, int nPixVal)
|
||||
{
|
||||
if (m_strUuid == strUuid)
|
||||
|
|
@ -12285,6 +12309,7 @@ void QMyCustomPlot::s_ResizeHeight(QString strUuid, int nPixVal)
|
|||
m_fBottomY = xAxis->pixelToCoord(nPixVal);
|
||||
else
|
||||
m_fBottomY = yAxis->pixelToCoord(nPixVal);
|
||||
|
||||
emit CallManage::getInstance()->sig_ResizeDepth(m_strUuid, nPixVal, m_fBottomY);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,6 +129,9 @@ public:
|
|||
void setDepthY(float fy1, float fy2);
|
||||
//改变深度更新绘图
|
||||
void updateDepthY(float fy1, float fy2);
|
||||
// 获取可视区域顶部/底部深度(滚动偏移后实时有效,基于像素反算)
|
||||
float visibleTopDepth() const;
|
||||
float visibleBottomDepth() const;
|
||||
//绘制网格
|
||||
void drawRowGrid(bool b = false);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user