推进 INI 面板运行快照上下文日志
This commit is contained in:
@@ -341,6 +341,15 @@ function sessionMetadataLogLines(metadata = {}) {
|
||||
];
|
||||
}
|
||||
|
||||
function runSessionContextLogLines(program, snapshot = restoredSessionSnapshot) {
|
||||
return [
|
||||
`Program: ${program.opfsPath} -> ${program.wasmPath}`,
|
||||
`Program source: ${program.source}`,
|
||||
`Snapshot: ${snapshot ? sessionSnapshotLabel(snapshot.sessionId) : "-"}`,
|
||||
...sessionMetadataLogLines(snapshot?.metadata),
|
||||
];
|
||||
}
|
||||
|
||||
async function loadSelectedGcodeProgram() {
|
||||
const opfsPath = restoredSessionSnapshot?.payload?.files?.gcode;
|
||||
let filename = UI_SESSION.defaultGcodeFilename;
|
||||
@@ -628,8 +637,7 @@ document.getElementById("run-gcode").addEventListener("click", async () => {
|
||||
setLog(
|
||||
[
|
||||
"Ran G-code through LinuxCNC interpreter WASM.",
|
||||
`Program: ${program.opfsPath} -> ${program.wasmPath}`,
|
||||
`Program source: ${program.source}`,
|
||||
...runSessionContextLogLines(program),
|
||||
`INI: ${loadedSession.ini.wasmPath}`,
|
||||
result.trim(),
|
||||
].join("\n"),
|
||||
|
||||
@@ -404,6 +404,9 @@ TOOL_TABLE = browser-tool.tbl
|
||||
if (
|
||||
!fallbackRunLog.includes("Program: linuxcnc/gcode/ui-session.ngc -> /work/ui-session.ngc") ||
|
||||
!fallbackRunLog.includes("Program source: default") ||
|
||||
!fallbackRunLog.includes("Snapshot: -") ||
|
||||
!fallbackRunLog.includes("Workflow: -") ||
|
||||
!fallbackRunLog.includes("Default G-code: -") ||
|
||||
!fallbackRunLog.includes("canon_event=STRAIGHT_FEED")
|
||||
) {
|
||||
throw new Error(`UI fallback G-code run did not use default OPFS program path: ${fallbackRunLog}`);
|
||||
@@ -532,9 +535,12 @@ TOOL_TABLE = browser-tool.tbl
|
||||
const runLog = uiDocument.getElementById("log").textContent;
|
||||
if (
|
||||
!runLog.includes("Program: linuxcnc/gcode/ui-session.ngc -> /work/ui-session.ngc") ||
|
||||
!runLog.includes("Program source: snapshot")
|
||||
!runLog.includes("Program source: snapshot") ||
|
||||
!runLog.includes("Snapshot: ui-machine-session/ui-machine-session.json") ||
|
||||
!runLog.includes("Workflow: save-session-snapshot") ||
|
||||
!runLog.includes("Default G-code: linuxcnc/gcode/ui-session.ngc")
|
||||
) {
|
||||
throw new Error(`UI G-code run did not use snapshot OPFS program path: ${runLog}`);
|
||||
throw new Error(`UI G-code run missing snapshot session context: ${runLog}`);
|
||||
}
|
||||
if (
|
||||
!runLog.includes("canon_event=STRAIGHT_TRAVERSE") ||
|
||||
|
||||
Reference in New Issue
Block a user