From 076ad2f4ba17feb1f053534bbf9cd6cb10d792b3 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 7 Jun 2026 21:19:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E5=BB=BA=E8=AE=AE=EF=BC=8C=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:已新增 G20/G21 单位切换 fixture,固定 vendored LinuxCNC convert_length_units() 产生的 USE_LENGTH_UNITS canonical 边界;native probe 全量验证通过。 --- wasm-port/docs/porting-steps-standalone.md | 4 ++++ wasm-port/docs/scope-and-baseline.md | 1 + wasm-port/tests/fixtures/canon/length_units.events | 8 ++++++++ wasm-port/tests/fixtures/gcode/length_units.ngc | 5 +++++ 4 files changed, 18 insertions(+) create mode 100644 wasm-port/tests/fixtures/canon/length_units.events create mode 100644 wasm-port/tests/fixtures/gcode/length_units.ngc diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index ada8dce..584136a 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -380,6 +380,10 @@ Current verified progress: `interp_convert.cc::convert_coordinate_system()`, `interp_convert.cc::convert_setup()`, and `interp_convert.cc::convert_axis_offsets()`. +- `tests/fixtures/gcode/length_units.ngc` and + `tests/fixtures/canon/length_units.events` pin `G20`/`G21` unit switching + and the `USE_LENGTH_UNITS` canonical boundary emitted by vendored + `interp_convert.cc::convert_length_units()`. - `runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp` now records feed/control canonical boundary calls emitted by vendored LinuxCNC conversion and queue code: `SET_TRAVERSE_RATE`, `SET_FEED_REFERENCE`, diff --git a/wasm-port/docs/scope-and-baseline.md b/wasm-port/docs/scope-and-baseline.md index d229796..a8d92ee 100644 --- a/wasm-port/docs/scope-and-baseline.md +++ b/wasm-port/docs/scope-and-baseline.md @@ -35,6 +35,7 @@ G-code fixture coverage includes: - linear traverse and feed - arc semantics - modal incremental and absolute distance modes +- length unit switching - position parameters - canned cycles - coordinate offsets diff --git a/wasm-port/tests/fixtures/canon/length_units.events b/wasm-port/tests/fixtures/canon/length_units.events new file mode 100644 index 0000000..2a1eed1 --- /dev/null +++ b/wasm-port/tests/fixtures/canon/length_units.events @@ -0,0 +1,8 @@ +canon_event=SELECT_PLANE plane=1 +canon_event=STRAIGHT_TRAVERSE line=1 x=25.4 y=0 z=0 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=USE_LENGTH_UNITS units=1 +canon_event=SET_FEED_RATE rate=60 +canon_event=STRAIGHT_FEED line=3 x=1.5 y=0 z=0 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=USE_LENGTH_UNITS units=2 +canon_event=SET_FEED_RATE rate=120 +canon_event=STRAIGHT_FEED line=5 x=50.8 y=0 z=0 a=0 b=0 c=0 u=0 v=0 w=0 diff --git a/wasm-port/tests/fixtures/gcode/length_units.ngc b/wasm-port/tests/fixtures/gcode/length_units.ngc new file mode 100644 index 0000000..17a873e --- /dev/null +++ b/wasm-port/tests/fixtures/gcode/length_units.ngc @@ -0,0 +1,5 @@ +G90 G17 G0 X25.4 Y0 Z0 +G20 +G1 X1.5 F60 +G21 +G1 X50.8 F120