按规划继续工作

结论:参数文件 restore/save 已通过解释器 WASM C ABI 直连 vendored LinuxCNC,native 与 host/WASM/browser 验证全部通过。
This commit is contained in:
2026-06-08 07:37:15 +08:00
parent e5697970df
commit 16585690ca
9 changed files with 223 additions and 9 deletions

View File

@@ -54,6 +54,10 @@ export async function createLinuxCncInterpSdk(moduleOptions = {}) {
mod.FS.writeFile(path, text, { encoding: "utf8" });
},
readTextFile(path) {
return mod.FS.readFile(path, { encoding: "utf8" });
},
runProgram(programText) {
return callStringResult(mod, "lcinterp_run_program", programText);
},
@@ -69,5 +73,16 @@ export async function createLinuxCncInterpSdk(moduleOptions = {}) {
runFileWithIni(path, iniPath) {
return callStringResult(mod, "lcinterp_run_file_with_ini", path, iniPath);
},
restoreParameters(path) {
return callStringResult(mod, "lcinterp_restore_parameters", path);
},
saveParameters(path, values) {
const assignments = Object.entries(values)
.map(([parameter, value]) => `${parameter} ${value}`)
.join("\n");
return callStringResult(mod, "lcinterp_save_parameters", path, assignments);
},
};
}