mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
NetworkManager is now created on demand and re-created after a certain timeout.
CL-541
This commit is contained in:
parent
b1649f2d38
commit
a8e71cf50c
4 changed files with 57 additions and 9 deletions
|
@ -19,7 +19,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
self._print_jobs = []
|
||||
|
||||
def _update(self):
|
||||
super()._update()
|
||||
if not super()._update():
|
||||
return
|
||||
self._get("printers/", onFinished=self._onGetPrintersDataFinished)
|
||||
self._get("print_jobs/", onFinished=self._onGetPrintJobsFinished)
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
self._number_of_extruders = 2
|
||||
|
||||
def _update(self):
|
||||
super()._update()
|
||||
if not super()._update():
|
||||
return
|
||||
self._get("printer", onFinished=self._onGetPrinterDataFinished)
|
||||
self._get("print_job", onFinished=self._onGetPrintJobFinished)
|
||||
|
||||
|
|
|
@ -80,7 +80,13 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
self._discovered_devices[key].connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
|
||||
|
||||
def _onDeviceConnectionStateChanged(self, key):
|
||||
pass # TODO
|
||||
if key not in self._discovered_devices:
|
||||
return
|
||||
|
||||
if self._discovered_devices[key].isConnected():
|
||||
self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key])
|
||||
else:
|
||||
self.getOutputDeviceManager().removeOutputDevice(key)
|
||||
|
||||
def stop(self):
|
||||
if self._zero_conf is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue