按规划持续工作
This commit is contained in:
@@ -58,6 +58,34 @@ export async function createLinuxCncInterpSdk(moduleOptions = {}) {
|
||||
return mod.FS.readFile(path, { encoding: "utf8" });
|
||||
},
|
||||
|
||||
runSimConfigProgram({
|
||||
iniPath,
|
||||
programPath,
|
||||
files = [],
|
||||
executionMode = "fileWithIni",
|
||||
}) {
|
||||
for (const file of files) {
|
||||
ensureParentPath(mod, file.path);
|
||||
mod.FS.writeFile(file.path, file.text, { encoding: "utf8" });
|
||||
if (file.executable) {
|
||||
mod.FS.chmod(file.path, 0o755);
|
||||
}
|
||||
}
|
||||
|
||||
if (executionMode === "fiveAxisRemap") {
|
||||
return callStringResult(
|
||||
mod,
|
||||
"lcinterp_run_fiveaxis_remap_file",
|
||||
programPath,
|
||||
iniPath,
|
||||
);
|
||||
}
|
||||
if (executionMode === "fileWithIni") {
|
||||
return callStringResult(mod, "lcinterp_run_file_with_ini", programPath, iniPath);
|
||||
}
|
||||
throw new Error(`unsupported sim config execution mode: ${executionMode}`);
|
||||
},
|
||||
|
||||
runProgram(programText) {
|
||||
return callStringResult(mod, "lcinterp_run_program", programText);
|
||||
},
|
||||
@@ -74,10 +102,31 @@ export async function createLinuxCncInterpSdk(moduleOptions = {}) {
|
||||
return callStringResult(mod, "lcinterp_run_file_with_ini", path, iniPath);
|
||||
},
|
||||
|
||||
runFileWithIniContinueOnError(path, iniPath) {
|
||||
return callStringResult(
|
||||
mod,
|
||||
"lcinterp_run_file_with_ini_continue_on_error",
|
||||
path,
|
||||
iniPath,
|
||||
);
|
||||
},
|
||||
|
||||
runFiveAxisRemapFile(path, iniPath) {
|
||||
return callStringResult(mod, "lcinterp_run_fiveaxis_remap_file", path, iniPath);
|
||||
},
|
||||
|
||||
runRemapFile(path, iniPath) {
|
||||
return callStringResult(mod, "lcinterp_run_remap_file", path, iniPath);
|
||||
},
|
||||
|
||||
runRemapFileContinueOnError(path, iniPath) {
|
||||
return callStringResult(mod, "lcinterp_run_remap_file_continue_on_error", path, iniPath);
|
||||
},
|
||||
|
||||
runRemapIoMdiSequence(iniPath) {
|
||||
return callStringResult(mod, "lcinterp_run_remap_io_mdi_sequence", iniPath);
|
||||
},
|
||||
|
||||
restoreParameters(path) {
|
||||
return callStringResult(mod, "lcinterp_restore_parameters", path);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user