Commit 193347b6 authored by Kliment Yanev's avatar Kliment Yanev

Set target temps to zero on reset.

parent 73055e59
...@@ -265,6 +265,46 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -265,6 +265,46 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except: except:
pass pass
def setbedgui(self,f):
self.bsetpoint=f
#self.bedtgauge.SetTarget(int(f))
wx.CallAfter(self.graph.SetBedTargetTemperature,int(f))
if f>0:
wx.CallAfter(self.btemp.SetValue,l)
self.set("last_bed_temperature",str(f))
wx.CallAfter(self.setboff.SetBackgroundColour,"")
wx.CallAfter(self.setboff.SetForegroundColour,"")
wx.CallAfter(self.setbbtn.SetBackgroundColour,"#FFAA66")
wx.CallAfter(self.setbbtn.SetForegroundColour,"#660000")
wx.CallAfter(self.btemp.SetBackgroundColour,"#FFDABB")
else:
wx.CallAfter(self.setboff.SetBackgroundColour,"#0044CC")
wx.CallAfter(self.setboff.SetForegroundColour,"white")
wx.CallAfter(self.setbbtn.SetBackgroundColour,"")
wx.CallAfter(self.setbbtn.SetForegroundColour,"")
wx.CallAfter(self.btemp.SetBackgroundColour,"white")
wx.CallAfter(self.btemp.Refresh)
def sethotendgui(self,f):
self.hsetpoint=f
#self.hottgauge.SetTarget(int(f))
wx.CallAfter(self.graph.SetExtruder0TargetTemperature,int(f))
if f>0:
wx.CallAfter(self.htemp.SetValue,l)
self.set("last_temperature",str(f))
wx.CallAfter(self.settoff.SetBackgroundColour,"")
wx.CallAfter(self.settoff.SetForegroundColour,"")
wx.CallAfter(self.settbtn.SetBackgroundColour,"#FFAA66")
wx.CallAfter(self.settbtn.SetForegroundColour,"#660000")
wx.CallAfter(self.htemp.SetBackgroundColour,"#FFDABB")
else:
wx.CallAfter(self.settoff.SetBackgroundColour,"#0044CC")
wx.CallAfter(self.settoff.SetForegroundColour,"white")
wx.CallAfter(self.settbtn.SetBackgroundColour,"")
wx.CallAfter(self.settbtn.SetForegroundColour,"")
wx.CallAfter(self.htemp.SetBackgroundColour,"white")
wx.CallAfter(self.htemp.Refresh)
def do_settemp(self,l=""): def do_settemp(self,l=""):
try: try:
if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)): if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)):
...@@ -277,24 +317,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -277,24 +317,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.p.online: if self.p.online:
self.p.send_now("M104 S"+l) self.p.send_now("M104 S"+l)
print _("Setting hotend temperature to %f degrees Celsius.") % f print _("Setting hotend temperature to %f degrees Celsius.") % f
self.hsetpoint=f self.sethotendgui(f)
#self.hottgauge.SetTarget(int(f))
wx.CallAfter(self.graph.SetExtruder0TargetTemperature,int(f))
if f>0:
wx.CallAfter(self.htemp.SetValue,l)
self.set("last_temperature",str(f))
wx.CallAfter(self.settoff.SetBackgroundColour,"")
wx.CallAfter(self.settoff.SetForegroundColour,"")
wx.CallAfter(self.settbtn.SetBackgroundColour,"#FFAA66")
wx.CallAfter(self.settbtn.SetForegroundColour,"#660000")
wx.CallAfter(self.htemp.SetBackgroundColour,"#FFDABB")
else:
wx.CallAfter(self.settoff.SetBackgroundColour,"#0044CC")
wx.CallAfter(self.settoff.SetForegroundColour,"white")
wx.CallAfter(self.settbtn.SetBackgroundColour,"")
wx.CallAfter(self.settbtn.SetForegroundColour,"")
wx.CallAfter(self.htemp.SetBackgroundColour,"white")
wx.CallAfter(self.htemp.Refresh)
else: else:
print _("Printer is not online.") print _("Printer is not online.")
else: else:
...@@ -316,24 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -316,24 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.p.online: if self.p.online:
self.p.send_now("M140 S"+l) self.p.send_now("M140 S"+l)
print _("Setting bed temperature to %f degrees Celsius.") % f print _("Setting bed temperature to %f degrees Celsius.") % f
self.bsetpoint=f self.setbedgui(f)
#self.bedtgauge.SetTarget(int(f))
wx.CallAfter(self.graph.SetBedTargetTemperature,int(f))
if f>0:
wx.CallAfter(self.btemp.SetValue,l)
self.set("last_bed_temperature",str(f))
wx.CallAfter(self.setboff.SetBackgroundColour,"")
wx.CallAfter(self.setboff.SetForegroundColour,"")
wx.CallAfter(self.setbbtn.SetBackgroundColour,"#FFAA66")
wx.CallAfter(self.setbbtn.SetForegroundColour,"#660000")
wx.CallAfter(self.btemp.SetBackgroundColour,"#FFDABB")
else:
wx.CallAfter(self.setboff.SetBackgroundColour,"#0044CC")
wx.CallAfter(self.setboff.SetForegroundColour,"white")
wx.CallAfter(self.setbbtn.SetBackgroundColour,"")
wx.CallAfter(self.setbbtn.SetForegroundColour,"")
wx.CallAfter(self.btemp.SetBackgroundColour,"white")
wx.CallAfter(self.btemp.Refresh)
else: else:
print _("Printer is not online.") print _("Printer is not online.")
if webavail: if webavail:
...@@ -1713,6 +1719,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1713,6 +1719,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
dlg=wx.MessageDialog(self, _("Are you sure you want to reset the printer?"), _("Reset?"), wx.YES|wx.NO) dlg=wx.MessageDialog(self, _("Are you sure you want to reset the printer?"), _("Reset?"), wx.YES|wx.NO)
if dlg.ShowModal()==wx.ID_YES: if dlg.ShowModal()==wx.ID_YES:
self.p.reset() self.p.reset()
self.sethotendgui(0)
self.setbedgui(0)
self.p.printing=0 self.p.printing=0
wx.CallAfter(self.printbtn.SetLabel, _("Print")) wx.CallAfter(self.printbtn.SetLabel, _("Print"))
if self.paused: if self.paused:
......
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