推进 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

@@ -49,6 +49,7 @@ For the short page/entry map, see `docs/panel-entry.md`.
machineFiles: { iniOpfsPath: "...", toolTableOpfsPath: "...", parameterOpfsPath: "...", gcodeOpfsPath: "..." },
sessionSnapshot: { snapshotLabel: "...", workflow: "save-session-snapshot" },
sessionLoad: { iniOpfsPath: "...", iniWasmPath: "..." },
runReadiness: { phase: "ready", canRun: true, runButton: { enabled: true } },
run: { runStatus: "ok", programSource: "snapshot" },
fiveaxisRemap: "ok"
}
@@ -100,6 +101,7 @@ with four sections:
session: { snapshotLabel: "...", workflow: "...", ini: "...", parameters: "...", toolTable: "...", gcode: "..." },
loaded: { iniWasmPath: "...", parameterWasmPath: "...", toolTableWasmPath: "..." },
program: { source: "snapshot", opfsPath: "...", wasmPath: "..." },
runReadiness: { phase: "ready", canRun: true, buttonEnabled: true, programOpfsPath: "..." },
run: { status: "ok", canonicalEventCount: 2, motionSnapshotCount: 2, iniWasmPath: "..." },
status: { lastAction: "run-gcode", error: null, fiveaxisRemap: "ok" }
}
@@ -130,6 +132,7 @@ This helper derives a lightweight status object for upper-level control pages:
```js
{
readiness: { ini: "...", interp: "...", opfs: "..." },
runReadiness: { phase: "ready", canRun: true, buttonEnabled: true },
lastAction: "run-gcode",
error: null,
session: { snapshotLabel: "...", workflow: "...", gcode: "..." },
@@ -167,7 +170,7 @@ This helper maps a bundle into UI-ready status and sections:
sections: [
{ id: "readiness", title: "Readiness", rows: [{ label: "INI", value: "..." }] },
{ id: "session", title: "Session", rows: [{ label: "Workflow", value: "..." }] },
{ id: "run", title: "Run", rows: [{ label: "Canonical events", value: 2 }] }
{ id: "run", title: "Run", rows: [{ label: "Ready", value: "ready" }] }
]
}
```

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.