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

Function maybeMarkDatasetVirtual

app/src/AI/ToolDispatcher.cpp:1224–1243  ·  view source on GitHub ↗

* @brief Toggles the target dataset to virtual when the apply request asks for it. */

Source from the content-addressed store, hash-verified

1222 * @brief Toggles the target dataset to virtual when the apply request asks for it.
1223 */
1224static QJsonObject maybeMarkDatasetVirtual(const QJsonObject& args,
1225 int groupId,
1226 int datasetId,
1227 QJsonArray& steps)
1228{
1229 if (!args.value(QStringLiteral("virtual")).toBool(false))
1230 return {};
1231
1232 const QJsonObject virtualArgs{
1233 {QStringLiteral("groupId"), groupId},
1234 { Keys::DatasetId, datasetId},
1235 {QStringLiteral("virtual"), true}
1236 };
1237 const auto virtualReply = runCommand(QStringLiteral("project.dataset.setVirtual"), virtualArgs);
1238 steps.append(QJsonObject{
1239 {QStringLiteral("command"), QStringLiteral("project.dataset.setVirtual")},
1240 { QStringLiteral("ok"), virtualReply.value(QStringLiteral("ok")).toBool()}
1241 });
1242 return virtualReply;
1243}
1244
1245/**
1246 * @brief Applies a transform script to its target dataset, optionally promoting it to virtual.

Callers 1

applyTransformScriptFunction · 0.85

Calls 3

runCommandFunction · 0.85
valueMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected