mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 16:55:58 +08:00
Added more logging
This commit is contained in:
parent
53a9f5f622
commit
097d4c9e6b
@ -388,6 +388,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
|
||||
## Handler for all requests that have finished.
|
||||
def _onFinished(self, reply):
|
||||
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)
|
||||
if reply.operation() == QNetworkAccessManager.GetOperation:
|
||||
if "printer" in reply.url().toString(): # Status update from printer.
|
||||
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200:
|
||||
@ -397,6 +398,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
|
||||
self._spliceJSONData()
|
||||
else:
|
||||
Logger.log("w", "We got an unexpected status (%s) while requesting printer state", status_code)
|
||||
pass # TODO: Handle errors
|
||||
elif "print_job" in reply.url().toString(): # Status update from print_job:
|
||||
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200:
|
||||
@ -416,6 +418,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
self.setTimeElapsed(0)
|
||||
self.setTimeTotal(0)
|
||||
self.setJobName("")
|
||||
else:
|
||||
Logger.log("w", "We got an unexpected status (%s) while requesting print job state", status_code)
|
||||
elif "snapshot" in reply.url().toString(): # Status update from image:
|
||||
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200:
|
||||
self._camera_image.loadFromData(reply.readAll())
|
||||
|
Loading…
x
Reference in New Issue
Block a user