Add support for R parameter in M109/M190
This commit is contained in:
parent
3f8dde75d5
commit
e15956883a
1 changed files with 11 additions and 4 deletions
|
|
@ -48,6 +48,7 @@ regex_float = re.compile(regex_float_pattern)
|
||||||
|
|
||||||
regexes_parameters = dict(
|
regexes_parameters = dict(
|
||||||
floatP=re.compile("(^|[^A-Za-z])[Pp](?P<value>%s)" % regex_float_pattern),
|
floatP=re.compile("(^|[^A-Za-z])[Pp](?P<value>%s)" % regex_float_pattern),
|
||||||
|
floatR=re.compile("(^|[^A-Za-z])[Ss](?P<value>%s)" % regex_float_pattern),
|
||||||
floatS=re.compile("(^|[^A-Za-z])[Ss](?P<value>%s)" % regex_float_pattern),
|
floatS=re.compile("(^|[^A-Za-z])[Ss](?P<value>%s)" % regex_float_pattern),
|
||||||
floatZ=re.compile("(^|[^A-Za-z])[Zz](?P<value>%s)" % regex_float_pattern),
|
floatZ=re.compile("(^|[^A-Za-z])[Zz](?P<value>%s)" % regex_float_pattern),
|
||||||
intN=re.compile("(^|[^A-Za-z])[Nn](?P<value>%s)" % regex_int_pattern),
|
intN=re.compile("(^|[^A-Za-z])[Nn](?P<value>%s)" % regex_int_pattern),
|
||||||
|
|
@ -2121,7 +2122,7 @@ class MachineCom(object):
|
||||||
return None, # Don't send bed commands if we don't have a heated bed
|
return None, # Don't send bed commands if we don't have a heated bed
|
||||||
_gcode_M190_queuing = _gcode_M140_queuing
|
_gcode_M190_queuing = _gcode_M140_queuing
|
||||||
|
|
||||||
def _gcode_M104_sent(self, cmd, cmd_type=None, wait=False):
|
def _gcode_M104_sent(self, cmd, cmd_type=None, wait=False, support_r=False):
|
||||||
toolNum = self._currentTool
|
toolNum = self._currentTool
|
||||||
toolMatch = regexes_parameters["intT"].search(cmd)
|
toolMatch = regexes_parameters["intT"].search(cmd)
|
||||||
|
|
||||||
|
|
@ -2133,6 +2134,9 @@ class MachineCom(object):
|
||||||
self._currentTool = toolNum
|
self._currentTool = toolNum
|
||||||
|
|
||||||
match = regexes_parameters["floatS"].search(cmd)
|
match = regexes_parameters["floatS"].search(cmd)
|
||||||
|
if not match and support_r:
|
||||||
|
match = regexes_parameters["floatR"].search(cmd)
|
||||||
|
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
target = float(match.group("value"))
|
target = float(match.group("value"))
|
||||||
|
|
@ -2145,8 +2149,11 @@ class MachineCom(object):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _gcode_M140_sent(self, cmd, cmd_type=None, wait=False):
|
def _gcode_M140_sent(self, cmd, cmd_type=None, wait=False, support_r=False):
|
||||||
match = regexes_parameters["floatS"].search(cmd)
|
match = regexes_parameters["floatS"].search(cmd)
|
||||||
|
if not match and support_r:
|
||||||
|
match = regexes_parameters["floatR"].search(cmd)
|
||||||
|
|
||||||
if match:
|
if match:
|
||||||
try:
|
try:
|
||||||
target = float(match.group("value"))
|
target = float(match.group("value"))
|
||||||
|
|
@ -2163,13 +2170,13 @@ class MachineCom(object):
|
||||||
self._heatupWaitStartTime = time.time()
|
self._heatupWaitStartTime = time.time()
|
||||||
self._long_running_command = True
|
self._long_running_command = True
|
||||||
self._heating = True
|
self._heating = True
|
||||||
self._gcode_M104_sent(cmd, cmd_type, wait=True)
|
self._gcode_M104_sent(cmd, cmd_type, wait=True, support_r=True)
|
||||||
|
|
||||||
def _gcode_M190_sent(self, cmd, cmd_type=None):
|
def _gcode_M190_sent(self, cmd, cmd_type=None):
|
||||||
self._heatupWaitStartTime = time.time()
|
self._heatupWaitStartTime = time.time()
|
||||||
self._long_running_command = True
|
self._long_running_command = True
|
||||||
self._heating = True
|
self._heating = True
|
||||||
self._gcode_M140_sent(cmd, cmd_type, wait=True)
|
self._gcode_M140_sent(cmd, cmd_type, wait=True, support_r=True)
|
||||||
|
|
||||||
def _gcode_M110_sending(self, cmd, cmd_type=None):
|
def _gcode_M110_sending(self, cmd, cmd_type=None):
|
||||||
newLineNumber = None
|
newLineNumber = None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue