Set target temps to zero on reset.
parent
73055e59a8
commit
193347b63d
|
@ -265,18 +265,27 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def do_settemp(self,l=""):
|
def setbedgui(self,f):
|
||||||
try:
|
self.bsetpoint=f
|
||||||
if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)):
|
#self.bedtgauge.SetTarget(int(f))
|
||||||
l=str(self.htemp.GetValue().split()[0])
|
wx.CallAfter(self.graph.SetBedTargetTemperature,int(f))
|
||||||
l=l.lower().replace(",",".")
|
if f>0:
|
||||||
for i in self.temps.keys():
|
wx.CallAfter(self.btemp.SetValue,l)
|
||||||
l=l.replace(i,self.temps[i])
|
self.set("last_bed_temperature",str(f))
|
||||||
f=float(l)
|
wx.CallAfter(self.setboff.SetBackgroundColour,"")
|
||||||
if f>=0:
|
wx.CallAfter(self.setboff.SetForegroundColour,"")
|
||||||
if self.p.online:
|
wx.CallAfter(self.setbbtn.SetBackgroundColour,"#FFAA66")
|
||||||
self.p.send_now("M104 S"+l)
|
wx.CallAfter(self.setbbtn.SetForegroundColour,"#660000")
|
||||||
print _("Setting hotend temperature to %f degrees Celsius.") % f
|
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.hsetpoint=f
|
||||||
#self.hottgauge.SetTarget(int(f))
|
#self.hottgauge.SetTarget(int(f))
|
||||||
wx.CallAfter(self.graph.SetExtruder0TargetTemperature,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.settbtn.SetForegroundColour,"")
|
||||||
wx.CallAfter(self.htemp.SetBackgroundColour,"white")
|
wx.CallAfter(self.htemp.SetBackgroundColour,"white")
|
||||||
wx.CallAfter(self.htemp.Refresh)
|
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:
|
else:
|
||||||
print _("Printer is not online.")
|
print _("Printer is not online.")
|
||||||
else:
|
else:
|
||||||
|
@ -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):
|
||||||
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:
|
||||||
|
|
Loading…
Reference in New Issue