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

Method loadScript

app/src/DataModel/Scripting/FrameParser.cpp:574–587  ·  view source on GitHub ↗

* @brief Validates and loads a frame parser script into the source's engine. */

Source from the content-addressed store, hash-verified

572 * @brief Validates and loads a frame parser script into the source's engine.
573 */
574bool DataModel::FrameParser::loadScript(int sourceId, const QString& script, bool showMessageBoxes)
575{
576 Q_ASSERT(sourceId >= 0);
577 Q_ASSERT(!script.isEmpty());
578
579 auto it = m_engines.find(sourceId);
580 if (it != m_engines.end() && it->second->language() != languageForSource(sourceId)) {
581 m_engines.erase(it);
582 refreshEngineCaches();
583 }
584
585 auto& engine = engineForSource(sourceId);
586 return engine.loadScript(script, sourceId, showMessageBoxes);
587}
588
589/**
590 * @brief Enables or disables UI message boxes (suppressed during API calls).

Callers 10

parserSetCodeMethod · 0.45
validateSourcesFunction · 0.45
frameParserDryCompileMethod · 0.45
transformDryRunMethod · 0.45
applyTransformForDryRunFunction · 0.45
endToEndDryRunMethod · 0.45
applyMethod · 0.45
evaluateMethod · 0.45
prepareParserTestMethod · 0.45

Calls 3

isEmptyMethod · 0.80
findMethod · 0.80
languageMethod · 0.45

Tested by

no test coverage detected