From d989beb58eaafc7792eead19cff4a89fabb8f3a6 Mon Sep 17 00:00:00 2001 From: Wes Ladd Date: Mon, 13 Jul 2026 01:36:16 -0500 Subject: [PATCH] Fix resume WCS recovery after G53 --- CHANGELOG.md | 1 + carveracontroller/Controller.py | 1 - tests/unit/test_resume_wcs.py | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/unit/test_resume_wcs.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 603ca7b9..9b35212d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Enhancement: Advanced TLO Calibration option. Here you can set the offset to use from tool setter, and/or the number of repeat probings to use - Enhancement: Added a warning popup if the controller version is lower than the firmware. This is not a supported config - Enhancement: Added Auto Ext. Out toggle to spindle dropdown and Config and Run screen. This can be used to automatically run a vacuum or compressor when the spindle is running +- Fixed: Resume-at-line no longer treats the non-modal G53 command as the active work coordinate system - Fixed: Restore Keyboard Jogging state after Probing Popup is closed - Fixed: Repeated firmware checks now happen just once - Fixed: UI widget updates from the SerialMonitor() now dispatched via the main thread. This should reduce the number of RecycleView related crashes diff --git a/carveracontroller/Controller.py b/carveracontroller/Controller.py index cabedd3a..66609508 100644 --- a/carveracontroller/Controller.py +++ b/carveracontroller/Controller.py @@ -1121,7 +1121,6 @@ def playStartLineCommand(self, filename, start_line, preview=False, lines=None, # Search for WCS coordinate space - find the last one used wcs_commands = [ - ("G53", self._find_command_line_number(lines, start_line, "G53")), ("G54", self._find_command_line_number(lines, start_line, "G54")), ("G55", self._find_command_line_number(lines, start_line, "G55")), ("G56", self._find_command_line_number(lines, start_line, "G56")), diff --git a/tests/unit/test_resume_wcs.py b/tests/unit/test_resume_wcs.py new file mode 100644 index 00000000..6fc8018a --- /dev/null +++ b/tests/unit/test_resume_wcs.py @@ -0,0 +1,20 @@ +"""Tests for resume-at-line work coordinate system recovery.""" + +from carveracontroller.Controller import Controller + + +def test_g53_does_not_replace_active_work_coordinate_system(): + controller = Controller.__new__(Controller) + controller._get_line_position_from_gcode_viewer = lambda _line: (None, None, None, None) + lines = [ + "G55\n", + "G53 G0 Z-2\n", + "G1 X10 F100\n", + "G1 X20\n", + ] + + commands = controller.playStartLineCommand("job.nc", 4, preview=True, lines=lines) + + assert "buffer G55" in commands + assert "buffer G53" not in commands + assert "buffer G53 G0 Z-2" in commands