mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
No longer start print if it's already started
CL-541
This commit is contained in:
parent
aef54f99db
commit
e2845a224c
1 changed files with 6 additions and 2 deletions
|
@ -69,6 +69,11 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
# is ignored.
|
# is ignored.
|
||||||
# \param kwargs Keyword arguments.
|
# \param kwargs Keyword arguments.
|
||||||
def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None, **kwargs):
|
def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None, **kwargs):
|
||||||
|
if self._is_printing:
|
||||||
|
return # Aleady printing
|
||||||
|
|
||||||
|
Application.getInstance().showPrintMonitor.emit(True)
|
||||||
|
|
||||||
gcode_list = getattr(Application.getInstance().getController().getScene(), "gcode_list")
|
gcode_list = getattr(Application.getInstance().getController().getScene(), "gcode_list")
|
||||||
self._printGCode(gcode_list)
|
self._printGCode(gcode_list)
|
||||||
|
|
||||||
|
@ -93,7 +98,6 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
self.writeFinished.emit(self)
|
self.writeFinished.emit(self)
|
||||||
|
|
||||||
|
|
||||||
def _autoDetectFinished(self, job):
|
def _autoDetectFinished(self, job):
|
||||||
result = job.getResult()
|
result = job.getResult()
|
||||||
if result is not None:
|
if result is not None:
|
||||||
|
@ -210,7 +214,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
elapsed_time = int(time() - self._print_start_time)
|
elapsed_time = int(time() - self._print_start_time)
|
||||||
print_job = self._printers[0].activePrintJob
|
print_job = self._printers[0].activePrintJob
|
||||||
if print_job is None:
|
if print_job is None:
|
||||||
print_job = PrintJobOutputModel(output_controller = None)
|
print_job = PrintJobOutputModel(output_controller = None, name= Application.getInstance().getPrintInformation().jobName)
|
||||||
self._printers[0].updateActivePrintJob(print_job)
|
self._printers[0].updateActivePrintJob(print_job)
|
||||||
|
|
||||||
print_job.updateTimeElapsed(elapsed_time)
|
print_job.updateTimeElapsed(elapsed_time)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue