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

Method beginDatasetPass

app/src/DataModel/FrameBuilder.cpp:1386–1412  ·  view source on GitHub ↗

* @brief Shared per-frame scaffolding (capture flag, engine cache, watchdog arm, storage pin); * returns true when the JS watchdog was armed (forwarded to endDatasetPass). */

Source from the content-addressed store, hash-verified

1384 * returns true when the JS watchdog was armed (forwarded to endDatasetPass).
1385 */
1386bool DataModel::FrameBuilder::beginDatasetPass(const TransformFrameInfo& info)
1387{
1388 static auto& parser = DataModel::FrameParser::instance();
1389 const int epoch = parser.engineEpoch();
1390 if (m_captureFlagsDirty || epoch != m_seenEngineEpoch) [[unlikely]] {
1391 m_seenEngineEpoch = epoch;
1392 refreshDatasetCaptureFlag();
1393 }
1394
1395 if (info.sourceId != m_engineCacheSourceId) [[unlikely]] {
1396 m_engineCacheSourceId = info.sourceId;
1397 auto luaIt = m_transformEngines.find({info.sourceId, SerialStudio::Lua});
1398 auto jsIt = m_transformEngines.find({info.sourceId, SerialStudio::JavaScript});
1399 m_luaEngineForSource = (luaIt != m_transformEngines.end()) ? &luaIt->second : nullptr;
1400 m_jsEngineForSource = (jsIt != m_transformEngines.end()) ? &jsIt->second : nullptr;
1401 }
1402
1403 const bool armJsWatchdog = (m_jsEngineForSource != nullptr);
1404 if (armJsWatchdog) [[unlikely]] {
1405 Q_ASSERT(m_jsEngineForSource->jsWatchdog);
1406 m_jsTransformTimedOut = false;
1407 m_jsEngineForSource->jsWatchdog->arm();
1408 }
1409
1410 ++m_compileGuard;
1411 return armJsWatchdog;
1412}
1413
1414/**
1415 * @brief Releases the dataset-pass scaffolding: unpins engine storage, disarms the watchdog and

Callers

nothing calls this directly

Calls 3

engineEpochMethod · 0.80
findMethod · 0.80
armMethod · 0.45

Tested by

no test coverage detected