mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Merge pull request #3597 from fieldOfView/fix_multiextruder_usb_temperatures
[3.3] Fix getting multiple extruder temperatures from USB printer
This commit is contained in:
commit
c491cb4707
1 changed files with 15 additions and 1 deletions
|
@ -308,7 +308,21 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
if b"ok T:" in line or line.startswith(b"T:") or b"ok B:" in line or line.startswith(b"B:"): # Temperature message. 'T:' for extruder and 'B:' for bed
|
||||
extruder_temperature_matches = re.findall(b"T(\d*): ?([\d\.]+) ?\/?([\d\.]+)?", line)
|
||||
# Update all temperature values
|
||||
for match, extruder in zip(extruder_temperature_matches, self._printers[0].extruders):
|
||||
matched_extruder_nrs = []
|
||||
for match in extruder_temperature_matches:
|
||||
extruder_nr = 0
|
||||
if match[0] != b"":
|
||||
extruder_nr = int(match[0])
|
||||
|
||||
if extruder_nr in matched_extruder_nrs:
|
||||
continue
|
||||
matched_extruder_nrs.append(extruder_nr)
|
||||
|
||||
if extruder_nr >= len(self._printers[0].extruders)
|
||||
Logger.log("w", "Printer reports more temperatures than the number of configured extruders")
|
||||
continue
|
||||
|
||||
extruder = self._printers[0].extruders[extruder_nr]
|
||||
if match[1]:
|
||||
extruder.updateHotendTemperature(float(match[1]))
|
||||
if match[2]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue