Commit 29f982e9 authored by Guillaume Seguin's avatar Guillaume Seguin

Update displayed temperature targets when processing M105 replies (#367)

parent e5e6349a
......@@ -50,7 +50,7 @@ import pronsole
from pronsole import dosify, wxSetting, HiddenSetting, StringSetting, SpinSetting, FloatSpinSetting, BooleanSetting, StaticTextSetting
from printrun import gcoder
tempreport_exp = re.compile("([TB]\d*):([-+]?\d*\.?\d*)(?: \/)?([-+]?\d*\.?\d*)")
tempreport_exp = re.compile("([TB]\d*):([-+]?\d*\.?\d*)(?: ?\/)?([-+]?\d*\.?\d*)")
def parse_temperature_report(report):
matches = tempreport_exp.findall(report)
......@@ -1226,15 +1226,32 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if "T0" in temps:
hotend_temp = float(temps["T0"][0])
else:
hotend_temp = float(temps["T"][0]) if "T" in temps else -1.0
if self.display_graph: wx.CallAfter(self.graph.SetExtruder0Temperature, hotend_temp)
if self.display_gauges: wx.CallAfter(self.hottgauge.SetValue, hotend_temp)
hotend_temp = float(temps["T"][0]) if "T" in temps else None
if hotend_temp is not None:
if self.display_graph: wx.CallAfter(self.graph.SetExtruder0Temperature, hotend_temp)
if self.display_gauges: wx.CallAfter(self.hottgauge.SetValue, hotend_temp)
setpoint = None
if "T0" in temps and temps["T0"][1]: setpoint = float(temps["T0"][1])
elif temps["T"][1]: setpoint = float(temps["T"][1])
if setpoint is not None:
if self.display_graph: wx.CallAfter(self.graph.SetExtruder0TargetTemperature, setpoint)
if self.display_gauges: wx.CallAfter(self.hottgauge.SetTarget, setpoint)
if "T1" in temps:
hotend_temp = float(temps["T1"][0])
if self.display_graph: wx.CallAfter(self.graph.SetExtruder1Temperature, hotend_temp)
bed_temp = float(temps["B"][0]) if "B" in temps else -1.0
if self.display_graph: wx.CallAfter(self.graph.SetBedTemperature, bed_temp)
if self.display_gauges: wx.CallAfter(self.bedtgauge.SetValue, bed_temp)
setpoint = temps["T1"][1]
if setpoint and self.display_graph:
wx.CallAfter(self.graph.SetExtruder1TargetTemperature, float(setpoint))
bed_temp = float(temps["B"][0]) if "B" in temps else None
if bed_temp is not None:
if self.display_graph: wx.CallAfter(self.graph.SetBedTemperature, bed_temp)
if self.display_gauges: wx.CallAfter(self.bedtgauge.SetValue, bed_temp)
setpoint = temps["B"][1]
if setpoint:
setpoint = float(setpoint)
if self.display_graph: wx.CallAfter(self.graph.SetBedTargetTemperature, setpoint)
if self.display_gauges: wx.CallAfter(self.bedtgauge.SetTarget, setpoint)
except:
traceback.print_exc()
......
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