From db83ad29f3b360e54bee7ce3bdd517bcff382717 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Tue, 16 Jun 2026 21:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0AXIS=E9=A3=8E=E6=A0=BC?= =?UTF-8?q?=E4=BB=BF=E7=9C=9F=E5=A4=96=E5=A3=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:真实浏览器仿真页面完成 AXIS-style Phase 1 外壳,新增菜单、工具栏、Manual/MDI、Preview/DRO、G-code pane、machine state 和状态栏,并保留 LinuxCNC WASM 执行与回放验证。 --- PROJECT_COMPLETION_TRACKER.md | 4 +- text15.txt | 60 ++ wasm-port/README.md | 5 +- .../axis-style-simulation-implementation.md | 18 +- .../docs/real-browser-simulation-priority.md | 4 + wasm-port/runtime/ui/simulation/index.html | 530 ++++++++++++++---- .../runtime/ui/simulation/simulation-app.js | 3 +- .../browser/real_simulation_page_smoke.html | 64 +++ 8 files changed, 564 insertions(+), 124 deletions(-) diff --git a/PROJECT_COMPLETION_TRACKER.md b/PROJECT_COMPLETION_TRACKER.md index 0bb21fc..16a53f7 100644 --- a/PROJECT_COMPLETION_TRACKER.md +++ b/PROJECT_COMPLETION_TRACKER.md @@ -9,7 +9,7 @@ turn-by-turn continuation notes and next-batch execution records. ## Current Status - Active continuation file: `text15.txt` -- Latest completed batch: real browser simulation test program selector +- Latest completed batch: AXIS-style browser simulation shell - Latest relevant commit: use `git log -1 --oneline` after each committed batch - Working tree at tracker creation: clean - Required policy: LinuxCNC remains the only CNC semantic source @@ -41,7 +41,7 @@ The project is complete for the current scope when all of the following are true | LinuxCNC semantic boundary | Stable | JS/browser remains glue, staging, OPFS, WASM/browser boundary, docs, and tests only. | | Real browser simulation priority | Active first priority | Future batches should prioritize the real UI/browser CNC simulation page, with visible machine/session loading, G-code program state, LinuxCNC-backed interpreter execution, machine readiness/status panels, toolpath/preview rendering from LinuxCNC-produced output or validated runtime events, and browser smoke coverage. First entry point: `wasm-port/runtime/ui/simulation/index.html`; gate: `wasm-port/tests/browser/verify_real_simulation_browser.sh`. See `wasm-port/docs/real-browser-simulation-priority.md`. | | Real browser simulation page | MVP active | `runtime/ui/simulation/index.html` loads in Chromium, exposes a selector for multiple LinuxCNC-backed test programs, runs them through interpreter WASM, and now includes reset/step/play/finish playback over LinuxCNC canonical motion events. It highlights active G-code and motion rows, updates live axis readout, moves the toolhead, and grows the executed SVG toolpath. Current program set covers square contour, Z pocket contour, incremental loop, G2/G3 arcs, and G81 drilling. | -| AXIS-style simulation shell | Planned | Implementation plan exists at `wasm-port/docs/axis-style-simulation-implementation.md`; next batch should build the AXIS-inspired shell while preserving current LinuxCNC-backed execution and playback APIs. | +| AXIS-style simulation shell | Phase 1 active | `runtime/ui/simulation/index.html` now uses an AXIS-inspired titlebar, menubar, toolbar, Manual/MDI tabs, Preview/DRO tabs, G-code pane, machine-state pane, and status bar while preserving current LinuxCNC-backed execution and playback APIs. Browser smoke verifies shell regions, tab switching, toolbar playback, and existing program execution. | | Vendor/source guard | Stable | `verify_vendor_sync.sh` and standalone semantic guard are required every batch. | | Interpreter WASM smoke | Stable | `interp_wasm_node_smoke=ok`. | | Sim config inventory | Stable with skips | `executed=28`, `passed=28`, `skipped=131`, `unexpected_fail=0`; `docs/sim-configs-coverage-handoff.md` records the release-gate baseline. | diff --git a/text15.txt b/text15.txt index 916e406..d331301 100644 --- a/text15.txt +++ b/text15.txt @@ -1784,3 +1784,63 @@ real_browser_simulation_priority_docs_node_smoke=ok - Browser JS 只能负责 UI、OPFS/session、SDK/WASM 调用、LinuxCNC-produced output 渲染和播放; - 禁止在 JS 中实现 G-code、modal、tool compensation、parameter、kinematics、remap、planner 或 canonical motion 语义。 + +八十二、2026-06-16 继续执行记录:AXIS-style browser simulation shell Phase 1 + +本批按 `wasm-port/docs/axis-style-simulation-implementation.md` 的 Immediate Next Batch +实现 Phase 1,不移除当前 LinuxCNC-backed execution 和 playback API。 + +本批新增实质 UI: + +- `runtime/ui/simulation/index.html` 从三列 MVP 改为 AXIS-inspired shell; +- 新增/调整区域: + - titlebar:`axis.ngc - AXIS 2.9.8 on LinuxCNC-BROWSER-SIM`; + - menubar:File / Machine / View / Help; + - toolbar:open/reload/run/playback/status/program selector; + - Manual Control / MDI tabs; + - Preview / DRO tabs; + - AXIS-like dark preview viewport; + - lower G-code pane; + - machine-state pane; + - bottom status bar:ESTOP / No tool / Position: Relative Actual; +- 保留并复用当前 data attributes: + - `data-program-selector`; + - `data-run-program`; + - playback buttons; + - `data-program-lines`; + - toolpath SVG / executed polyline / toolhead; + - motion rows; + - canonical output; +- `simulation-app.js` 的 `setText()` 改为同步所有匹配节点,支持 AXIS shell 中多个 DRO/状态显示; +- 页面脚本新增 Manual/MDI 和 Preview/DRO tab 切换; +- browser smoke 扩展验证: + - AXIS shell regions; + - File/Machine/View/Help menubar; + - Manual/MDI tab switching; + - Preview/DRO tab switching; + - statusbar; + - toolbar Step Forward 与 playback API 同步; + - 原有 LinuxCNC WASM program execution、多测试程序、回放、toolhead、executed path 仍通过。 + +本批新增/更新可执行验证: + +```bash +SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_real_simulation_browser.sh +wasm-port/tests/ui/node/verify_real_simulation_programs.sh +wasm-port/tests/docs/node/verify_axis_style_simulation_docs.sh +wasm-port/tests/docs/node/verify_real_browser_simulation_priority_docs.sh +``` + +关键通过输出: + +```text +browser_real_simulation_page_smoke=ok +real_simulation_programs_node_smoke=ok +``` + +本批仍保持 LinuxCNC 语义边界: + +- 新 shell 只是 UI layout 和 display state; +- Program execution 仍通过 `createLinuxCncInterpSdk()` / LinuxCNC WASM; +- Preview、DRO、G-code active line 和 playback 都来自 LinuxCNC-produced canonical motion event; +- 禁用的 manual/spindle/coolant/jog 控件只显示 blocked/readiness 状态,不伪造机器动作。 diff --git a/wasm-port/README.md b/wasm-port/README.md index 712cfd7..4995244 100644 --- a/wasm-port/README.md +++ b/wasm-port/README.md @@ -23,8 +23,9 @@ Z pocket contour, incremental loop, G2/G3 arc path, and G81 drill pattern. The page also includes playback controls that step or play through LinuxCNC canonical motion events, highlighting the active G-code line and moving the toolhead over the executed toolpath. -The next UI implementation direction is the AXIS-style simulation shell in -`docs/axis-style-simulation-implementation.md`. +The current UI direction is the AXIS-style simulation shell in +`docs/axis-style-simulation-implementation.md`; Phase 1 is implemented in +`runtime/ui/simulation/index.html`. The project release gate for the current scope is: diff --git a/wasm-port/docs/axis-style-simulation-implementation.md b/wasm-port/docs/axis-style-simulation-implementation.md index 2ed2b1f..e76dde9 100644 --- a/wasm-port/docs/axis-style-simulation-implementation.md +++ b/wasm-port/docs/axis-style-simulation-implementation.md @@ -84,13 +84,16 @@ menu/toolbar/status badges └───────────────────────────────────────────────────────────────┘ ``` -This should replace the current three-column MVP only after the new layout has -equivalent smoke coverage. +The Phase 1 implementation has replaced the former three-column MVP with this +AXIS-style shell while preserving the existing LinuxCNC-backed execution and +playback APIs. ## Implementation Phases ### Phase 1: AXIS-Style Shell +Status: implemented. + Build the visual shell around the existing simulation state: - menu bar: File, Machine, View, Help; @@ -109,6 +112,17 @@ Validation: - current program selection and playback still work; - no existing simulation API is removed. +Current implemented regions: + +- `data-axis-shell="titlebar"`; +- `data-axis-shell="menubar"`; +- `data-axis-shell="toolbar"`; +- `data-axis-shell="manual-mdi"`; +- `data-axis-shell="preview-dro"`; +- `data-axis-shell="gcode-pane"`; +- `data-axis-shell="machine-state"`; +- `data-axis-shell="statusbar"`. + ### Phase 2: Program Execution Workflow Upgrade the G-code pane and execution controls: diff --git a/wasm-port/docs/real-browser-simulation-priority.md b/wasm-port/docs/real-browser-simulation-priority.md index 70c9139..72a7d47 100644 --- a/wasm-port/docs/real-browser-simulation-priority.md +++ b/wasm-port/docs/real-browser-simulation-priority.md @@ -48,6 +48,10 @@ The AXIS-style simulation UI implementation plan is maintained in: docs/axis-style-simulation-implementation.md ``` +Phase 1 of that plan is implemented in `runtime/ui/simulation/index.html` with +an AXIS-inspired shell and browser smoke coverage for shell regions, tab +switching, toolbar playback, and LinuxCNC-backed program execution. + ## Batch Priority Unless a user explicitly changes priority, choose work in this order: diff --git a/wasm-port/runtime/ui/simulation/index.html b/wasm-port/runtime/ui/simulation/index.html index 35c3f71..d959e95 100644 --- a/wasm-port/runtime/ui/simulation/index.html +++ b/wasm-port/runtime/ui/simulation/index.html @@ -7,55 +7,100 @@
-
-

LinuxCNC Browser Simulation

+
+
X
+

axis.ngc - AXIS 2.9.8 on LinuxCNC-BROWSER-SIM

+ +
+ +
+ + +
-
- Simulation loading - LinuxCNC interpreter WASM +
+ + + + +
-
-
- - - - - -
+ +
-
-
-
X0.000
-
Y0.000
-
Z0.000
-
A0.000
-
B0.000
-
C0.000
+
+ + + +
+
+ + +
+
+ +
+
Spindle: + + + +
+
Coolant: + + +
+
+ Feed Override:
+ Rapid Override:
+ Spindle Override:
+ Jog Speed:
17 in/min
+ Max Velocity:
240 in/min
+
+
+ Active G-Codes:
+ G80 G17 G40 G20 G90 G94 G54 G49 G99 G64
+ G97 G91.1 G8 M5 M9 M48 M53 M0 F0 S0 +
+
+ + +
+
+ + +
+
+
+
+
+ + + + + + + +
+
+
+
X0.000
+
Y0.000
+
Z0.000
+
A0.000
+
B0.000
+
C0.000
+
+
+
+
+
+
-
-
-

Machine State

-

Active line, statement, motion rows, and canonical output.

-
+
+
+
+ Program: Executed through the LinuxCNC-backed WASM interpreter. + Active line - +
+
+
+
+
+ Machine State + Statement - +
@@ -397,16 +667,20 @@
-
Active line
-
-
+
Run Status
+
loading
Statement
-

         
-
- + +
+ ESTOP + No tool + Position: Relative Actual +