mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Set group_name correct with cloud devices, possibly fixes CS-225
This commit is contained in:
parent
2a9be0cdfe
commit
33876e9ca9
1 changed files with 6 additions and 4 deletions
|
@ -161,15 +161,17 @@ class CloudOutputDeviceManager:
|
||||||
self._connectToOutputDevice(device, active_machine)
|
self._connectToOutputDevice(device, active_machine)
|
||||||
elif local_network_key and device.matchesNetworkKey(local_network_key):
|
elif local_network_key and device.matchesNetworkKey(local_network_key):
|
||||||
# Connect to it if we can match the local network key that was already present.
|
# Connect to it if we can match the local network key that was already present.
|
||||||
active_machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key)
|
|
||||||
self._connectToOutputDevice(device, active_machine)
|
self._connectToOutputDevice(device, active_machine)
|
||||||
elif device.key in output_device_manager.getOutputDeviceIds():
|
elif device.key in output_device_manager.getOutputDeviceIds():
|
||||||
# Remove device if it is not meant for the active machine.
|
# Remove device if it is not meant for the active machine.
|
||||||
output_device_manager.removeOutputDevice(device.key)
|
output_device_manager.removeOutputDevice(device.key)
|
||||||
|
|
||||||
## Connects to an output device and makes sure it is registered in the output device manager.
|
## Connects to an output device and makes sure it is registered in the output device manager.
|
||||||
@staticmethod
|
def _connectToOutputDevice(self, device: CloudOutputDevice, machine: GlobalStack) -> None:
|
||||||
def _connectToOutputDevice(device: CloudOutputDevice, active_machine: GlobalStack) -> None:
|
machine.setName(device.name)
|
||||||
|
machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key)
|
||||||
|
machine.setMetaDataEntry("group_name", device.name)
|
||||||
|
|
||||||
device.connect()
|
device.connect()
|
||||||
active_machine.addConfiguredConnectionType(device.connectionType.value)
|
machine.addConfiguredConnectionType(device.connectionType.value)
|
||||||
CuraApplication.getInstance().getOutputDeviceManager().addOutputDevice(device)
|
CuraApplication.getInstance().getOutputDeviceManager().addOutputDevice(device)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue