推进 INI 面板状态 bundle helper
This commit is contained in:
@@ -21,6 +21,7 @@ shims.
|
||||
For control-page polling, use
|
||||
`window.linuxCncIniPanelApi.getMachineSessionWorkflowStatus()`. It returns a
|
||||
smaller workflow-facing object derived from the same report data.
|
||||
For a single read call, use `window.linuxCncIniPanelApi.getMachineSessionStateBundle()`.
|
||||
|
||||
## `createIniPanelStateSummary(input)`
|
||||
|
||||
@@ -124,6 +125,23 @@ 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.
|
||||
|
||||
## `createMachineSessionStateBundle(state, options)`
|
||||
|
||||
This helper packages the current report, export payload, and workflow status
|
||||
into one read-only object:
|
||||
|
||||
```js
|
||||
{
|
||||
report: { ... },
|
||||
export: { filename: "...", mediaType: "application/json", report: { ... }, text: "{...}\n" },
|
||||
workflowStatus: { readiness: { ... }, lastAction: "...", error: null, session: { ... }, run: { ... } }
|
||||
}
|
||||
```
|
||||
|
||||
It is the preferred single-entry helper for control-page polling and other
|
||||
upper-level UI consumers that want one stable read instead of stitching the
|
||||
three views together themselves.
|
||||
|
||||
## Boundary Rules
|
||||
|
||||
- Do not parse G-code text in this helper.
|
||||
|
||||
Reference in New Issue
Block a user