From 2079a992780851d0ea7dd02b776c30d090f63ecf Mon Sep 17 00:00:00 2001 From: Christopher Keller Date: Mon, 28 Nov 2011 07:44:29 -0800 Subject: [PATCH] Added Estimated time left, and total time, for non-SD Printing. They get more and more accurate until the end. --- pronterface.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pronterface.py b/pronterface.py index fcff0dd..ef30bb6 100755 --- a/pronterface.py +++ b/pronterface.py @@ -1088,7 +1088,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole): if self.sdprinting: string+= _(" SD printing:%04.2f %%") % (self.percentdone,) if self.p.printing: + secondselapsed = int(time.time()-self.starttime) + fractioncomplete = float(self.p.queueindex)/len(self.p.mainqueue) + secondsestimate = secondselapsed/fractioncomplete + secondsremain = secondsestimate - secondselapsed string+= _(" Printing:%04.2f %%") % (100*float(self.p.queueindex)/len(self.p.mainqueue),) + string+= _(" Estimated:%02.0f") % (int(secondsremain/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.gviz.Refresh) if(self.monitor and self.p.online):