Commit a09633a2 authored by kliment's avatar kliment

Merge pull request #107 from cakeller98/Estimated_Time_Status

Improved status line estimated time remaining.
parents c62f5d5f 33610d53
...@@ -1085,18 +1085,25 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1085,18 +1085,25 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
# self.tgauge.SetValue(int(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1])) # self.tgauge.SetValue(int(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1]))
#except: #except:
# pass # pass
fractioncomplete = 0.0
if self.sdprinting: if self.sdprinting:
fractioncomplete = float(self.percentdone/100.0)
string+= _(" SD printing:%04.2f %%") % (self.percentdone,) string+= _(" SD printing:%04.2f %%") % (self.percentdone,)
if self.p.printing: if self.p.printing:
secondselapsed = int(time.time()-self.starttime)
fractioncomplete = float(self.p.queueindex)/len(self.p.mainqueue) fractioncomplete = float(self.p.queueindex)/len(self.p.mainqueue)
string+= _(" Printing:%04.2f %% |") % (100*float(self.p.queueindex)/len(self.p.mainqueue),)
string+= _(" Line# ") + str(self.p.queueindex) + _("of ") + str(len(self.p.mainqueue)) + _(" lines |" )
if fractioncomplete > 0.0:
secondselapsed = int(time.time()-self.starttime)
secondsestimate = secondselapsed/fractioncomplete secondsestimate = secondselapsed/fractioncomplete
secondsremain = secondsestimate - secondselapsed secondsremain = secondsestimate - secondselapsed
string+= _(" Printing:%04.2f %%") % (100*float(self.p.queueindex)/len(self.p.mainqueue),) string+= _(" Est: ") + time.strftime('%H:%M:%S', time.gmtime(secondsremain))
string+= _(" Estimated:%02.0f") % (int(secondsremain/60),) string+= _(" of: ") + time.strftime('%H:%M:%S', time.gmtime(secondsestimate))
string+= _(":%02.0f") % (int(secondsremain%60),) string+= _(" Remaining")
string+= _(" of %02.0f") % (int(secondsestimate/60),) #string+= _(" Est:%02.0f") % (int(secondsremain/60),)
string+= _(":%02.0f Remaining") % (int(secondsestimate%60),) #string+= _(":%02.0f") % (int(secondsremain%60),)
#string+= _(" of %02.0f") % (int(secondsestimate/60),)
#string+= _(":%02.0f Remaining") % (int(secondsestimate%60),)
wx.CallAfter(self.status.SetStatusText,string) wx.CallAfter(self.status.SetStatusText,string)
wx.CallAfter(self.gviz.Refresh) wx.CallAfter(self.gviz.Refresh)
if(self.monitor and self.p.online): if(self.monitor and self.p.online):
......
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