Files
cnc_wams/wasm-port/runtime/ui/ini-panel/run-summary.js

22 lines
807 B
JavaScript

export function summarizeRunResult(resultText, snapshots = []) {
return {
canonicalEventCount: resultText.split("\n").filter((line) => line.startsWith("canon_event=")).length,
motionSnapshotCount: snapshots.length,
};
}
export function createRunSummary(program, runtime = {}, snapshot = null) {
const metadata = snapshot?.metadata ?? {};
return {
runStatus: runtime.runStatus ?? "ok",
programSource: program.source,
snapshotLabel: runtime.snapshotLabel ?? metadata.snapshotLabel ?? null,
workflow: metadata.workflow ?? null,
programOpfsPath: program.opfsPath,
programWasmPath: program.wasmPath,
iniWasmPath: runtime.iniWasmPath ?? null,
canonicalEventCount: runtime.canonicalEventCount ?? 0,
motionSnapshotCount: runtime.motionSnapshotCount ?? 0,
};
}