推进 INI 面板 machine file summary helper
This commit is contained in:
33
wasm-port/runtime/ui/ini-panel/machine-file-summary.js
Normal file
33
wasm-port/runtime/ui/ini-panel/machine-file-summary.js
Normal 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}`,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user