推进 INI 面板 run readiness workflow helper

This commit is contained in:
2026-06-15 05:21:01 +08:00
parent a883af2d3e
commit 4a307f63f6
8 changed files with 322 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ summarizing an INI panel G-code run.
`runtime/ui/ini-panel/run-workflow.js` contains the reusable UI workflow for
selecting the session/default G-code program, loading it from OPFS, staging it
into the interpreter WASM filesystem, invoking the LinuxCNC interpreter, and
returning run field/log state. These helpers are intentionally pure so browser
returning run readiness, field, and log state. These helpers are intentionally pure so browser
UI panels, SDK-facing wrappers, and Node smoke tests can share the same summary
shape without reading DOM text or parsing log output.
@@ -95,8 +95,8 @@ functions:
```
It returns the selected program mapping, raw interpreter result text, run
summary, UI field state, log lines, and optional UI motion snapshots produced
by the injected `summarizeRun` callback:
summary, readiness state, UI field state, log lines, and optional UI motion
snapshots produced by the injected `summarizeRun` callback:
```js
{
@@ -108,6 +108,7 @@ by the injected `summarizeRun` callback:
},
resultText: "canon_event=...",
summary: { runStatus: "ok", programSource: "snapshot" },
readiness: { phase: "ready", canRun: true },
fields: { runStatus: "ok", sessionGcode: "linuxcnc/gcode/ui-session.ngc" },
motionSnapshots: [{ line: 1 }],
logLines: ["Program: linuxcnc/gcode/ui-session.ngc -> /work/ui-session.ngc"]
@@ -117,6 +118,10 @@ by the injected `summarizeRun` callback:
`selectSessionGcodeProgram(input)` is the pure program-selection helper used by
the workflow. Invalid snapshot G-code paths fall back to the UI default program.
`createRunSessionReadinessState(input)` is the pure readiness helper used by the
workflow and panel state summary. It reports the selected program, loaded
session path, snapshot metadata, and whether the run button can execute.
## Boundary Rules
- Do not parse G-code text in these helpers.