Commit e3af95cd authored by Guillaume Seguin's avatar Guillaume Seguin

Improve temperature report detection

parent 07d66212
......@@ -26,6 +26,7 @@ import argparse
import locale
import logging
import traceback
import re
from . import printcore
from printrun.printrun_utils import install_locale, run_command, \
......@@ -51,6 +52,8 @@ try:
except:
READLINE = False # neither readline module is available
tempreading_exp = re.compile("(^T:| T:)")
def dosify(name):
return os.path.split(name)[1].split(".")[0][:8] + ".g"
......@@ -1124,7 +1127,7 @@ class pronsole(cmd.Cmd):
return [i for i in self.sdfiles if i.startswith(text)]
def recvcb(self, l):
if "T:" in l:
if tempreading_exp.findall(l):
self.tempreadings = l
self.status.update_tempreading(l)
tstring = l.rstrip()
......
......@@ -59,6 +59,8 @@ from pronsole import dosify, wxSetting, HiddenSetting, StringSetting, SpinSettin
from printrun import gcoder
tempreport_exp = re.compile("([TB]\d*):([-+]?\d*\.?\d*)(?: ?\/)?([-+]?\d*\.?\d*)")
tempreading_exp = re.compile("(^T:| T:)")
extruderreading_exp = re.compile("(^E:| E:)")
def parse_temperature_report(report):
matches = tempreport_exp.findall(report)
......@@ -1458,7 +1460,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.userm114 -= 1
else:
isreport = True
if "ok T:" in l or ("T:" in l and "E:" in l):
if "ok T:" in l or (tempreading_exp.findall(l) and extruderreading_exp.findall(l)):
self.tempreport = l
wx.CallAfter(self.tempdisp.SetLabel, self.tempreport.strip().replace("ok ", ""))
self.update_tempdisplay()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment