🐛 Fix broken tool filtering
This commit is contained in:
1 parent
c7b933ba00
commit
9ff44c49a6
1 file changed
+7
-3
@@ -3479,7 +3479,7 @@ class MachineCom(object):
|
||||
if not self._validate_tool(new_tool):
|
||||
self._log("Not queuing T{}, that tool doesn't exist according to the printer profile or "
|
||||
"was reported as invalid by the firmware".format(new_tool))
|
||||
return None
|
||||
return None,
|
||||
|
||||
before = self._getGcodeScript("beforeToolChange", replacements=dict(tool=dict(old=current_tool, new=new_tool)))
|
||||
after = self._getGcodeScript("afterToolChange", replacements=dict(tool=dict(old=current_tool, new=new_tool)))
|
||||
@@ -3496,15 +3496,19 @@ class MachineCom(object):
|
||||
|
||||
return convert(before) + [cmd] + convert(after)
|
||||
|
||||
def _gcode_T_sent(self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs):
|
||||
def _gcode_T_sending(self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs):
|
||||
toolMatch = regexes_parameters["intT"].search(cmd)
|
||||
if toolMatch:
|
||||
new_tool = int(toolMatch.group("value"))
|
||||
if not self._validate_tool(new_tool):
|
||||
self._log("Not sending T{}, that tool doesn't exist according to the printer profile or "
|
||||
"was reported as invalid by the firmware".format(new_tool))
|
||||
return None
|
||||
return None,
|
||||
|
||||
def _gcode_T_sent(self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs):
|
||||
toolMatch = regexes_parameters["intT"].search(cmd)
|
||||
if toolMatch:
|
||||
new_tool = int(toolMatch.group("value"))
|
||||
self._toolBeforeChange = self._currentTool
|
||||
self._currentTool = new_tool
|
||||
eventManager().fire(Events.TOOL_CHANGE, dict(old=self._toolBeforeChange, new=self._currentTool))
|
||||
|
||||
Reference in new issue
Block a user