MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / updateDataSeries

Method updateDataSeries

app/src/UI/Dashboard.cpp:1989–2077  ·  view source on GitHub ↗

* @brief Updates time-series data for all dashboard widgets that require historical tracking. */

Source from the content-addressed store, hash-verified

1987 * @brief Updates time-series data for all dashboard widgets that require historical tracking.
1988 */
1989void UI::Dashboard::updateDataSeries(int sourceId)
1990{
1991 Q_ASSERT(m_widgetCount > 0 || m_widgetMap.isEmpty());
1992 Q_ASSERT(!m_sourceRawFrames.isEmpty());
1993
1994 const int gpsCount = widgetCount(SerialStudio::DashboardGPS);
1995 const int fftCount = widgetCount(SerialStudio::DashboardFFT);
1996 const int plotCount = widgetCount(SerialStudio::DashboardPlot);
1997 const int multiCount = widgetCount(SerialStudio::DashboardMultiPlot);
1998#ifdef BUILD_COMMERCIAL
1999 const int plot3DCount = widgetCount(SerialStudio::DashboardPlot3D);
2000 const int waterfallCount = widgetCount(SerialStudio::DashboardWaterfall);
2001#endif
2002
2003 if (m_gpsValues.size() != gpsCount) [[unlikely]]
2004 configureGpsSeries();
2005 if (m_fftValues.size() != fftCount) [[unlikely]]
2006 configureFftSeries();
2007 if (m_pltValues.size() != plotCount) [[unlikely]]
2008 configureLineSeries();
2009 if (m_multipltValues.size() != multiCount) [[unlikely]]
2010 configureMultiLineSeries();
2011#ifdef BUILD_COMMERCIAL
2012 if (m_plotData3D.size() != plot3DCount) [[unlikely]]
2013 configurePlot3DSeries();
2014 if (m_waterfallValues.size() != waterfallCount) [[unlikely]]
2015 configureWaterfallSeries();
2016#endif
2017
2018 updateGpsSeries(sourceId);
2019 updateFftSeries(sourceId);
2020 updateLineSeries(sourceId);
2021#ifdef BUILD_COMMERCIAL
2022 updateWaterfallSeries(sourceId);
2023#endif
2024
2025 auto feedMultiRings = [this](const MultiPush& p) {
2026 auto rIt = m_multiplotTimeRings.find(p.groupIndex);
2027 if (rIt == m_multiplotTimeRings.end())
2028 return;
2029
2030 auto& rings = rIt.value();
2031 for (const auto& tc : p.timeCurves)
2032 if (tc.curveIndex >= 0 && static_cast<std::size_t>(tc.curveIndex) < rings.size())
2033 rings[tc.curveIndex].appendDecimated(m_plotDisplayTimeSec, *tc.value);
2034 };
2035
2036 auto feedMultiSweep = [this](const MultiPush& p) {
2037 if (p.timeCurves.empty())
2038 return;
2039
2040 auto sIt = m_multiplotSweep.find(p.groupIndex);
2041 if (sIt == m_multiplotSweep.end())
2042 return;
2043
2044 DSP::SweepEngine& sweep = sIt.value();
2045 if (!sweep.enabled)
2046 return;

Callers

nothing calls this directly

Calls 8

isEmptyMethod · 0.80
findMethod · 0.80
appendDecimatedMethod · 0.80
emptyMethod · 0.80
pushMethod · 0.80
sizeMethod · 0.45
valueMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected