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

Method setPlotSweep

app/src/UI/Dashboard.cpp:1355–1382  ·  view source on GitHub ↗

* @brief Configures sweep/trigger mode for a plot; gated to commercial tiers. */

Source from the content-addressed store, hash-verified

1353 * @brief Configures sweep/trigger mode for a plot; gated to commercial tiers.
1354 */
1355void UI::Dashboard::setPlotSweep(const int index,
1356 const bool enabled,
1357 const double level,
1358 const int edge,
1359 const int mode,
1360 const double holdoff,
1361 const double timebase)
1362{
1363 auto it = m_plotSweep.find(index);
1364 if (it == m_plotSweep.end())
1365 return;
1366
1367#ifdef BUILD_COMMERCIAL
1368 const auto& tk = Licensing::CommercialToken::current();
1369 const bool ok = enabled && tk.isValid() && SS_LICENSE_GUARD()
1370 && tk.featureTier() >= Licensing::FeatureTier::Trial;
1371#else
1372 const bool ok = false;
1373#endif
1374
1375 auto& engine = it.value();
1376 engine.setTrigger(level, edge, mode, holdoff, 0);
1377 engine.setTimebase(timebase);
1378 if (engine.enabled != ok) {
1379 engine.enabled = ok;
1380 engine.resetState();
1381 }
1382}
1383
1384/**
1385 * @brief Configures sweep/trigger mode for a multiplot; gated to commercial tiers.

Callers 1

pushSweepConfigMethod · 0.80

Calls 7

findMethod · 0.80
featureTierMethod · 0.80
setTriggerMethod · 0.80
setTimebaseMethod · 0.80
isValidMethod · 0.45
valueMethod · 0.45
resetStateMethod · 0.45

Tested by

no test coverage detected