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

Method registerXAxisIfNeeded

app/src/UI/Dashboard.cpp:2359–2379  ·  view source on GitHub ↗

* @brief Registers an X-axis data buffer for a dataset's custom X source. The AxisData is * left unfilled on purpose so the XY ring grows from empty; a seeded (0,0) point * would draw a false first line segment. */

Source from the content-addressed store, hash-verified

2357 * would draw a false first line segment.
2358 */
2359void UI::Dashboard::registerXAxisIfNeeded(const DataModel::Dataset& dataset)
2360{
2361#ifdef BUILD_COMMERCIAL
2362 const auto& tk = Licensing::CommercialToken::current();
2363 if (!tk.isValid() || !SS_LICENSE_GUARD() || tk.featureTier() < Licensing::FeatureTier::Trial)
2364 return;
2365#else
2366 Q_UNUSED(dataset);
2367 return;
2368#endif
2369
2370 const int xSource = dataset.xAxisId;
2371 if (m_xAxisData.contains(xSource))
2372 return;
2373
2374 if (!m_datasets.contains(xSource))
2375 return;
2376
2377 DSP::AxisData xAxis(points() + 1);
2378 m_xAxisData.insert(xSource, xAxis);
2379}
2380
2381//--------------------------------------------------------------------------------------------------
2382// Time-ring snapshot / restore

Callers

nothing calls this directly

Calls 3

featureTierMethod · 0.80
isValidMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected