mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
CURA-5170 When the connection status of a printer output device changes, only add it to the list if the device belongs to the current printer.
This commit is contained in:
parent
79daf3706b
commit
37520b26b8
1 changed files with 6 additions and 1 deletions
|
@ -107,6 +107,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
Logger.log("d", "Attempting to connect with [%s]" % key)
|
Logger.log("d", "Attempting to connect with [%s]" % key)
|
||||||
self._discovered_devices[key].connect()
|
self._discovered_devices[key].connect()
|
||||||
self._discovered_devices[key].connectionStateChanged.connect(self._onDeviceConnectionStateChanged)
|
self._discovered_devices[key].connectionStateChanged.connect(self._onDeviceConnectionStateChanged)
|
||||||
|
else:
|
||||||
|
self._onDeviceConnectionStateChanged(key)
|
||||||
else:
|
else:
|
||||||
if self._discovered_devices[key].isConnected():
|
if self._discovered_devices[key].isConnected():
|
||||||
Logger.log("d", "Attempting to close connection with [%s]" % key)
|
Logger.log("d", "Attempting to close connection with [%s]" % key)
|
||||||
|
@ -117,6 +119,9 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
if key not in self._discovered_devices:
|
if key not in self._discovered_devices:
|
||||||
return
|
return
|
||||||
if self._discovered_devices[key].isConnected():
|
if self._discovered_devices[key].isConnected():
|
||||||
|
# Sometimes the status changes after changing the global container and maybe the device doesn't belong to this machine
|
||||||
|
um_network_key = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("um_network_key")
|
||||||
|
if key == um_network_key:
|
||||||
self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key])
|
self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key])
|
||||||
else:
|
else:
|
||||||
self.getOutputDeviceManager().removeOutputDevice(key)
|
self.getOutputDeviceManager().removeOutputDevice(key)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue