Fixed regex groups for GCODE parameters
This commit is contained in:
parent
6271bcfe05
commit
168d32eb63
1 changed files with 5 additions and 5 deletions
|
|
@ -1751,14 +1751,14 @@ class MachineCom(object):
|
||||||
def _gcode_T_sent(self, cmd, cmd_type=None):
|
def _gcode_T_sent(self, cmd, cmd_type=None):
|
||||||
toolMatch = regexes_parameters["intT"].search(cmd)
|
toolMatch = regexes_parameters["intT"].search(cmd)
|
||||||
if toolMatch:
|
if toolMatch:
|
||||||
self._currentTool = int(toolMatch.group(1))
|
self._currentTool = int(toolMatch.group("value"))
|
||||||
|
|
||||||
def _gcode_G0_sent(self, cmd, cmd_type=None):
|
def _gcode_G0_sent(self, cmd, cmd_type=None):
|
||||||
if 'Z' in cmd:
|
if 'Z' in cmd:
|
||||||
match = regexes_parameters["floatZ"].search(cmd)
|
match = regexes_parameters["floatZ"].search(cmd)
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
z = float(match.group(1))
|
z = float(match.group("value"))
|
||||||
if self._currentZ != z:
|
if self._currentZ != z:
|
||||||
self._currentZ = z
|
self._currentZ = z
|
||||||
self._callback.on_comm_z_change(z)
|
self._callback.on_comm_z_change(z)
|
||||||
|
|
@ -1775,11 +1775,11 @@ class MachineCom(object):
|
||||||
toolNum = self._currentTool
|
toolNum = self._currentTool
|
||||||
toolMatch = regexes_parameters["intT"].search(cmd)
|
toolMatch = regexes_parameters["intT"].search(cmd)
|
||||||
if toolMatch:
|
if toolMatch:
|
||||||
toolNum = int(toolMatch.group(1))
|
toolNum = int(toolMatch.group("value"))
|
||||||
match = regexes_parameters["floatS"].search(cmd)
|
match = regexes_parameters["floatS"].search(cmd)
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
target = float(match.group(1))
|
target = float(match.group("value"))
|
||||||
if toolNum in self._temp.keys() and self._temp[toolNum] is not None and isinstance(self._temp[toolNum], tuple):
|
if toolNum in self._temp.keys() and self._temp[toolNum] is not None and isinstance(self._temp[toolNum], tuple):
|
||||||
(actual, oldTarget) = self._temp[toolNum]
|
(actual, oldTarget) = self._temp[toolNum]
|
||||||
self._temp[toolNum] = (actual, target)
|
self._temp[toolNum] = (actual, target)
|
||||||
|
|
@ -1792,7 +1792,7 @@ class MachineCom(object):
|
||||||
match = regexes_parameters["floatS"].search(cmd)
|
match = regexes_parameters["floatS"].search(cmd)
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
target = float(match.group(1))
|
target = float(match.group("value"))
|
||||||
if self._bedTemp is not None and isinstance(self._bedTemp, tuple):
|
if self._bedTemp is not None and isinstance(self._bedTemp, tuple):
|
||||||
(actual, oldTarget) = self._bedTemp
|
(actual, oldTarget) = self._bedTemp
|
||||||
self._bedTemp = (actual, target)
|
self._bedTemp = (actual, target)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue