推进 INI 面板 G-code 回退来源 guard
This commit is contained in:
@@ -323,9 +323,11 @@ function gcodeFilenameFromSnapshotPath(path) {
|
||||
async function loadSelectedGcodeProgram() {
|
||||
const opfsPath = restoredSessionSnapshot?.payload?.files?.gcode;
|
||||
const filename = gcodeFilenameFromSnapshotPath(opfsPath);
|
||||
const hasSnapshotGcode = typeof opfsPath === "string" && opfsPath.startsWith("linuxcnc/gcode/");
|
||||
return {
|
||||
filename,
|
||||
opfsPath: opfsPath ?? `linuxcnc/gcode/${filename}`,
|
||||
source: hasSnapshotGcode ? "snapshot" : "default",
|
||||
wasmPath: GCODE_WASM_FILE,
|
||||
text: await loadGcodeProgram(filename),
|
||||
};
|
||||
@@ -593,6 +595,7 @@ document.getElementById("run-gcode").addEventListener("click", async () => {
|
||||
[
|
||||
"Ran G-code through LinuxCNC interpreter WASM.",
|
||||
`Program: ${program.opfsPath} -> ${program.wasmPath}`,
|
||||
`Program source: ${program.source}`,
|
||||
`INI: ${loadedSession.ini.wasmPath}`,
|
||||
result.trim(),
|
||||
].join("\n"),
|
||||
|
||||
Reference in New Issue
Block a user