mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 08:47:50 -06:00
Check if the printer is ready to receive *before* doing work.
This has very little to do with CURA-1990
This commit is contained in:
parent
31861d82dc
commit
ef36c70d83
1 changed files with 10 additions and 9 deletions
|
@ -253,6 +253,16 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
self._camera_timer.stop()
|
self._camera_timer.stop()
|
||||||
|
|
||||||
def requestWrite(self, node, file_name = None, filter_by_machine = False):
|
def requestWrite(self, node, file_name = None, filter_by_machine = False):
|
||||||
|
if self._progress != 0:
|
||||||
|
self._error_message = Message(i18n_catalog.i18nc("@info:status", "Printer is still printing. Unable to start a new job."))
|
||||||
|
self._error_message.show()
|
||||||
|
return
|
||||||
|
elif self._authentication_state != AuthState.Authenticated:
|
||||||
|
self._not_authenticated_message = Message(i18n_catalog.i18nc("@info:status",
|
||||||
|
"Not authenticated to print with this machine. Unable to start a new job."))
|
||||||
|
self._not_authenticated_message.show()
|
||||||
|
return
|
||||||
|
|
||||||
Application.getInstance().showPrintMonitor.emit(True)
|
Application.getInstance().showPrintMonitor.emit(True)
|
||||||
self._print_finished = True
|
self._print_finished = True
|
||||||
self._gcode = getattr(Application.getInstance().getController().getScene(), "gcode_list")
|
self._gcode = getattr(Application.getInstance().getController().getScene(), "gcode_list")
|
||||||
|
@ -327,15 +337,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
# This function can fail to actually start a print due to not being authenticated or another print already
|
# This function can fail to actually start a print due to not being authenticated or another print already
|
||||||
# being in progress.
|
# being in progress.
|
||||||
def startPrint(self):
|
def startPrint(self):
|
||||||
if self._progress != 0:
|
|
||||||
self._error_message = Message(i18n_catalog.i18nc("@info:status", "Printer is still printing. Unable to start a new job."))
|
|
||||||
self._error_message.show()
|
|
||||||
return
|
|
||||||
elif self._authentication_state != AuthState.Authenticated:
|
|
||||||
self._not_authenticated_message = Message(i18n_catalog.i18nc("@info:status",
|
|
||||||
"Not authenticated to print with this machine. Unable to start a new job."))
|
|
||||||
self._not_authenticated_message.show()
|
|
||||||
return
|
|
||||||
try:
|
try:
|
||||||
self._progress_message = Message(i18n_catalog.i18nc("@info:status", "Sending data to printer"), 0, False, -1)
|
self._progress_message = Message(i18n_catalog.i18nc("@info:status", "Sending data to printer"), 0, False, -1)
|
||||||
self._progress_message.show()
|
self._progress_message.show()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue