推进 INI 面板 workflow status helper
This commit is contained in:
@@ -368,8 +368,12 @@ TOOL_TABLE = browser-tool.tbl
|
||||
"INI panel OPFS readiness",
|
||||
);
|
||||
const uiApi = uiDocument.defaultView.linuxCncIniPanelApi;
|
||||
if (!uiApi?.getMachineSessionStateReport || !uiApi?.getMachineSessionStateReportExport) {
|
||||
throw new Error("INI panel API namespace did not expose state report getters");
|
||||
if (
|
||||
!uiApi?.getMachineSessionStateReport ||
|
||||
!uiApi?.getMachineSessionStateReportExport ||
|
||||
!uiApi?.getMachineSessionWorkflowStatus
|
||||
) {
|
||||
throw new Error("INI panel API namespace did not expose state getters");
|
||||
}
|
||||
|
||||
uiDocument.getElementById("ini-editor").value = iniText;
|
||||
@@ -773,6 +777,37 @@ TOOL_TABLE = browser-tool.tbl
|
||||
"snapshot",
|
||||
"UI machine session state report export program source",
|
||||
);
|
||||
const machineSessionWorkflowStatus = uiApi.getMachineSessionWorkflowStatus();
|
||||
assertEqual(
|
||||
machineSessionWorkflowStatus.lastAction,
|
||||
"run-gcode",
|
||||
"UI machine session workflow status last action",
|
||||
);
|
||||
assertEqual(
|
||||
machineSessionWorkflowStatus.error,
|
||||
null,
|
||||
"UI machine session workflow status error",
|
||||
);
|
||||
assertEqual(
|
||||
machineSessionWorkflowStatus.readiness.opfs,
|
||||
"OPFS: ready",
|
||||
"UI machine session workflow status OPFS readiness",
|
||||
);
|
||||
assertEqual(
|
||||
machineSessionWorkflowStatus.session.workflow,
|
||||
"save-session-snapshot",
|
||||
"UI machine session workflow status session workflow",
|
||||
);
|
||||
assertEqual(
|
||||
machineSessionWorkflowStatus.run.status,
|
||||
"ok",
|
||||
"UI machine session workflow status run status",
|
||||
);
|
||||
assertEqual(
|
||||
machineSessionWorkflowStatus.run.canonicalEventCount,
|
||||
2,
|
||||
"UI machine session workflow status canonical event count",
|
||||
);
|
||||
assertEqual(
|
||||
uiDocument.defaultView.getMachineSessionStateReport().status.lastAction,
|
||||
machineSessionStateReport.status.lastAction,
|
||||
|
||||
Reference in New Issue
Block a user