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

Method setCode

app/src/DataModel/Scripting/ControlScript.cpp:190–202  ·  view source on GitHub ↗

* @brief Updates the control-script source; restarts the worker if connected. */

Source from the content-addressed store, hash-verified

188 * @brief Updates the control-script source; restarts the worker if connected.
189 */
190void DataModel::ControlScript::setCode(const QString& code)
191{
192 if (m_code == code)
193 return;
194
195 m_code = code;
196 Q_EMIT codeChanged();
197
198 if (shouldRun()) {
199 stopWorker();
200 startWorker();
201 }
202}
203
204/**
205 * @brief Runs the script's optional onConnect() hook synchronously BEFORE the connection opens,

Callers 3

newJsonFileMethod · 0.80
setControlScriptCodeMethod · 0.80
loadFromJsonDocumentMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected