Skip to content

Commit 42dce43

Browse files
committed
gscreen -fix error related to keyboard jogging and limit switch
If keyboard jogging and one hits a limit switch, you would get an endless amount of error messages. Thanks Ivan the Red on forum for testing fixes
1 parent ccf8f2d commit 42dce43

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/emc/usr_intf/gscreen/emc_interface.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def set_motion_mode(self):
139139

140140
def continuous_jog_velocity(self, velocity,angular=None):
141141
if self.masked: return
142+
if self.is_machine_off(): return
142143
self.set_motion_mode()
143144
if velocity == None:
144145
rate = self.angular_jog_velocity = angular / 60.0
@@ -151,6 +152,7 @@ def continuous_jog_velocity(self, velocity,angular=None):
151152

152153
def continuous_jog(self, axis, direction):
153154
if self.masked: return
155+
if self.is_machine_off(): return
154156
self.set_motion_mode()
155157
if direction == 0:
156158
self.isjogging[axis] = 0
@@ -170,6 +172,7 @@ def stop_jog(self, axis):
170172

171173
def incremental_jog(self, axis, direction, distance):
172174
if self.masked: return
175+
if self.is_machine_off(): return
173176
self.set_motion_mode()
174177
self.isjogging[axis] = direction
175178
if axis in (3,4,5):
@@ -292,6 +295,15 @@ def get_mode(self):
292295
self.emcstat.poll()
293296
return self.emcstat.task_mode
294297

298+
def is_machine_off(self):
299+
self.emcstat.poll()
300+
state = self.emcstat.task_state != self.emc.STATE_ON
301+
if state:
302+
# kill any jogging state
303+
for i in range(0,len(self.isjogging)):
304+
self.isjogging[i] = 0
305+
return state
306+
295307
class emc_status:
296308
def __init__(self, data, emc):
297309
self.data = data

0 commit comments

Comments
 (0)