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.

master
daid303 2012-10-01 14:51:59 +02:00
parent 718b685a72
commit 0a1cb67461
3 changed files with 21 additions and 8 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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()