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

Method getSnapshot

app/src/AI/ToolDispatcher.cpp:2300–2334  ·  view source on GitHub ↗

* @brief Returns a one-shot composite of every readable status endpoint. */

Source from the content-addressed store, hash-verified

2298 * @brief Returns a one-shot composite of every readable status endpoint.
2299 */
2300QJsonObject AI::ToolDispatcher::getSnapshot() const
2301{
2302 static const QStringList kStatusCommands = {
2303 QStringLiteral("project.getStatus"),
2304 QStringLiteral("io.getStatus"),
2305 QStringLiteral("dashboard.getStatus"),
2306 QStringLiteral("console.getConfig"),
2307 QStringLiteral("consoleExport.getStatus"),
2308 QStringLiteral("csvExport.getStatus"),
2309 QStringLiteral("csvPlayer.getStatus"),
2310 QStringLiteral("project.mqtt.publisher.getStatus"),
2311 QStringLiteral("project.mqtt.subscriber.getStatus"),
2312 QStringLiteral("sessions.getStatus"),
2313 QStringLiteral("mdf4Export.getStatus"),
2314 QStringLiteral("mdf4Player.getStatus"),
2315 QStringLiteral("licensing.getStatus"),
2316 QStringLiteral("notifications.getUnreadCount"),
2317 };
2318
2319 QJsonObject snapshot;
2320 QJsonArray skipped;
2321 for (const auto& name : kStatusCommands) {
2322 if (!API::CommandRegistry::instance().hasCommand(name)) {
2323 skipped.append(name);
2324 continue;
2325 }
2326
2327 snapshot.insert(name, runSafeCommand(name));
2328 }
2329
2330 if (!skipped.isEmpty())
2331 snapshot.insert(QStringLiteral("skipped"), skipped);
2332
2333 return snapshot;
2334}
2335
2336/**
2337 * @brief Returns project structure assembled from a curated set of safe list commands.

Callers 1

runMetaSnapshotMethod · 0.80

Calls 4

runSafeCommandFunction · 0.85
hasCommandMethod · 0.80
isEmptyMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected