From e56a97bfa2a06a561126fc26cc8c1967634ffe38 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Mar 2019 17:28:22 +0600 Subject: [PATCH 1/2] monitor does not show "Build Plate" bed_temperature_matches : error in temperature search expression --- plugins/USBPrinting/USBPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 752773723e..e49f0c166e 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -265,7 +265,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): if 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*) ?\/?(\d+\.?\d*)?", line) if bed_temperature_matches: match = bed_temperature_matches[0] if match[0]: From 70e640be2276955f3befd72bba12538850ebd4ca Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 8 Mar 2019 11:25:49 +0600 Subject: [PATCH 2/2] Change regexp for greater compatibility Change regexp in bed_temperature_matches and extruder_temperature_matches for greater compatibility with different printers. --- plugins/USBPrinting/USBPrinterOutputDevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index e49f0c166e..3375ac27e7 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -243,7 +243,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self._last_temperature_request = time() 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 matched_extruder_nrs = [] for match in extruder_temperature_matches: @@ -265,7 +265,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): if 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: match = bed_temperature_matches[0] if match[0]: