From 9f498b05ce4c3c2cc83226f56d1488eaded93d46 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Sun, 7 Jun 2026 16:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E6=8E=A8=E8=8D=90=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=EF=BC=8C=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:已新增 LinuxCNC vendored interp_cycles.cc canned-cycle 回归覆盖,验证 G81/G82/G83/G80、dwell、peck drilling 和增量 L repeats 的 canonical 事件输出,原生 probe 验证通过。 --- wasm-port/docs/porting-steps-standalone.md | 5 +++ .../tests/fixtures/canon/canned_cycles.events | 36 +++++++++++++++++++ .../tests/fixtures/gcode/canned_cycles.ngc | 9 +++++ 3 files changed, 50 insertions(+) create mode 100644 wasm-port/tests/fixtures/canon/canned_cycles.events create mode 100644 wasm-port/tests/fixtures/gcode/canned_cycles.ngc diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index d500f7b..108d03f 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -365,6 +365,11 @@ Current verified progress: current-position parameter visibility for `#5420`, `#5421`, and `#5422`. The parameter source basis is LinuxCNC `interp_parameter_def.hh` and `interp_namedparams.cc`. +- `tests/fixtures/gcode/canned_cycles.ngc` and + `tests/fixtures/canon/canned_cycles.events` cover LinuxCNC canned-cycle + conversion through vendored `interp_cycles.cc`, including `G81`, `G82`, + `G83`, `G80` cancellation, dwell, peck drilling, and incremental `L` + repeats. - `tests/fixtures/gcode_errors/g1_zero_feed.ngc` and `tests/fixtures/canon_errors/g1_zero_feed.expected` pin the negative `G1` zero-feed case. The source basis is LinuxCNC diff --git a/wasm-port/tests/fixtures/canon/canned_cycles.events b/wasm-port/tests/fixtures/canon/canned_cycles.events new file mode 100644 index 0000000..bea8eee --- /dev/null +++ b/wasm-port/tests/fixtures/canon/canned_cycles.events @@ -0,0 +1,36 @@ +canon_event=STRAIGHT_TRAVERSE line=1 x=0 y=0 z=1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=SET_FEED_RATE rate=20 +canon_event=STRAIGHT_TRAVERSE line=2 x=1 y=2 z=1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=2 x=1 y=2 z=0.1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=2 x=1 y=2 z=-0.5 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=2 x=1 y=2 z=0.1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=COMMENT: interpreter: motion mode set to none +canon_event=SET_FEED_RATE rate=25 +canon_event=STRAIGHT_TRAVERSE line=4 x=1 y=2 z=0.2 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=4 x=2 y=3 z=0.2 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=4 x=2 y=3 z=-0.25 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=DWELL seconds=0.15 +canon_event=STRAIGHT_TRAVERSE line=4 x=2 y=3 z=0.2 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=COMMENT: interpreter: motion mode set to none +canon_event=SET_FEED_RATE rate=30 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=0.2 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=0.15 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=6 x=3 y=4 z=-0.1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=0.15 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=-0.1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=6 x=3 y=4 z=-0.35 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=0.15 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=-0.35 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=6 x=3 y=4 z=-0.6 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=6 x=3 y=4 z=0.15 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=COMMENT: interpreter: motion mode set to none +canon_event=SET_FEED_RATE rate=35 +canon_event=COMMENT: interpreter: distance mode changed to incremental +canon_event=STRAIGHT_TRAVERSE line=8 x=3 y=4 z=0.25 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=8 x=4 y=5 z=0.25 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=8 x=4 y=5 z=-0.15 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=8 x=4 y=5 z=0.25 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=8 x=5 y=6 z=0.25 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_FEED line=8 x=5 y=6 z=-0.15 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STRAIGHT_TRAVERSE line=8 x=5 y=6 z=0.25 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=COMMENT: interpreter: motion mode set to none diff --git a/wasm-port/tests/fixtures/gcode/canned_cycles.ngc b/wasm-port/tests/fixtures/gcode/canned_cycles.ngc new file mode 100644 index 0000000..1629120 --- /dev/null +++ b/wasm-port/tests/fixtures/gcode/canned_cycles.ngc @@ -0,0 +1,9 @@ +G90 G17 G0 X0 Y0 Z1 +G81 X1 Y2 Z-0.5 R0.1 F20 +G80 +G82 X2 Y3 Z-0.25 R0.2 P0.15 F25 +G80 +G83 X3 Y4 Z-0.6 R0.15 Q0.25 F30 +G80 +G91 G81 X1 Y1 Z-0.4 R0.1 L2 F35 +G80