From fb8fcee104cfc90c2b6d4d0304eb1c987cc85fd0 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 12:09:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E8=A7=84=E5=88=92=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:补齐 INI 面板中 TOOL_TABLE 字段的 LinuxCNC WASM 查询展示和浏览器验证。 --- wasm-port/docs/compatibility-validation.md | 5 +++-- wasm-port/runtime/ui/ini-panel/app.js | 2 ++ wasm-port/runtime/ui/ini-panel/index.html | 2 ++ wasm-port/tests/browser/ini_panel_smoke.html | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index cf8cd3b..b10bf4c 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -137,8 +137,9 @@ machine-session parameter/tool-table file-name strings, and performs an OPFS text-file, generic session snapshot, custom snapshot filename, invalid snapshot filename/envelope, machine file, G-code text round trip, and G-code filename path-model rejection. It also verifies that the INI panel UI exposes -the default OPFS parameter-file and tool-table mappings used when a machine -session is copied into the interpreter WASM filesystem. +LinuxCNC-backed `[RS274NGC]PARAMETER_FILE` and `[EMCIO]TOOL_TABLE` query +results, plus the default OPFS parameter-file and tool-table mappings used +when a machine session is copied into the interpreter WASM filesystem. The browser interpreter smoke script serves `wasm-port/` over localhost and runs Chromium headless against a test page that loads the interpreter-core diff --git a/wasm-port/runtime/ui/ini-panel/app.js b/wasm-port/runtime/ui/ini-panel/app.js index 884f0d4..221cce6 100644 --- a/wasm-port/runtime/ui/ini-panel/app.js +++ b/wasm-port/runtime/ui/ini-panel/app.js @@ -62,6 +62,7 @@ const fields = { joints: document.getElementById("field-joints"), coordinates: document.getElementById("field-coordinates"), parameterFile: document.getElementById("field-parameter-file"), + toolTable: document.getElementById("field-tool-table"), sessionIni: document.getElementById("field-session-ini"), sessionParameters: document.getElementById("field-session-parameters"), sessionToolTable: document.getElementById("field-session-tool-table"), @@ -282,6 +283,7 @@ document.getElementById("query").addEventListener("click", async () => { joints: { section: "KINS", tag: "JOINTS" }, coordinates: { section: "TRAJ", tag: "COORDINATES" }, parameterFile: { section: "RS274NGC", tag: "PARAMETER_FILE" }, + toolTable: { section: "EMCIO", tag: "TOOL_TABLE" }, }); for (const [name, value] of Object.entries(values)) { diff --git a/wasm-port/runtime/ui/ini-panel/index.html b/wasm-port/runtime/ui/ini-panel/index.html index 18f67d8..4dbd5a0 100644 --- a/wasm-port/runtime/ui/ini-panel/index.html +++ b/wasm-port/runtime/ui/ini-panel/index.html @@ -205,6 +205,8 @@
-
Parameter File
-
+
Tool Table
+
-
OPFS Path
linuxcnc/machines/xyzab-tdr/machine.ini
WASM Path
diff --git a/wasm-port/tests/browser/ini_panel_smoke.html b/wasm-port/tests/browser/ini_panel_smoke.html index 53c0144..509727b 100644 --- a/wasm-port/tests/browser/ini_panel_smoke.html +++ b/wasm-port/tests/browser/ini_panel_smoke.html @@ -260,6 +260,22 @@ TOOL_TABLE = browser-tool.tbl ); uiDocument.getElementById("ini-editor").value = iniText; + uiDocument.getElementById("query").click(); + await waitFor( + () => uiDocument.getElementById("log")?.textContent.includes("Queried LinuxCNC INI fields"), + "INI field query", + ); + assertEqual( + uiDocument.getElementById("field-parameter-file").textContent, + "browser-linuxcnc.var", + "UI queried parameter file", + ); + assertEqual( + uiDocument.getElementById("field-tool-table").textContent, + "browser-tool.tbl", + "UI queried tool table", + ); + uiDocument.getElementById("save-machine-files").click(); await waitFor( () => uiDocument.getElementById("log")?.textContent.includes("Saved machine text files"),