Train Elevation Chart - Avoid flooding debug log

When there is no slope/distance infomation.
Fixes #4620
This commit is contained in:
Alejandro Martinez
2025-07-25 12:57:50 -03:00
parent 2e2374761c
commit 4d95f439b7

View File

@@ -81,7 +81,7 @@ CONSTEXPR RangeColorMapper<RangeColorCriteria, 5> s_gradientToColorMapper{
void BubbleWidget::paintEvent(QPaintEvent *event)
{
if (!m_rtData || !m_ergFileAdapter)
if (!m_rtData || !m_ergFileAdapter || !m_ergFileAdapter->hasGradient())
return;
QWidget::paintEvent(event);
@@ -303,14 +303,12 @@ void
ElevationChartWindow::telemetryUpdate(const RealtimeData &rtData)
{
// If it is not visible, it saves time
if (!isVisible())
if (!isVisible() || !m_ergFileAdapter.hasGradient())
return;
m_rtData = rtData;
bubbleWidget->setRealtimeData(&m_rtData);
int npoints = 30;
int pointsAfter = 25;
int pointsBefore = npoints - pointsAfter;
QQueue<QPointF> &plotQ = slopeWidget->getPlotQ();
plotQ.clear();