推进 INI 面板 workflow overview helper
This commit is contained in:
@@ -132,6 +132,7 @@ This helper derives a lightweight status object for upper-level control pages:
|
||||
```js
|
||||
{
|
||||
readiness: { ini: "...", interp: "...", opfs: "..." },
|
||||
overview: { phase: "ran", missing: [], status: { lastAction: "run-gcode" } },
|
||||
runReadiness: { phase: "ready", canRun: true, buttonEnabled: true },
|
||||
lastAction: "run-gcode",
|
||||
error: null,
|
||||
@@ -143,6 +144,27 @@ This helper derives a lightweight status object for upper-level control pages:
|
||||
It is intended for polling or status panels that need current UI workflow
|
||||
state without parsing logs, DOM nodes, or transient window state.
|
||||
|
||||
## `createMachineSessionWorkflowOverview(report)`
|
||||
|
||||
This helper folds the already-normalized report into a single read-only
|
||||
workflow object for shell and control-page consumers:
|
||||
|
||||
```js
|
||||
{
|
||||
phase: "waiting" | "ready" | "ran",
|
||||
missing: [],
|
||||
readiness: { ini: "...", interp: "...", opfs: "..." },
|
||||
session: { snapshotLabel: "...", workflow: "...", ini: "...", gcode: "..." },
|
||||
loaded: { iniWasmPath: "...", parameterWasmPath: "...", toolTableWasmPath: "..." },
|
||||
runReadiness: { phase: "ready", canRun: true },
|
||||
run: { status: "ok", canonicalEventCount: 2, motionSnapshotCount: 2 },
|
||||
status: { lastAction: "run-gcode", error: null }
|
||||
}
|
||||
```
|
||||
|
||||
It combines existing UI/host boundary facts only. It does not inspect G-code
|
||||
or derive CNC behavior.
|
||||
|
||||
## `createMachineSessionStateBundle(state, options)`
|
||||
|
||||
This helper packages the current report, export payload, and workflow status
|
||||
@@ -151,8 +173,9 @@ into one read-only object:
|
||||
```js
|
||||
{
|
||||
report: { ... },
|
||||
overview: { phase: "ran", missing: [] },
|
||||
export: { filename: "...", mediaType: "application/json", report: { ... }, text: "{...}\n" },
|
||||
workflowStatus: { readiness: { ... }, lastAction: "...", error: null, session: { ... }, run: { ... } }
|
||||
workflowStatus: { readiness: { ... }, overview: { ... }, lastAction: "...", session: { ... }, run: { ... } }
|
||||
}
|
||||
```
|
||||
|
||||
@@ -170,6 +193,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: "workflow", title: "Workflow", rows: [{ label: "Phase", value: "ran" }] },
|
||||
{ id: "run", title: "Run", rows: [{ label: "Ready", value: "ready" }] }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user