mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Change regexp for greater compatibility
Change regexp in bed_temperature_matches and extruder_temperature_matches for greater compatibility with different printers.
This commit is contained in:
parent
e56a97bfa2
commit
70e640be22
1 changed files with 2 additions and 2 deletions
|
@ -243,7 +243,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
self._last_temperature_request = time()
|
self._last_temperature_request = time()
|
||||||
|
|
||||||
if re.search(b"[B|T\d*]: ?\d+\.?\d*", line): # Temperature message. 'T:' for extruder and 'B:' for bed
|
if re.search(b"[B|T\d*]: ?\d+\.?\d*", line): # Temperature message. 'T:' for extruder and 'B:' for bed
|
||||||
extruder_temperature_matches = re.findall(b"T(\d*): ?(\d+\.?\d*) ?\/?(\d+\.?\d*)?", line)
|
extruder_temperature_matches = re.findall(b"T(\d*): ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
|
||||||
# Update all temperature values
|
# Update all temperature values
|
||||||
matched_extruder_nrs = []
|
matched_extruder_nrs = []
|
||||||
for match in extruder_temperature_matches:
|
for match in extruder_temperature_matches:
|
||||||
|
@ -265,7 +265,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
if match[2]:
|
if match[2]:
|
||||||
extruder.updateTargetHotendTemperature(float(match[2]))
|
extruder.updateTargetHotendTemperature(float(match[2]))
|
||||||
|
|
||||||
bed_temperature_matches = re.findall(b"B: ?(\d+\.?\d*) ?\/?(\d+\.?\d*)?", line)
|
bed_temperature_matches = re.findall(b"B: ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
|
||||||
if bed_temperature_matches:
|
if bed_temperature_matches:
|
||||||
match = bed_temperature_matches[0]
|
match = bed_temperature_matches[0]
|
||||||
if match[0]:
|
if match[0]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue