From: daid303 Date: Mon, 1 Oct 2012 12:51:59 +0000 (+0200) Subject: Add already elapsed printing and estimated remaining printing time. Fix the capture... X-Git-Tag: 13.03~309 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0a1cb67461e7df9c0b4bf96365db82ffe3ba05ea;p=cura.git Add already elapsed printing and estimated remaining printing time. Fix the capture format config for win32. Add some spacing between the X/Y and Z in the jog tab. --- diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index a9846f09..5a1ef338 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -181,15 +181,15 @@ class printWindow(wx.Frame): sizer.Add(PrintCommandButton(self, 'G1 X10 F6000', 'print-move-x10.png'), pos=(3,5)) sizer.Add(PrintCommandButton(self, 'G1 X100 F6000', 'print-move-x100.png'), pos=(3,6)) - sizer.Add(PrintCommandButton(self, 'G1 Z10 F200', 'print-move-z10.png'), pos=(0,7)) - sizer.Add(PrintCommandButton(self, 'G1 Z1 F200', 'print-move-z1.png'), pos=(1,7)) - sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'print-move-z0.1.png'), pos=(2,7)) + sizer.Add(PrintCommandButton(self, 'G1 Z10 F200', 'print-move-z10.png'), pos=(0,8)) + sizer.Add(PrintCommandButton(self, 'G1 Z1 F200', 'print-move-z1.png'), pos=(1,8)) + sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'print-move-z0.1.png'), pos=(2,8)) - sizer.Add(PrintCommandButton(self, 'G28 Z0', 'print-move-home.png'), pos=(3,7)) + sizer.Add(PrintCommandButton(self, 'G28 Z0', 'print-move-home.png'), pos=(3,8)) - sizer.Add(PrintCommandButton(self, 'G1 Z-0.1 F200', 'print-move-z-0.1.png'), pos=(4,7)) - sizer.Add(PrintCommandButton(self, 'G1 Z-1 F200', 'print-move-z-1.png'), pos=(5,7)) - sizer.Add(PrintCommandButton(self, 'G1 Z-10 F200', 'print-move-z-10.png'), pos=(6,7)) + sizer.Add(PrintCommandButton(self, 'G1 Z-0.1 F200', 'print-move-z-0.1.png'), pos=(4,8)) + sizer.Add(PrintCommandButton(self, 'G1 Z-1 F200', 'print-move-z-1.png'), pos=(5,8)) + sizer.Add(PrintCommandButton(self, 'G1 Z-10 F200', 'print-move-z-10.png'), pos=(6,8)) nb.AddPage(self.directControlPanel, 'Jog') @@ -346,8 +346,13 @@ class printWindow(wx.Frame): if self.gcodeList != None: status += 'Line: -/%d\n' % (len(self.gcodeList)) else: + printTime = self.machineCom.getPrintTime() / 60 + printTimeTotal = printTime * len(self.gcodeList) / self.machineCom.getPrintPos() + printTimeLeft = printTimeTotal - printTime status += 'Line: %d/%d\n' % (self.machineCom.getPrintPos(), len(self.gcodeList)) status += 'Height: %f\n' % (self.currentZ) + status += 'Print time: %02d:%02d\n' % (int(printTime / 60), int(printTime % 60)) + status += 'Print time left: %02d:%02d\n' % (int(printTimeLeft / 60), int(printTimeLeft % 60)) self.progress.SetValue(self.machineCom.getPrintPos()) if self.machineCom != None: if self.machineCom.getTemp() > 0: diff --git a/Cura/gui/webcam.py b/Cura/gui/webcam.py index cf5448aa..e511c180 100644 --- a/Cura/gui/webcam.py +++ b/Cura/gui/webcam.py @@ -63,7 +63,11 @@ class webcam(object): if pageType == 0: self._cam.displaycapturefilterproperties() else: - self._cam.displaycapturepinproperties() + del self._cam + self._cam = None + tmp = win32vidcap.new_Dev(0, False) + tmp.displaycapturepinproperties() + self._cam = tmp def takeNewImage(self): if self._cam == None: diff --git a/Cura/util/machineCom.py b/Cura/util/machineCom.py index b77ce98b..06567d3c 100644 --- a/Cura/util/machineCom.py +++ b/Cura/util/machineCom.py @@ -239,6 +239,9 @@ class MachineCom(object): def getPrintPos(self): return self._gcodePos + def getPrintTime(self): + return time.time() - self._printStartTime + def isPaused(self): return self._state == self.STATE_PAUSED @@ -433,6 +436,7 @@ class MachineCom(object): self._gcodePos = 0 self._printSection = 'CUSTOM' self._changeState(self.STATE_PRINTING) + self._printStartTime = time.time() for i in xrange(0, 6): self._sendNext()