推进 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

@@ -0,0 +1,33 @@
export function createMachineFileSaveSummary(paths, gcodePath = null) {
return {
iniOpfsPath: paths?.ini ?? null,
toolTableOpfsPath: paths?.toolTable ?? null,
parameterOpfsPath: paths?.parameters ?? null,
gcodeOpfsPath: gcodePath ?? null,
};
}
export function machineFileSaveLogLines(summary) {
return [
`INI: ${summary.iniOpfsPath ?? "-"}`,
`Tool table: ${summary.toolTableOpfsPath ?? "-"}`,
`Parameters: ${summary.parameterOpfsPath ?? "-"}`,
`G-code: ${summary.gcodeOpfsPath ?? "-"}`,
];
}
export function createMachineFileLoadSummary(files) {
return {
iniBytes: files?.ini?.length ?? 0,
toolTableBytes: files?.toolTable?.length ?? 0,
parameterBytes: files?.parameters?.length ?? 0,
};
}
export function machineFileLoadLogLines(summary) {
return [
`INI bytes: ${summary.iniBytes}`,
`Tool table bytes: ${summary.toolTableBytes}`,
`Parameter bytes: ${summary.parameterBytes}`,
];
}