Fix: Retrieve printer type during creating outputDevice

CURA-5053
This commit is contained in:
Aleksei S 2018-03-13 16:37:09 +01:00
parent e91b955f1e
commit e2cbfa8cec

View file

@ -55,6 +55,14 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
self._connection_state_before_timeout = None # type: Optional[ConnectionState]
printer_type = self._properties.get(b"machine", b"").decode("utf-8")
if printer_type.startswith("9511"):
self._printer_type = "ultimaker3_extended"
elif printer_type.startswith("9066"):
self._printer_type = "ultimaker3"
else:
self._printer_type = "unknown"
def requestWrite(self, nodes, file_name=None, filter_by_machine=False, file_handler=None, **kwargs) -> None:
raise NotImplementedError("requestWrite needs to be implemented")
@ -301,6 +309,10 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
def firmwareVersion(self) -> str:
return self._properties.get(b"firmware_version", b"").decode("utf-8")
@pyqtProperty(str, constant=True)
def printerType(self) -> str:
return self._printer_type
## IPadress of this printer
@pyqtProperty(str, constant=True)
def ipAddress(self) -> str: