推进 INI 面板 machine session state report helper

This commit is contained in:
2026-06-14 21:53:36 +08:00
parent 7d57bce5de
commit e80ecd4b7a
4 changed files with 209 additions and 0 deletions

View File

@@ -62,6 +62,25 @@ The INI panel updates this state after save, restore, load, run, and error
paths so browser tests and future API consumers can read one machine-readable
state object instead of collecting DOM fields and log text.
## `createMachineSessionStateReport(state)`
This helper converts the richer state snapshot into a stable consumer report
with four sections:
```js
{
readiness: { ini: "...", interp: "...", opfs: "..." },
session: { snapshotLabel: "...", workflow: "...", ini: "...", parameters: "...", toolTable: "...", gcode: "..." },
loaded: { iniWasmPath: "...", parameterWasmPath: "...", toolTableWasmPath: "..." },
program: { source: "snapshot", opfsPath: "...", wasmPath: "..." },
run: { status: "ok", canonicalEventCount: 2, motionSnapshotCount: 2, iniWasmPath: "..." },
status: { lastAction: "run-gcode", error: null, fiveaxisRemap: "ok" }
}
```
The report is intended for upper-level UI consumers or export paths that want a
stable summary shape without touching DOM nodes.
## Boundary Rules
- Do not parse G-code text in this helper.