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

Set target temps to zero on reset.

parent 73055e59
......@@ -265,18 +265,27 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except:
pass
def do_settemp(self,l=""):
try:
if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)):
l=str(self.htemp.GetValue().split()[0])
l=l.lower().replace(",",".")
for i in self.temps.keys():
l=l.replace(i,self.temps[i])
f=float(l)
if f>=0:
if self.p.online:
self.p.send_now("M104 S"+l)
print _("Setting hotend temperature to %f degrees Celsius.") % f
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))
......@@ -295,6 +304,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx.CallAfter(self.settbtn.SetForegroundColour,"")
wx.CallAfter(self.htemp.SetBackgroundColour,"white")
wx.CallAfter(self.htemp.Refresh)
def do_settemp(self,l=""):
try:
if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)):
l=str(self.htemp.GetValue().split()[0])
l=l.lower().replace(",",".")
for i in self.temps.keys():
l=l.replace(i,self.temps[i])
f=float(l)
if f>=0:
if self.p.online:
self.p.send_now("M104 S"+l)
print _("Setting hotend temperature to %f degrees Celsius.") % f
self.sethotendgui(f)
else:
print _("Printer is not online.")
else:
......@@ -316,24 +339,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.p.online:
self.p.send_now("M140 S"+l)
print _("Setting bed temperature to %f degrees Celsius.") % 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)
self.setbedgui(f)
else:
print _("Printer is not online.")
if webavail:
......@@ -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)
if dlg.ShowModal()==wx.ID_YES:
self.p.reset()
self.sethotendgui(0)
self.setbedgui(0)
self.p.printing=0
wx.CallAfter(self.printbtn.SetLabel, _("Print"))
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