mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:09:01 +08:00
USB printer connection is now reset when print is completed
CURA-1822
This commit is contained in:
parent
33313ddb70
commit
8eef34ac45
@ -502,6 +502,13 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
# It will be normalized (based on max_progress) to range 0 - 100
|
# It will be normalized (based on max_progress) to range 0 - 100
|
||||||
def setProgress(self, progress, max_progress = 100):
|
def setProgress(self, progress, max_progress = 100):
|
||||||
self._progress = (progress / max_progress) * 100 # Convert to scale of 0-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()
|
self.progressChanged.emit()
|
||||||
|
|
||||||
## Cancel the current print. Printer connection wil continue to listen.
|
## Cancel the current print. Printer connection wil continue to listen.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user