修改波列问题,添加显示异常,波列隐藏网格绘制

This commit is contained in:
DESKTOP-450PEFP\mainc 2026-04-15 14:23:53 +08:00
parent 1e3579ef1e
commit 8b1520c162
4 changed files with 43 additions and 59 deletions

View File

@ -3067,45 +3067,19 @@ void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellNam
QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strWaveName);
//绑定m_formTrack方便关联formInfo
curv->m_formTrack = m_formTrack;
curv->m_strUuid = m_strUuid;
curv->m_bRowGridVisible = false;
curv->m_bColGridVisible = false;
curv->setScaleX(0, 264);
curv->setDepthY(m_iY1, m_iY2);
double nW = m_nTrackW;
if (nW <= 0)
nW = g_iOneWidth;
curv->initGeometry(m_strUuid, m_iScale, nW);
curv->m_bX2Y = false;
//背景设置成透明色
curv->setBackground(Qt::transparent);
curv->setStyleSheet("background: transparent;");
//
//QRect rect = this->rect();
//curv->setGeometry(rect.left(),rect.top(), rect.width(), rect.height());
double dHight = 0;
dHight = (m_iY2-m_iY1)*100.0/(double)m_iScale * g_dPixelPerCm;
if(g_iShow==1)
{
//显示刻度
dHight = dHight+30;
}
qDebug() << "FormDraw dHight=" << QString::number((int)dHight);
if(dHight>32767)
{
dHight = 32767;
}
//curv->setMaximumHeight((int)dHight);
//curv->setViewport(QRect(0, 0, g_iOneWidth, (int)dHight));//7500-3184
double nW = m_nTrackW;
if (nW < 0)
nW = g_iOneWidth;
curv->setGeometry(0, 0, nW, (int)dHight);//7500-3184
//curv->resize(INT_MAX, INT_MAX); // 使用 INT_MAX 来避免16位整数的限制
// QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// curv->setSizePolicy(policy);
curv->show();
curv->m_iY1 = m_iY1;
curv->m_iY2 = m_iY2;
int _nSamples = 0;
if(g_iSupport3D)
{

View File

@ -11,6 +11,7 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<QtMoc Include="tishidialog.h" />
<QtMoc Include="TransparentDraggableCrackObject.h" />
<QtMoc Include="selectwelldialog.h" />
<QtMoc Include="TransparentDraggableCorePhysics.h" />
@ -29,6 +30,7 @@
<ClInclude Include="CStringType.h" />
<ClInclude Include="CurveLine.h" />
<ClInclude Include="customellipse.h" />
<ClInclude Include="DataImport.h" />
<ClInclude Include="DepPairs.h" />
<ClInclude Include="DrawTvd.h" />
<QtMoc Include="formhead.h" />
@ -99,6 +101,7 @@
<ClCompile Include="CurveLine.cpp" />
<ClCompile Include="customtabbar.cpp" />
<ClCompile Include="customtabwidget.cpp" />
<ClCompile Include="DataImport.cpp" />
<ClCompile Include="DepPairs.cpp" />
<ClCompile Include="DrawNrad.cpp" />
<ClCompile Include="DrawTvd.cpp" />
@ -137,6 +140,7 @@
<ClCompile Include="qtcommonclass.cpp" />
<ClCompile Include="qtprojectwidgets.cpp" />
<ClCompile Include="selectwelldialog.cpp" />
<ClCompile Include="tishidialog.cpp" />
<ClCompile Include="totalTitleBar.cpp" />
<ClCompile Include="TransparentDraggableCorePhysics.cpp" />
<ClCompile Include="TransparentDraggableCrackObject.cpp" />
@ -185,6 +189,7 @@
<QtUic Include="qtcenterwidgets.ui" />
<QtUic Include="qtprojectwidgets.ui" />
<QtUic Include="selectwelldialog.ui" />
<QtUic Include="tishidialog.ui" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BE733E79-9D41-44C5-A0A3-048959EE70A0}</ProjectGuid>

View File

@ -74,6 +74,9 @@
<ClInclude Include="..\common\common.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="DataImport.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<QtMoc Include="ConsoleOutputWidget.h">
@ -262,6 +265,9 @@
<QtMoc Include="TransparentDraggableCrackObject.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="tishidialog.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<ClCompile Include="backgrounddelegate.cpp">
@ -480,6 +486,12 @@
<ClCompile Include="TransparentDraggableCrackObject.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DataImport.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="tishidialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtRcc Include="logplus.qrc">
@ -547,5 +559,8 @@
<QtUic Include="selectwelldialog.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="tishidialog.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
</Project>

View File

@ -43,6 +43,13 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
m_strTrackName = strTrackName;
m_strLineName = strLineName;
// 创建一个新的顶层图层(如果还没有)
if (!this->layer("topLayer")) {
this->addLayer("topLayer");
}
// 移动这个图层到所有图层的最上方
this->moveLayer(this->layer("topLayer"), this->layer("grid")); // -1 表示移动到列表末尾,即最顶层
FormDraw* pFormDw = qobject_cast<FormDraw*>(parent);
if (pFormDw)
{
@ -356,31 +363,9 @@ void QMyCustomPlot::initWave(QString strSlfName, QString strWaveName)
}
delete[] value;
float f = 264 / 269.0f;
// m_iY1 = 0.0 -_EDep;
// m_iY2 = 0.0 -_SDep;
//------------------------
widget->m_iY1 = m_iY1;
widget->m_iY2 = m_iY2;
//
if (!widget->m_bX2Y)
{
widget->xAxis->setRange(vmin, vmax);
widget->yAxis->setRange(m_iY1, m_iY2);
widget->axisRect()->setupFullAxesBox();
//
widget->xAxis->ticker()->setTickCount(10);//x个主刻度
widget->yAxis->ticker()->setTickCount(60);//y个主刻度
widget->xAxis->setTicks(false);
widget->yAxis->setTicks(false);
widget->xAxis2->setTicks(false);
widget->yAxis2->setTicks(false);
widget->xAxis->setTickLabels(false);
widget->yAxis->setTickLabels(false);
widget->xAxis2->setTickLabels(false);
widget->xAxis2->setTickLabels(false);
widget->xAxis->setVisible(false);
widget->xAxis2->setVisible(false);
widget->yAxis->setVisible(false);
@ -394,7 +379,7 @@ void QMyCustomPlot::initWave(QString strSlfName, QString strWaveName)
widget->m_bX2Y = true;
}
widget->m_fmin = vmin;
widget->m_fmax = vmax * f;
widget->m_fmax = vmax;
//-------------------
// set up the QCPColorMap:
@ -640,7 +625,8 @@ QCPColorMap * QMyCustomPlot::updateWave()
int ny = m_nSamples;
m_colorMap->data()->setSize(nx, ny); // 我们希望彩色地图有nx*ny的数据点
m_colorMap->data()->setRange(QCPRange(0 - m_EDep, 0 - m_SDep), QCPRange(this->m_fmin, this->m_fmax));
float f = 264 / 269.0f;
m_colorMap->data()->setRange(QCPRange(0 - m_EDep, 0 - m_SDep), QCPRange(this->m_iX1, this->m_iX2*f));
for (int xIndex = 0; xIndex < nx; ++xIndex)
{
@ -675,6 +661,7 @@ QCPColorMap * QMyCustomPlot::updateWave()
m_colorMap->data()->setCell(nx - xIndex - 1, yIndex, dz);
}
}
//m_colorMap->setDataRange(QCPRange(m_fmin, m_fmax));
return m_colorMap;
}
@ -10122,6 +10109,8 @@ void QMyCustomPlot::setScaleX(float fx1, float fx2)
pGline->point1->setCoords(fx1, -1);//位置
pGline->point2->setCoords(fx1, -2);//位置
m_vecColGrid << pGline;
pGline->setLayer("topLayer");
}
}
@ -10191,6 +10180,7 @@ void QMyCustomPlot::drawGrid(bool b)
pGline->point1->setCoords(1, -nabs1);//位置
pGline->point2->setCoords(2, -nabs1);//位置
}
pGline->setLayer("topLayer");
m_vecRowGrid << pGline;
}
}