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

Function dryRunSerializeFrame

app/src/API/Handlers/ProjectHandler.cpp:5891–5910  ·  view source on GitHub ↗

* @brief Serializes a single pipeline frame into the dryRun response shape. */

Source from the content-addressed store, hash-verified

5889 * @brief Serializes a single pipeline frame into the dryRun response shape.
5890 */
5891static QJsonObject dryRunSerializeFrame(const DataModel::PipelineFrame& frame)
5892{
5893 QJsonArray rows;
5894 for (const auto& row : frame.rows) {
5895 QJsonArray cells;
5896 for (const auto& cell : row)
5897 cells.append(cell);
5898
5899 rows.append(cells);
5900 }
5901
5902 QJsonObject obj;
5903 obj[QStringLiteral("rawHex")] = QString::fromLatin1(frame.rawBytes.toHex(' '));
5904 obj[QStringLiteral("rawByteCount")] = static_cast<int>(frame.rawBytes.size());
5905 obj[QStringLiteral("decoderOutput")] = frame.decoderOutput;
5906 obj[QStringLiteral("decoderIsBinary")] = frame.decoderProducedBinary;
5907 obj[QStringLiteral("rows")] = rows;
5908 obj[QStringLiteral("rowCount")] = rows.size();
5909 return obj;
5910}
5911
5912/**
5913 * @brief Frame parser dry-run: drives extraction + decoder + parser against caller bytes.

Callers 1

frameParserDryRunMethod · 0.85

Calls 3

toHexMethod · 0.80
appendMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected