diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index 39e20c9..6216104 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -396,6 +396,13 @@ Current verified progress: `tests/fixtures/gcode/probe_semantics.ngc` and `tests/fixtures/canon/probe_semantics.events` pin `G38.2`, `G38.3`, `G38.4`, and `G38.5` probe type handling. +- `runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp` now records + speed/feed synchronization and rigid-tap canonical boundary calls emitted by + vendored `interp_convert.cc::convert_straight()`: `START_SPEED_FEED_SYNCH`, + `STOP_SPEED_FEED_SYNCH`, and `RIGID_TAP`. + `tests/fixtures/gcode/threading_sync.ngc` and + `tests/fixtures/canon/threading_sync.events` pin `G33` spindle-synchronized + straight feed and `G33.1` rigid tap behavior. - `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/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp b/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp index fb079e4..3605056 100644 --- a/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp +++ b/wasm-port/runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp @@ -154,9 +154,25 @@ void SET_NAIVECAM_TOLERANCE(double tolerance) void SET_CUTTER_RADIUS_COMPENSATION(double) {} void START_CUTTER_RADIUS_COMPENSATION(int) {} void STOP_CUTTER_RADIUS_COMPENSATION() {} -void START_SPEED_FEED_SYNCH(int, double, bool) {} -void STOP_SPEED_FEED_SYNCH() {} -void RIGID_TAP(int, double, double, double, double) {} +void START_SPEED_FEED_SYNCH(int spindle, double feed_per_revolution, bool velocity_mode) +{ + std::ostringstream oss; + oss << "START_SPEED_FEED_SYNCH spindle=" << spindle + << " feed_per_revolution=" << feed_per_revolution + << " velocity_mode=" << velocity_mode; + standalone::push_canon_event(oss.str()); +} +void STOP_SPEED_FEED_SYNCH() { standalone::push_canon_event("STOP_SPEED_FEED_SYNCH"); } +void RIGID_TAP(int lineno, double x, double y, double z, double scale) +{ + std::ostringstream oss; + oss << "RIGID_TAP line=" << lineno + << " x=" << x + << " y=" << y + << " z=" << z + << " scale=" << scale; + standalone::push_canon_event(oss.str()); +} void STRAIGHT_PROBE(int lineno, double x, double y, double z, double a, double b, double c, diff --git a/wasm-port/tests/fixtures/canon/threading_sync.events b/wasm-port/tests/fixtures/canon/threading_sync.events new file mode 100644 index 0000000..8757a8f --- /dev/null +++ b/wasm-port/tests/fixtures/canon/threading_sync.events @@ -0,0 +1,11 @@ +canon_event=SELECT_PLANE plane=1 +canon_event=STRAIGHT_TRAVERSE line=1 x=0 y=0 z=0 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=SET_SPINDLE_SPEED spindle=0 speed=600 +canon_event=START_SPINDLE_CLOCKWISE spindle=0 wait_for_at_speed=1 +canon_event=START_SPEED_FEED_SYNCH spindle=0 feed_per_revolution=0.05 velocity_mode=0 +canon_event=STRAIGHT_FEED line=3 x=0 y=0 z=-1 a=0 b=0 c=0 u=0 v=0 w=0 +canon_event=STOP_SPEED_FEED_SYNCH +canon_event=START_SPEED_FEED_SYNCH spindle=0 feed_per_revolution=0.05 velocity_mode=0 +canon_event=RIGID_TAP line=4 x=0 y=0 z=0 scale=2 +canon_event=STOP_SPEED_FEED_SYNCH +canon_event=STOP_SPINDLE_TURNING spindle=0 diff --git a/wasm-port/tests/fixtures/gcode/threading_sync.ngc b/wasm-port/tests/fixtures/gcode/threading_sync.ngc new file mode 100644 index 0000000..839e776 --- /dev/null +++ b/wasm-port/tests/fixtures/gcode/threading_sync.ngc @@ -0,0 +1,5 @@ +G90 G17 G0 X0 Y0 Z0 +S600 M3 +G33 Z-1 K0.05 +G33.1 Z0 K0.05 I2 +M5