mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-14 12:11:46 +08:00
Actually perform the filtering based on machine type
CURA-2475
This commit is contained in:
parent
84defb27cf
commit
ec63d6931e
@ -75,7 +75,10 @@ class DiscoverUM3Action(MachineAction):
|
||||
@pyqtProperty("QVariantList", notify = printersChanged)
|
||||
def foundDevices(self):
|
||||
if self._network_plugin:
|
||||
global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId()
|
||||
printers = list(self._network_plugin.getPrinters().values())
|
||||
# TODO; There are still some testing printers that don't have a correct printer type, so don't filter out unkown ones just yet.
|
||||
printers = [printer for printer in printers if printer.printerType == global_printer_type or printer.printerType == "unknown"]
|
||||
printers.sort(key = lambda k: k.name)
|
||||
return printers
|
||||
else:
|
||||
|
@ -168,9 +168,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
|
||||
printer_type = self._properties.get(b"machine", b"").decode("utf-8")
|
||||
if printer_type == "9511.0":
|
||||
self._updatePrinterType("UM3Extended")
|
||||
self._updatePrinterType("ultimaker3_extended")
|
||||
elif printer_type == "9066.0":
|
||||
self._updatePrinterType("UM3")
|
||||
self._updatePrinterType("ultimaker3")
|
||||
else:
|
||||
self._updatePrinterType("unknown")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user