Fixed DISCONNECTED issue when hitting stop button.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bbctrl",
|
"name": "bbctrl",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"homepage": "https://onefinitycnc.com/",
|
"homepage": "https://onefinitycnc.com/",
|
||||||
"repository": "https://github.com/OneFinityCNC/onefinity",
|
"repository": "https://github.com/OneFinityCNC/onefinity",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ class Mach(Comm):
|
|||||||
|
|
||||||
self.planner = bbctrl.Planner(ctrl)
|
self.planner = bbctrl.Planner(ctrl)
|
||||||
self.unpausing = False
|
self.unpausing = False
|
||||||
|
self.stopping = False
|
||||||
|
|
||||||
ctrl.state.set('cycle', 'idle')
|
ctrl.state.set('cycle', 'idle')
|
||||||
|
|
||||||
@@ -153,6 +154,12 @@ class Mach(Comm):
|
|||||||
self.planner.position_change()
|
self.planner.position_change()
|
||||||
self._set_cycle('idle')
|
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
|
# Unpause sync
|
||||||
if state_changed and state != 'HOLDING': self.unpausing = False
|
if state_changed and state != 'HOLDING': self.unpausing = False
|
||||||
|
|
||||||
@@ -315,7 +322,10 @@ class Mach(Comm):
|
|||||||
else: super().i2c_command(Cmd.UNPAUSE)
|
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()
|
def pause(self): super().pause()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user