gcodeToEvent can only fire one event per gcode function anyway. <1% performance increase.

master
Bryan Mayland 2013-06-28 11:23:40 -04:00
parent b5661c6f5e
commit 715eb142f8
1 changed files with 3 additions and 3 deletions

View File

@ -914,9 +914,9 @@ class MachineCom(object):
gfunc = re.search('([GM][0-9]+)', cmd) gfunc = re.search('([GM][0-9]+)', cmd)
if gfunc: if gfunc:
gfunc = gfunc.group(1) gfunc = gfunc.group(1)
for gcode in gcodeToEvent.keys():
if gcode == gfunc: if gfunc in gcodeToEvent:
eventManager().fire(gcodeToEvent[gcode]) eventManager().fire(gcodeToEvent[gfunc])
if (gfunc == "G0" or gfunc == "G1") and 'Z' in cmd: if (gfunc == "G0" or gfunc == "G1") and 'Z' in cmd:
z = float(re.search('Z([0-9\.]*)', cmd).group(1)) z = float(re.search('Z([0-9\.]*)', cmd).group(1))