From 1d96aa8a55e0417d026553245b5a938e0cca8d8e Mon Sep 17 00:00:00 2001 From: cnc Date: Sat, 6 Jun 2026 08:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E6=BA=90=E9=AA=8C=E8=AF=81=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=88=87=E6=8D=A2UVW=E7=BA=BF=E6=80=A7=E8=BD=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test-linuxcnc-rs274-native.sh | 4 ++++ test-linuxcnc-source-link.sh | 4 ++++ tests/gcode/linuxcnc_units_current_position.ngc | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test-linuxcnc-rs274-native.sh b/test-linuxcnc-rs274-native.sh index bd7deef..3e3ff52 100755 --- a/test-linuxcnc-rs274-native.sh +++ b/test-linuxcnc-rs274-native.sh @@ -1227,6 +1227,10 @@ if units_rapid[2]["start"] != units_rapid[2]["end"]: ) if (units_rapid[1]["end"]["a"], units_rapid[1]["end"]["b"], units_rapid[1]["end"]["c"]) != (4, 5, 6): raise SystemExit("LinuxCNC G21 unit change unexpectedly scaled rotary axes") +if (units_rapid[1]["end"]["u"], units_rapid[1]["end"]["v"], units_rapid[1]["end"]["w"]) != (177.8, 203.2, 228.6): + raise SystemExit("LinuxCNC G21 unit change did not scale U/V/W linear axes") +if (units_rapid[2]["end"]["u"], units_rapid[2]["end"]["v"], units_rapid[2]["end"]["w"]) != (7, 8, 9): + raise SystemExit("LinuxCNC G20 unit change did not restore U/V/W linear axes") units_g92_restore = load("cnc_sim_linuxcnc_units_g92_restore.json") units_g92_states = [ diff --git a/test-linuxcnc-source-link.sh b/test-linuxcnc-source-link.sh index ecfc442..619a321 100755 --- a/test-linuxcnc-source-link.sh +++ b/test-linuxcnc-source-link.sh @@ -1927,6 +1927,10 @@ if units_rapid[2]["start"] != units_rapid[2]["end"]: ) if (units_rapid[1]["end"]["a"], units_rapid[1]["end"]["b"], units_rapid[1]["end"]["c"]) != (4, 5, 6): raise SystemExit("source-linked LinuxCNC G21 unit change unexpectedly scaled rotary axes") +if (units_rapid[1]["end"]["u"], units_rapid[1]["end"]["v"], units_rapid[1]["end"]["w"]) != (177.8, 203.2, 228.6): + raise SystemExit("source-linked LinuxCNC G21 unit change did not scale U/V/W linear axes") +if (units_rapid[2]["end"]["u"], units_rapid[2]["end"]["v"], units_rapid[2]["end"]["w"]) != (7, 8, 9): + raise SystemExit("source-linked LinuxCNC G20 unit change did not restore U/V/W linear axes") units_g92_restore = load("cnc_sim_linuxcnc_source_units_g92_restore.json") units_g92_states = [ diff --git a/tests/gcode/linuxcnc_units_current_position.ngc b/tests/gcode/linuxcnc_units_current_position.ngc index 39690ae..bfe4524 100644 --- a/tests/gcode/linuxcnc_units_current_position.ngc +++ b/tests/gcode/linuxcnc_units_current_position.ngc @@ -1,8 +1,8 @@ G20 G90 G17 (Source basis: LinuxCNC unit_tests/interp/test_interp_basics.cc Convert G20 / G21 verifies that current linear axes rescale on unit changes while rotary axes keep angular values.) -G0 X1 Y2 Z3 A4 B5 C6 +G0 X1 Y2 Z3 A4 B5 C6 U7 V8 W9 G21 -G0 X25.4 Y50.8 Z76.2 A4 B5 C6 +G0 X25.4 Y50.8 Z76.2 A4 B5 C6 U177.8 V203.2 W228.6 G20 -G0 X1 Y2 Z3 A4 B5 C6 +G0 X1 Y2 Z3 A4 B5 C6 U7 V8 W9 M30