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

Function applyPainterScript

app/src/AI/ToolDispatcher.cpp:1302–1317  ·  view source on GitHub ↗

* @brief Applies a painter script, resolving the target group from the request. */

Source from the content-addressed store, hash-verified

1300 * @brief Applies a painter script, resolving the target group from the request.
1301 */
1302static QJsonObject applyPainterScript(const QJsonObject& args, const QJsonObject& dryRun)
1303{
1304 auto groupReply = resolveGroup(args);
1305 if (!groupReply.value(QStringLiteral("ok")).toBool())
1306 return groupReply;
1307
1308 QJsonObject applyArgs;
1309 applyArgs[QStringLiteral("code")] = args.value(QStringLiteral("code")).toString();
1310 applyArgs[QStringLiteral("groupId")] =
1311 groupReply.value(QStringLiteral("group")).toObject().value(QStringLiteral("groupId")).toInt();
1312
1313 const QString command = QStringLiteral("project.painter.setCode");
1314 auto applyReply = runCommand(command, applyArgs);
1315 applyReply[QStringLiteral("dryRun")] = dryRun;
1316 return attachRepairHint(applyReply, command);
1317}
1318
1319/**
1320 * @brief Validates a script with dryRun, then routes the apply to the right project mutation.

Callers 1

executeScriptApplyFunction · 0.85

Calls 4

resolveGroupFunction · 0.85
runCommandFunction · 0.85
attachRepairHintFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected