mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Rename output device to prevent inheritance naming confusion
This commit is contained in:
parent
baa7b485ef
commit
1fa5628cb2
6 changed files with 14 additions and 13 deletions
|
@ -75,7 +75,7 @@ class DiscoveredPrinter(QObject):
|
|||
def readableMachineType(self) -> str:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
machine_manager = CuraApplication.getInstance().getMachineManager()
|
||||
# In NetworkOutputDevice, when it updates a printer information, it updates the machine type using the field
|
||||
# In LocalClusterOutputDevice, when it updates a printer information, it updates the machine type using the field
|
||||
# "machine_variant", and for some reason, it's not the machine type ID/codename/... but a human-readable string
|
||||
# like "Ultimaker 3". The code below handles this case.
|
||||
if self._hasHumanReadableMachineTypeName(self._machine_type):
|
||||
|
|
1
plugins/ThingiBrowser
Symbolic link
1
plugins/ThingiBrowser
Symbolic link
|
@ -0,0 +1 @@
|
|||
/home/cterbeke/Code/ChrisTerBeke/ThingiBrowser
|
|
@ -23,7 +23,7 @@ from ..UltimakerNetworkedPrinterOutputDevice import UltimakerNetworkedPrinterOut
|
|||
I18N_CATALOG = i18nCatalog("cura")
|
||||
|
||||
|
||||
class NetworkOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
||||
class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
||||
|
||||
activeCameraUrlChanged = pyqtSignal()
|
||||
|
|
@ -12,7 +12,7 @@ from cura.Settings.GlobalStack import GlobalStack
|
|||
|
||||
from .ZeroConfClient import ZeroConfClient
|
||||
from .ClusterApiClient import ClusterApiClient
|
||||
from .NetworkOutputDevice import NetworkOutputDevice
|
||||
from .LocalClusterOutputDevice import LocalClusterOutputDevice
|
||||
from ..CloudFlowMessage import CloudFlowMessage
|
||||
from ..Models.Http.PrinterSystemStatus import PrinterSystemStatus
|
||||
|
||||
|
@ -20,8 +20,8 @@ from ..Models.Http.PrinterSystemStatus import PrinterSystemStatus
|
|||
I18N_CATALOG = i18nCatalog("cura")
|
||||
|
||||
|
||||
## The NetworkOutputDeviceManager is responsible for discovering and managing local networked clusters.
|
||||
class NetworkOutputDeviceManager:
|
||||
## The LocalClusterOutputDeviceManager is responsible for discovering and managing local networked clusters.
|
||||
class LocalClusterOutputDeviceManager:
|
||||
|
||||
META_NETWORK_KEY = "um_network_key"
|
||||
|
||||
|
@ -37,7 +37,7 @@ class NetworkOutputDeviceManager:
|
|||
def __init__(self) -> None:
|
||||
|
||||
# Persistent dict containing the networked clusters.
|
||||
self._discovered_devices = {} # type: Dict[str, NetworkOutputDevice]
|
||||
self._discovered_devices = {} # type: Dict[str, LocalClusterOutputDevice]
|
||||
self._output_device_manager = CuraApplication.getInstance().getOutputDeviceManager()
|
||||
|
||||
# Hook up ZeroConf client.
|
||||
|
@ -152,7 +152,7 @@ class NetworkOutputDeviceManager:
|
|||
if cluster_size == -1:
|
||||
return
|
||||
|
||||
device = NetworkOutputDevice(key, address, properties)
|
||||
device = LocalClusterOutputDevice(key, address, properties)
|
||||
CuraApplication.getInstance().getDiscoveredPrintersModel().addDiscoveredPrinter(
|
||||
ip_address=address,
|
||||
key=device.getId(),
|
||||
|
@ -167,7 +167,7 @@ class NetworkOutputDeviceManager:
|
|||
|
||||
## Remove a device.
|
||||
def _onDiscoveredDeviceRemoved(self, device_id: str) -> None:
|
||||
device = self._discovered_devices.pop(device_id, None) # type: Optional[NetworkOutputDevice]
|
||||
device = self._discovered_devices.pop(device_id, None) # type: Optional[LocalClusterOutputDevice]
|
||||
if not device:
|
||||
return
|
||||
device.close()
|
|
@ -13,7 +13,7 @@ from .Models.ClusterMaterial import ClusterMaterial
|
|||
from .Models.LocalMaterial import LocalMaterial
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .Network.NetworkOutputDevice import NetworkOutputDevice
|
||||
from .Network.LocalClusterOutputDevice import LocalClusterOutputDevice
|
||||
|
||||
|
||||
## Asynchronous job to send material profiles to the printer.
|
||||
|
@ -21,9 +21,9 @@ if TYPE_CHECKING:
|
|||
# This way it won't freeze up the interface while sending those materials.
|
||||
class SendMaterialJob(Job):
|
||||
|
||||
def __init__(self, device: "NetworkOutputDevice") -> None:
|
||||
def __init__(self, device: "LocalClusterOutputDevice") -> None:
|
||||
super().__init__()
|
||||
self.device = device # type: NetworkOutputDevice
|
||||
self.device = device # type: LocalClusterOutputDevice
|
||||
|
||||
## Send the request to the printer and register a callback
|
||||
def run(self) -> None:
|
||||
|
|
|
@ -7,7 +7,7 @@ from cura.CuraApplication import CuraApplication
|
|||
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||
|
||||
from .Network.NetworkOutputDeviceManager import NetworkOutputDeviceManager
|
||||
from .Network.LocalClusterOutputDeviceManager import LocalClusterOutputDeviceManager
|
||||
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||
super().__init__()
|
||||
|
||||
# Create a network output device manager that abstracts all network connection logic away.
|
||||
self._network_output_device_manager = NetworkOutputDeviceManager()
|
||||
self._network_output_device_manager = LocalClusterOutputDeviceManager()
|
||||
|
||||
# Create a cloud output device manager that abstracts all cloud connection logic away.
|
||||
self._cloud_output_device_manager = CloudOutputDeviceManager()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue