USB printer connection is now reset when print is completed

CURA-1822
This commit is contained in:
Jaime van Kessel 2016-07-21 10:30:22 +02:00
parent 33313ddb70
commit 8eef34ac45

View file

@ -502,6 +502,13 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
# It will be normalized (based on max_progress) to range 0 - 100
def setProgress(self, progress, max_progress = 100):
self._progress = (progress / max_progress) * 100 # Convert to scale of 0-100
if self._progress == 100:
# Printing is done, reset progress
self._gcode_position = 0
self.setProgress(0)
self._is_printing = False
self._is_paused = False
self._updateJobState("ready")
self.progressChanged.emit()
## Cancel the current print. Printer connection wil continue to listen.