mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Fix re-connecting after network comes back
This commit is contained in:
parent
945e5f08a3
commit
27905a02a9
3 changed files with 27 additions and 7 deletions
|
|
@ -40,8 +40,9 @@ I18N_CATALOG = i18nCatalog("cura")
|
|||
# Note that this device represents a single remote cluster, not a list of multiple clusters.
|
||||
class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
||||
|
||||
# The interval with which the remote clusters are checked
|
||||
CHECK_CLUSTER_INTERVAL = 10.0 # seconds
|
||||
# The interval with which the remote cluster is checked.
|
||||
# We can do this relatively often as this API call is quite fast.
|
||||
CHECK_CLUSTER_INTERVAL = 8.0 # seconds
|
||||
|
||||
# The minimum version of firmware that support print job actions over cloud.
|
||||
PRINT_JOB_ACTIONS_MIN_VERSION = Version("5.3.0")
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class CloudOutputDeviceManager:
|
|||
self._update_timer = QTimer()
|
||||
self._update_timer.setInterval(int(self.CHECK_CLUSTER_INTERVAL * 1000))
|
||||
self._update_timer.setSingleShot(False)
|
||||
self._update_timer.timeout.connect(self._getRemoteClusters)
|
||||
|
||||
# Ensure we don't start twice.
|
||||
self._running = False
|
||||
|
|
@ -57,7 +58,6 @@ class CloudOutputDeviceManager:
|
|||
if not self._update_timer.isActive():
|
||||
self._update_timer.start()
|
||||
self._getRemoteClusters()
|
||||
self._update_timer.timeout.connect(self._getRemoteClusters)
|
||||
|
||||
## Stops running the cloud output device manager.
|
||||
def stop(self):
|
||||
|
|
@ -67,7 +67,6 @@ class CloudOutputDeviceManager:
|
|||
if self._update_timer.isActive():
|
||||
self._update_timer.stop()
|
||||
self._onGetRemoteClustersFinished([]) # Make sure we remove all cloud output devices.
|
||||
self._update_timer.timeout.disconnect(self._getRemoteClusters)
|
||||
|
||||
## Force refreshing connections.
|
||||
def refreshConnections(self) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue