mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Connection states changes are now tied into the UI again
CL-541
This commit is contained in:
parent
9cfe9769d3
commit
0f78b05802
4 changed files with 19 additions and 13 deletions
|
@ -84,7 +84,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
def _onDeviceConnectionStateChanged(self, key):
|
||||
if key not in self._discovered_devices:
|
||||
return
|
||||
|
||||
print("STATE CHANGED", key)
|
||||
if self._discovered_devices[key].isConnected():
|
||||
self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key])
|
||||
else:
|
||||
|
@ -95,8 +95,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
Logger.log("d", "zeroconf close...")
|
||||
self._zero_conf.close()
|
||||
|
||||
def _onRemoveDevice(self, name):
|
||||
device = self._discovered_devices.pop(name, None)
|
||||
def _onRemoveDevice(self, device_id):
|
||||
device = self._discovered_devices.pop(device_id, None)
|
||||
if device:
|
||||
if device.isConnected():
|
||||
device.disconnect()
|
||||
|
@ -108,10 +108,12 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
# Check what kind of device we need to add; Depending on the firmware we either add a "Connect"/"Cluster"
|
||||
# or "Legacy" UM3 device.
|
||||
cluster_size = int(properties.get(b"cluster_size", -1))
|
||||
if cluster_size > 0:
|
||||
# TODO: For debug purposes; force it to be legacy printer.
|
||||
device = LegacyUM3OutputDevice.LegacyUM3OutputDevice(name, address, properties)
|
||||
'''if cluster_size > 0:
|
||||
device = ClusterUM3OutputDevice.ClusterUM3OutputDevice(name, address, properties)
|
||||
else:
|
||||
device = LegacyUM3OutputDevice.LegacyUM3OutputDevice(name, address, properties)
|
||||
device = LegacyUM3OutputDevice.LegacyUM3OutputDevice(name, address, properties)'''
|
||||
|
||||
self._discovered_devices[device.getId()] = device
|
||||
self.discoveredDevicesChanged.emit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue