Printer discovery shows if a cluster is actually set up as a host

CL-541
This commit is contained in:
Jaime van Kessel 2018-01-04 15:35:30 +01:00
parent f44c169b3e
commit d0ec7d10ce
2 changed files with 7 additions and 1 deletions

View File

@ -73,6 +73,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
self._finished_jobs = []
self._cluster_size = int(properties.get(b"cluster_size", 0))
def requestWrite(self, nodes, file_name=None, filter_by_machine=False, file_handler=None, **kwargs):
# Notify the UI that a switch to the print monitor should happen
Application.getInstance().getController().setActiveStage("MonitorStage")
@ -95,6 +97,10 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
if self._printer_selection_dialog is not None:
self._printer_selection_dialog.show()
@pyqtProperty(int, constant=True)
def clusterSize(self):
return self._cluster_size
@pyqtSlot()
@pyqtSlot(str)
def sendPrintJob(self, target_printer = ""):

View File

@ -240,7 +240,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
# or "Legacy" UM3 device.
cluster_size = int(properties.get(b"cluster_size", -1))
if cluster_size > 0:
if cluster_size >= 0:
device = ClusterUM3OutputDevice.ClusterUM3OutputDevice(name, address, properties)
else:
device = LegacyUM3OutputDevice.LegacyUM3OutputDevice(name, address, properties)