推进 INI 面板 machine file summary helper

This commit is contained in:
2026-06-14 18:39:27 +08:00
parent 083b117c21
commit a60826bfce
6 changed files with 189 additions and 7 deletions

View File

@@ -22,6 +22,12 @@ import {
loadMachineSessionSnapshot,
saveMachineSessionSnapshot,
} from "../../opfs/snapshot-store.js";
import {
createMachineFileLoadSummary,
createMachineFileSaveSummary,
machineFileLoadLogLines,
machineFileSaveLogLines,
} from "./machine-file-summary.js";
import {
createRunSummary,
summarizeRunResult,
@@ -546,13 +552,11 @@ document.getElementById("save-machine-files").addEventListener("click", async ()
parameters: DEFAULT_PARAMETERS,
});
const gcodePath = await saveGcodeProgram(UI_SESSION.defaultGcodeFilename, DEFAULT_GCODE);
const summary = createMachineFileSaveSummary(paths, gcodePath);
setLog(
[
"Saved machine text files to OPFS.",
`INI: ${paths.ini}`,
`Tool table: ${paths.toolTable}`,
`Parameters: ${paths.parameters}`,
`G-code: ${gcodePath}`,
...machineFileSaveLogLines(summary),
].join("\n"),
);
} catch (error) {
@@ -765,12 +769,11 @@ document.getElementById("load-machine-files").addEventListener("click", async ()
try {
const files = await loadMachineTextFiles(MACHINE_ID);
editor.value = files.ini;
const summary = createMachineFileLoadSummary(files);
setLog(
[
"Loaded machine text files from OPFS.",
`INI bytes: ${files.ini.length}`,
`Tool table bytes: ${files.toolTable.length}`,
`Parameter bytes: ${files.parameters.length}`,
...machineFileLoadLogLines(summary),
].join("\n"),
);
} catch (error) {