diff --git a/src/MPSM2NetworkedPrinterOutputDevice.py b/src/MPSM2NetworkedPrinterOutputDevice.py index d74f666..0d9495b 100644 --- a/src/MPSM2NetworkedPrinterOutputDevice.py +++ b/src/MPSM2NetworkedPrinterOutputDevice.py @@ -90,7 +90,7 @@ def __init__(self, device_id: str, address: str, parent=None) -> None: connection_type=ConnectionType.NetworkConnection, parent=parent) self._printer_output_controller = MPSM2OutputController(self) - self._is_busy = False + self._is_uploading = False self._requested_start_print = False self._requested_pause_print = False self._requested_cancel_print = False @@ -152,7 +152,7 @@ def isUploading(self) -> bool: Returns: true if user is uploading a model to the printer. """ - return self._is_busy + return self._is_uploading @pyqtProperty(bool, notify=startPrintRequestChanged) def has_start_print_request_in_progress(self) -> bool: @@ -353,12 +353,12 @@ def update_printer_status(self, response: str) -> None: self._on_printer_status_changed(response) self.printerStatusChanged.emit() - def is_busy(self) -> bool: + def is_uploading(self) -> bool: """ Returns: true if the printer is uploading a job. """ - return self._is_busy + return self._is_uploading def _on_print_job_created(self, job: GCodeWriteFileJob) -> None: """Called when a print job starts to upload. @@ -370,7 +370,7 @@ def _on_print_job_created(self, job: GCodeWriteFileJob) -> None: Logger.log('e', 'No active exported job to upload!') return self.onPrinterUpload.emit(True) - self._is_busy = True + self._is_uploading = True self._job_upload_message.show() self._api_client.upload_print(job.getFileName(), job.get_gcode_output(), self._on_print_job_upload_completed, @@ -379,7 +379,7 @@ def _on_print_job_created(self, job: GCodeWriteFileJob) -> None: def _on_print_upload_cancelled(self) -> None: """Called when the user cancels the print upload.""" - self._is_busy = False + self._is_uploading = False self._job_upload_message.hide() self._api_client.cancel_upload_print() self._api_client.cancel_print() # force cancel @@ -389,8 +389,8 @@ def _on_print_upload_cancelled(self) -> None: def _on_print_job_upload_error(self) -> None: """Called if there was an error uploading the model.""" - if self._is_busy: - self._is_busy = False + if self._is_uploading: + self._is_uploading = False self._job_upload_message.hide() self._api_client.cancel_upload_print() self._api_client.cancel_print() # force cancel @@ -405,7 +405,7 @@ def _on_print_job_upload_completed(self, response: str) -> None: response: HTTP body response from upload request. """ if response.upper() == 'OK': - self._is_busy = False + self._is_uploading = False self._job_upload_message.hide() PrintJobUploadSuccessMessage().show() self._api_client.start_print() # force start diff --git a/src/network/DeviceManager.py b/src/network/DeviceManager.py index e360045..84626ca 100644 --- a/src/network/DeviceManager.py +++ b/src/network/DeviceManager.py @@ -307,7 +307,7 @@ def _on_printer_heartbeat(self, address: str, response: str) -> None: MPSM2NetworkedPrinterOutputDevice, self._discovered_devices.get(DeviceManager._get_device_id(address))) if response == 'timeout': - if device and device.isConnected() and not device.is_busy() and \ + if device and device.isConnected() and not device.is_uploading() and \ not self._add_manual_device_in_progress: # Request timeout is expected during job upload. Logger.log('d', 'Discovered device timed out. Stopping device.')