按规划继续工作
结论:补齐机器会话显式参数文件和刀具表文件名优先于 INI 派生值的 Node 与 Chromium 验证,保持该策略在 OPFS/SDK 主机边界内,并通过 host/WASM/browser 聚合验证。
This commit is contained in:
@@ -209,6 +209,13 @@ const bridgeIniSdk = {
|
||||
) {
|
||||
return "custom.var";
|
||||
}
|
||||
if (
|
||||
path === "/work/ini-override-session.ini" &&
|
||||
section === "RS274NGC" &&
|
||||
tag === "PARAMETER_FILE"
|
||||
) {
|
||||
return "ignored.var";
|
||||
}
|
||||
if (
|
||||
path === "/work/invalid-ini-file-session.ini" &&
|
||||
section === "RS274NGC" &&
|
||||
@@ -223,6 +230,13 @@ const bridgeIniSdk = {
|
||||
) {
|
||||
return "custom-tool.tbl";
|
||||
}
|
||||
if (
|
||||
path === "/work/ini-override-session.ini" &&
|
||||
section === "EMCIO" &&
|
||||
tag === "TOOL_TABLE"
|
||||
) {
|
||||
return "ignored-tool.tbl";
|
||||
}
|
||||
if (
|
||||
path === "/work/invalid-tool-file-session.ini" &&
|
||||
section === "EMCIO" &&
|
||||
@@ -430,6 +444,53 @@ assert.equal(
|
||||
"tooldata_load=0\nload_tool_path=/work/ini-file-session-tool.tbl\nrandom_toolchanger=0\n",
|
||||
);
|
||||
|
||||
await saveMachineTextFiles("ini-override-session", {
|
||||
ini: [
|
||||
"[EMC]",
|
||||
"MACHINE = ini-override-session",
|
||||
"",
|
||||
"[RS274NGC]",
|
||||
"PARAMETER_FILE = ignored.var",
|
||||
"",
|
||||
"[EMCIO]",
|
||||
"TOOL_TABLE = ignored-tool.tbl",
|
||||
"",
|
||||
].join("\n"),
|
||||
}, { storage });
|
||||
await saveTextFile(
|
||||
"linuxcnc/machines/ini-override-session/explicit.var",
|
||||
"5161 11.0\n5162 22.0\n",
|
||||
storage,
|
||||
);
|
||||
await saveTextFile(
|
||||
"linuxcnc/machines/ini-override-session/explicit-tool.tbl",
|
||||
"T3 P3 Z1.75 D0.375\n",
|
||||
storage,
|
||||
);
|
||||
const loadedIniOverrideSession = await loadMachineSessionFromOpfs(
|
||||
bridgeInterp,
|
||||
"ini-override-session",
|
||||
{
|
||||
storage,
|
||||
iniSdk: bridgeIniSdk,
|
||||
iniWasmPath: "/work/ini-override-session.ini",
|
||||
parameterFilename: "explicit.var",
|
||||
parameterWasmPath: "/work/ini-override-session.var",
|
||||
toolTableFilename: "explicit-tool.tbl",
|
||||
toolTableWasmPath: "/work/ini-override-session-tool.tbl",
|
||||
},
|
||||
);
|
||||
assert.equal(
|
||||
loadedIniOverrideSession.parameters.opfsPath,
|
||||
"linuxcnc/machines/ini-override-session/explicit.var",
|
||||
);
|
||||
assert.equal(
|
||||
loadedIniOverrideSession.toolTable.opfsPath,
|
||||
"linuxcnc/machines/ini-override-session/explicit-tool.tbl",
|
||||
);
|
||||
assert.equal(bridgeFiles.get("/work/ini-override-session.var"), "5161 11.0\n5162 22.0\n");
|
||||
assert.equal(bridgeFiles.get("/work/ini-override-session-tool.tbl"), "T3 P3 Z1.75 D0.375\n");
|
||||
|
||||
await saveMachineTextFiles("invalid-ini-file-session", {
|
||||
ini: [
|
||||
"[EMC]",
|
||||
|
||||
Reference in New Issue
Block a user