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

Method tickPreview

app/src/UI/Widgets/Painter.cpp:410–437  ·  view source on GitHub ↗

* @brief Preview-mode tick: same as updateData() but feeds from m_previewGroup. */

Source from the content-addressed store, hash-verified

408 * @brief Preview-mode tick: same as updateData() but feeds from m_previewGroup.
409 */
410void Widgets::Painter::tickPreview()
411{
412 if (!m_previewMode)
413 return;
414
415 m_bridge->setFrame(++m_frameSeq, QDateTime::currentMSecsSinceEpoch());
416
417 if (m_compileDirty) {
418 if (!compile(m_userCode))
419 return;
420 }
421
422 if (!m_runtimeOk)
423 return;
424
425 if (m_hasOnFrame) {
426 QJSValueList noArgs;
427 auto r = m_watchdog.call(m_onFrameFn, noArgs);
428 if (r.isError()) [[unlikely]] {
429 setLastError(QStringLiteral("onFrame: ") + r.property(QStringLiteral("message")).toString());
430 setRuntimeOk(false);
431 return;
432 }
433 }
434
435 renderFrame();
436 update();
437}
438
439/**
440 * @brief Live-mode UI-tick repaint: re-runs paint() so animation and input-driven state advance

Callers

nothing calls this directly

Calls 4

updateFunction · 0.85
setFrameMethod · 0.80
isErrorMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected