mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Fix setting connection state after re-connect, don't re-register output device
This commit is contained in:
parent
2ed3af5989
commit
445fb59c12
1 changed files with 9 additions and 1 deletions
|
@ -44,7 +44,8 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
|||
QUEUED_PRINT_JOBS_STATES = {"queued", "error"}
|
||||
|
||||
# Time in seconds since last network response after which we consider this device offline.
|
||||
NETWORK_RESPONSE_CONSIDER_OFFLINE = 10.0
|
||||
# We set this a bit higher than some of the other intervals to make sure they don't overlap.
|
||||
NETWORK_RESPONSE_CONSIDER_OFFLINE = 12.0
|
||||
|
||||
def __init__(self, device_id: str, address: str, properties: Dict[bytes, bytes], connection_type: ConnectionType,
|
||||
parent=None) -> None:
|
||||
|
@ -216,6 +217,13 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
|||
if not active_machine:
|
||||
return
|
||||
|
||||
# Indicate this device is now connected again.
|
||||
self.setConnectionState(ConnectionState.Connected)
|
||||
|
||||
# If the device was already registered we don't need to register it again.
|
||||
if self.key in CuraApplication.getInstance().getOutputDeviceManager().getOutputDeviceIds():
|
||||
return
|
||||
|
||||
# Try for local network device.
|
||||
stored_device_id = active_machine.getMetaDataEntry(self.META_NETWORK_KEY)
|
||||
if self.key == stored_device_id:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue