diff --git a/wasm-port/docs/porting-steps-standalone.md b/wasm-port/docs/porting-steps-standalone.md index d82e70e..cc84a72 100644 --- a/wasm-port/docs/porting-steps-standalone.md +++ b/wasm-port/docs/porting-steps-standalone.md @@ -421,6 +421,12 @@ Current verified progress: `WAIT_SPINDLE_ORIENT_COMPLETE`. `tests/fixtures/gcode/spindle_orient.ngc` and `tests/fixtures/canon/spindle_orient.events` pin `M19 R/P/Q` behavior from `interp_convert.cc::convert_m()` and `interp_queue.cc`. +- `runtime/core/linuxcnc_wrap/linuxcnc_interp_minimal_runtime.cpp` now records + tool-table canonical boundary calls emitted by vendored + `interp_convert.cc::convert_setup_tool()`: `SET_TOOL_TABLE_ENTRY`. + `tests/fixtures/gcode/tool_table_setup.ngc` and + `tests/fixtures/canon/tool_table_setup.events` pin `G10 L1` tool offset, + diameter, front/back angle, and orientation 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 01607df..937a282 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 @@ -252,7 +252,27 @@ void WAIT_SPINDLE_ORIENT_COMPLETE(int spindle, double timeout) void LOCK_SPINDLE_Z() {} void USE_SPINDLE_FORCE() {} void USE_NO_SPINDLE_FORCE() {} -void SET_TOOL_TABLE_ENTRY(int, int, const EmcPose &, double, double, double, int) {} +void SET_TOOL_TABLE_ENTRY(int pocket, int toolno, const EmcPose &offset, double diameter, + double frontangle, double backangle, int orientation) +{ + std::ostringstream oss; + oss << "SET_TOOL_TABLE_ENTRY pocket=" << pocket + << " toolno=" << toolno + << " x=" << offset.tran.x + << " y=" << offset.tran.y + << " z=" << offset.tran.z + << " a=" << offset.a + << " b=" << offset.b + << " c=" << offset.c + << " u=" << offset.u + << " v=" << offset.v + << " w=" << offset.w + << " diameter=" << diameter + << " frontangle=" << frontangle + << " backangle=" << backangle + << " orientation=" << orientation; + standalone::push_canon_event(oss.str()); +} void USE_TOOL_LENGTH_OFFSET(const EmcPose &offset) { std::ostringstream oss; diff --git a/wasm-port/tests/fixtures/canon/tool_table_setup.events b/wasm-port/tests/fixtures/canon/tool_table_setup.events new file mode 100644 index 0000000..3b9ccc5 --- /dev/null +++ b/wasm-port/tests/fixtures/canon/tool_table_setup.events @@ -0,0 +1,3 @@ +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_TOOL_TABLE_ENTRY pocket=2 toolno=2 x=1 y=2 z=3 a=0 b=0 c=0 u=0 v=0 w=0 diameter=1 frontangle=12 backangle=34 orientation=4 diff --git a/wasm-port/tests/fixtures/gcode/tool_table_setup.ngc b/wasm-port/tests/fixtures/gcode/tool_table_setup.ngc new file mode 100644 index 0000000..631bcca --- /dev/null +++ b/wasm-port/tests/fixtures/gcode/tool_table_setup.ngc @@ -0,0 +1,2 @@ +G90 G17 G0 X0 Y0 Z0 +G10 L1 P2 X1 Y2 Z3 R0.5 I12 J34 Q4