diff --git a/package.json b/package.json index 968bec9..6e6ceac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbctrl", - "version": "1.0.8", + "version": "1.0.9", "homepage": "https://onefinitycnc.com/", "repository": "https://github.com/OneFinityCNC/onefinity", "license": "GPL-3.0+", diff --git a/src/py/bbctrl/Mach.py b/src/py/bbctrl/Mach.py index ba4a8c5..263988e 100644 --- a/src/py/bbctrl/Mach.py +++ b/src/py/bbctrl/Mach.py @@ -94,6 +94,7 @@ class Mach(Comm): self.planner = bbctrl.Planner(ctrl) self.unpausing = False + self.stopping = False ctrl.state.set('cycle', 'idle') @@ -153,6 +154,12 @@ class Mach(Comm): self.planner.position_change() self._set_cycle('idle') + # Planner stop + if state == 'READY' and self.stopping: + self.planner.stop() + self.ctrl.state.set('line', 0) + self.stopping = False + # Unpause sync if state_changed and state != 'HOLDING': self.unpausing = False @@ -315,7 +322,10 @@ class Mach(Comm): else: super().i2c_command(Cmd.UNPAUSE) - def stop(self): super().i2c_command(Cmd.STOP) + def stop(self): + if self._get_state() != 'jogging': self.stopping = True + super().i2c_command(Cmd.STOP) + def pause(self): super().pause()