mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 02:35:53 +08:00
Merge pull request #4369 from fieldOfView/fix_usb_temperature_while_heating
Fix updating temperature while preheating bed or extruder
This commit is contained in:
commit
5456637e4a
@ -326,8 +326,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
if self._firmware_name is None:
|
if self._firmware_name is None:
|
||||||
self.sendCommand("M115")
|
self.sendCommand("M115")
|
||||||
|
|
||||||
if (b"ok " in line and b"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
|
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\.]+)?", line)
|
extruder_temperature_matches = re.findall(b"T(\d*): ?(\d+\.?\d*) ?\/?(\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:
|
||||||
@ -349,7 +349,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\.]+)?", line)
|
bed_temperature_matches = re.findall(b"B: ?(\d+\.?\d*) ?\/?(\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…
x
Reference in New Issue
Block a user