mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Add legacy 'Connect over Network' button back
This commit is contained in:
parent
d703e48007
commit
e977cdd431
7 changed files with 131 additions and 140 deletions
|
@ -1,24 +1,30 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from typing import Optional, Callable
|
||||
from typing import Optional, Callable, Dict
|
||||
|
||||
from UM.Signal import Signal
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||
|
||||
from .Network.LocalClusterOutputDevice import LocalClusterOutputDevice
|
||||
from .Network.LocalClusterOutputDeviceManager import LocalClusterOutputDeviceManager
|
||||
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
||||
|
||||
|
||||
## This plugin handles the discovery and networking for Ultimaker 3D printers that support network and cloud printing.
|
||||
class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||
|
||||
# Signal emitted when the list of discovered devices changed. Used by printer action in this plugin.
|
||||
discoveredDevicesChanged = Signal()
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
# Create a network output device manager that abstracts all network connection logic away.
|
||||
self._network_output_device_manager = LocalClusterOutputDeviceManager()
|
||||
self._network_output_device_manager.discoveredDevicesChanged.connect(self.discoveredDevicesChanged)
|
||||
|
||||
# Create a cloud output device manager that abstracts all cloud connection logic away.
|
||||
self._cloud_output_device_manager = CloudOutputDeviceManager()
|
||||
|
@ -57,3 +63,11 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
## Remove a manually connected networked printer.
|
||||
def removeManualDevice(self, key: str, address: Optional[str] = None) -> None:
|
||||
self._network_output_device_manager.removeManualDevice(key, address)
|
||||
|
||||
## Get the discovered devices from the local network.
|
||||
def getDiscoveredDevices(self) -> Dict[str, LocalClusterOutputDevice]:
|
||||
return self._network_output_device_manager.getDiscoveredDevices()
|
||||
|
||||
## Connect the active machine to a device.
|
||||
def associateActiveMachineWithPrinterDevice(self, device: LocalClusterOutputDevice) -> None:
|
||||
self._network_output_device_manager.associateActiveMachineWithPrinterDevice(device)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue