def SetProgress(self, stepName, layer, maxLayer): if self.prevStep != stepName: self.totalDoneFactor += sliceRun.sliceStepTimeFactor[self.prevStep] newTime = time.time() #print "#####" + str(newTime-self.startTime) + " " + self.prevStep + " -> " + stepName self.startTime = newTime self.prevStep = stepName progresValue = ((self.totalDoneFactor + sliceRun.sliceStepTimeFactor[stepName] * layer / maxLayer) / sliceRun.totalRunTimeFactor) * 10000 self.progressGauge.SetValue(int(progresValue)) taskbar.setProgress(self.GetParent(), int(progresValue), self.progressGauge.GetRange()) self.statusText.SetLabel("Preparing: processing %s [%d/%d]" % (stepName, layer, maxLayer))
def SetProgress(self, stepName, layer, maxLayer): if self.prevStep != stepName: self.totalDoneFactor += sliceRun.sliceStepTimeFactor[self.prevStep] newTime = time.time() #print "#####" + str(newTime-self.startTime) + " " + self.prevStep + " -> " + stepName self.startTime = newTime self.prevStep = stepName progresValue = ((self.totalDoneFactor + sliceRun.sliceStepTimeFactor[stepName] * layer / maxLayer) / sliceRun.totalRunTimeFactor) * 10000 self.progressGauge.SetValue(int(progresValue)) self.statusText.SetLabel(stepName + " [" + str(layer) + "/" + str(maxLayer) + "]") taskbar.setProgress(self, 10000 * self.progressGauge2.GetValue() + int(progresValue), 10000 * len(self.actionList))
def SetProgress(self, stepName, layer, maxLayer): if self.prevStep != stepName: self.totalDoneFactor += sliceRun.sliceStepTimeFactor[self.prevStep] newTime = time.time() #print "#####" + str(newTime-self.startTime) + " " + self.prevStep + " -> " + stepName self.startTime = newTime self.prevStep = stepName progresValue = ( (self.totalDoneFactor + sliceRun.sliceStepTimeFactor[stepName] * layer / maxLayer) / sliceRun.totalRunTimeFactor) * 10000 self.progressGauge.SetValue(int(progresValue)) taskbar.setProgress(self.GetParent(), int(progresValue), self.progressGauge.GetRange()) self.statusText.SetLabel("Preparing: processing %s [%d/%d]" % (stepName, layer, maxLayer))
def UpdateProgress(self): status = "" if self.gcode == None: status += "Loading gcode...\n" else: status += "Filament: %.2fm %.2fg\n" % ( self.gcode.extrusionAmount / 1000, self.gcode.calculateWeight() * 1000) cost = self.gcode.calculateCost() if cost != False: status += "Filament cost: %s\n" % (cost) status += "Estimated print time: %02d:%02d\n" % (int( self.gcode.totalMoveTimeMinute / 60), int(self.gcode.totalMoveTimeMinute % 60)) if self.machineCom == None or not self.machineCom.isPrinting(): self.progress.SetValue(0) if self.gcodeList != None: status += 'Line: -/%d\n' % (len(self.gcodeList)) else: printTime = self.machineCom.getPrintTime() / 60 printTimeLeft = self.machineCom.getPrintTimeRemainingEstimate() status += 'Line: %d/%d %d%%\n' % ( self.machineCom.getPrintPos(), len(self.gcodeList), self.machineCom.getPrintPos() * 100 / len(self.gcodeList)) if self.currentZ > 0: status += 'Height: %0.1f\n' % (self.currentZ) status += 'Print time: %02d:%02d\n' % (int( printTime / 60), int(printTime % 60)) if printTimeLeft == None: status += 'Print time left: Unknown\n' else: status += 'Print time left: %02d:%02d\n' % (int( printTimeLeft / 60), int(printTimeLeft % 60)) self.progress.SetValue(self.machineCom.getPrintPos()) taskbar.setProgress(self, self.machineCom.getPrintPos(), len(self.gcodeList)) if self.machineCom != None: if self.machineCom.getTemp() > 0: status += 'Temp: %d\n' % (self.machineCom.getTemp()) if self.machineCom.getBedTemp() > 0: status += 'Bed Temp: %d\n' % (self.machineCom.getBedTemp()) self.bedTemperatureLabel.Show(True) self.bedTemperatureSelect.Show(True) self.temperaturePanel.Layout() status += 'Machine state:%s\n' % (self.machineCom.getStateString()) self.statsText.SetLabel(status.strip())
def UpdateProgress(self): status = "" if self.gcode == None: status += "Loading gcode...\n" else: status += "Filament: %.2fm %.2fg\n" % (self.gcode.extrusionAmount / 1000, self.gcode.calculateWeight() * 1000) cost = self.gcode.calculateCost() if cost != False: status += "Filament cost: %s\n" % (cost) status += "Estimated print time: %02d:%02d\n" % (int(self.gcode.totalMoveTimeMinute / 60), int(self.gcode.totalMoveTimeMinute % 60)) if self.machineCom == None or not self.machineCom.isPrinting(): self.progress.SetValue(0) if self.gcodeList != None: status += 'Line: -/%d\n' % (len(self.gcodeList)) else: printTime = self.machineCom.getPrintTime() / 60 printTimeLeft = self.machineCom.getPrintTimeRemainingEstimate() status += 'Line: %d/%d %d%%\n' % (self.machineCom.getPrintPos(), len(self.gcodeList), self.machineCom.getPrintPos() * 100 / len(self.gcodeList)) if self.currentZ > 0: status += 'Height: %0.1f\n' % (self.currentZ) status += 'Print time: %02d:%02d\n' % (int(printTime / 60), int(printTime % 60)) if printTimeLeft == None: status += 'Print time left: Unknown\n' else: status += 'Print time left: %02d:%02d\n' % (int(printTimeLeft / 60), int(printTimeLeft % 60)) self.progress.SetValue(self.machineCom.getPrintPos()) taskbar.setProgress(self, self.machineCom.getPrintPos(), len(self.gcodeList)) if self.machineCom != None: if self.machineCom.getTemp() > 0: status += 'Temp: %d\n' % (self.machineCom.getTemp()) if self.machineCom.getBedTemp() > 0: status += 'Bed Temp: %d\n' % (self.machineCom.getBedTemp()) self.bedTemperatureLabel.Show(True) self.bedTemperatureSelect.Show(True) self.temperaturePanel.Layout() status += 'Machine state:%s\n' % (self.machineCom.getStateString()) self.statsText.SetLabel(status.strip())