按规划继续工作
结论:补齐 INI 派生自定义参数文件路径的浏览器 OPFS 保存和备份读回验证,继续通过 vendored LinuxCNC save_parameters 路径覆盖。
This commit is contained in:
@@ -587,6 +587,64 @@
|
||||
"parameter_5399=99",
|
||||
].join("\n"),
|
||||
);
|
||||
const savedIniNamedParameters = await saveMachineParametersToOpfs(
|
||||
interp,
|
||||
"browser-ini-file-session",
|
||||
{
|
||||
5161: 33.75,
|
||||
5162: 67.5,
|
||||
5220: 1.0,
|
||||
5221: 5.25,
|
||||
5399: 199,
|
||||
},
|
||||
{
|
||||
opfsPath: loadedIniFileSession.parameters.opfsPath,
|
||||
wasmPath: loadedIniFileSession.parameters.wasmPath,
|
||||
},
|
||||
);
|
||||
if (
|
||||
savedIniNamedParameters.opfsPath !==
|
||||
"linuxcnc/machines/browser-ini-file-session/browser-custom.var"
|
||||
) {
|
||||
throw new Error(`unexpected custom saved parameter path: ${savedIniNamedParameters.opfsPath}`);
|
||||
}
|
||||
if (
|
||||
savedIniNamedParameters.backupOpfsPath !==
|
||||
"linuxcnc/machines/browser-ini-file-session/browser-custom.var.bak"
|
||||
) {
|
||||
throw new Error(`unexpected custom parameter backup path: ${savedIniNamedParameters.backupOpfsPath}`);
|
||||
}
|
||||
verifyExpectedOutput(
|
||||
"opfs_save_ini_named_parameter_file",
|
||||
savedIniNamedParameters.result,
|
||||
[
|
||||
"save_parameters=0",
|
||||
"parameter_5161=33.75",
|
||||
"parameter_5162=67.5",
|
||||
"parameter_5221=5.25",
|
||||
"parameter_5399=199",
|
||||
].join("\n"),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_saved_ini_named_parameter_text",
|
||||
await loadTextFile(loadedIniFileSession.parameters.opfsPath),
|
||||
[
|
||||
"5161\t33.750000",
|
||||
"5162\t67.500000",
|
||||
"5221\t5.250000",
|
||||
"5399\t199.000000",
|
||||
].join("\n"),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_saved_ini_named_parameter_backup_text",
|
||||
await loadTextFile(savedIniNamedParameters.backupOpfsPath),
|
||||
[
|
||||
"5161 31.25",
|
||||
"5162 62.5",
|
||||
"5221 4.5",
|
||||
"5399 99",
|
||||
].join("\n"),
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"opfs_load_ini_named_tool_table",
|
||||
loadedIniFileSession.toolTable.result,
|
||||
|
||||
Reference in New Issue
Block a user