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

Method updatePlot3DSeries

app/src/UI/Dashboard.cpp:2123–2143  ·  view source on GitHub ↗

* @brief Updates 3D trajectory plot series for all 3D plot widgets. */

Source from the content-addressed store, hash-verified

2121 * @brief Updates 3D trajectory plot series for all 3D plot widgets.
2122 */
2123void UI::Dashboard::updatePlot3DSeries(int sourceId)
2124{
2125#ifdef BUILD_COMMERCIAL
2126 Q_ASSERT(static_cast<int>(m_plot3DPushes.size()) == m_plot3DRings.size());
2127 Q_ASSERT(m_points > 0);
2128
2129 const auto maxPoints = static_cast<std::size_t>(points());
2130 for (const auto& p : m_plot3DPushes) {
2131 if (sourceId >= 0 && p.sourceId != sourceId)
2132 continue;
2133
2134 if (p.ring->capacity() != maxPoints) [[unlikely]]
2135 p.ring->resize(maxPoints);
2136
2137 p.ring->push(
2138 QVector3D(static_cast<float>(*p.x), static_cast<float>(*p.y), static_cast<float>(*p.z)));
2139 }
2140#else
2141 (void)sourceId;
2142#endif
2143}
2144
2145/**
2146 * @brief Updates linear plot data series for all active plot widgets.

Callers

nothing calls this directly

Calls 4

pushMethod · 0.80
sizeMethod · 0.45
capacityMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected