mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06:00
Rename Enum names to camal cases
CURA-6011
This commit is contained in:
parent
973970a895
commit
6bf39a32a9
6 changed files with 26 additions and 24 deletions
|
@ -55,7 +55,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
clusterPrintersChanged = pyqtSignal()
|
||||
|
||||
def __init__(self, device_id, address, properties, parent = None) -> None:
|
||||
super().__init__(device_id = device_id, address = address, properties=properties, connection_type = ConnectionType.clusterConnection, parent = parent)
|
||||
super().__init__(device_id = device_id, address = address, properties=properties, connection_type = ConnectionType.ClusterConnection, parent = parent)
|
||||
self._api_prefix = "/cluster-api/v1/"
|
||||
|
||||
self._number_of_extruders = 2
|
||||
|
|
|
@ -44,7 +44,7 @@ i18n_catalog = i18nCatalog("cura")
|
|||
# 5. As a final step, we verify the authentication, as this forces the QT manager to setup the authenticator.
|
||||
class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||
def __init__(self, device_id, address: str, properties, parent = None) -> None:
|
||||
super().__init__(device_id = device_id, address = address, properties = properties, connection_type = ConnectionType.networkConnection, parent = parent)
|
||||
super().__init__(device_id = device_id, address = address, properties = properties, connection_type = ConnectionType.NetworkConnection, parent = parent)
|
||||
self._api_prefix = "/api/v1/"
|
||||
self._number_of_extruders = 2
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ catalog = i18nCatalog("cura")
|
|||
|
||||
class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||
def __init__(self, serial_port: str, baud_rate: Optional[int] = None) -> None:
|
||||
super().__init__(serial_port, connection_type=ConnectionType.usbConnection)
|
||||
super().__init__(serial_port, connection_type=ConnectionType.UsbConnection)
|
||||
self.setName(catalog.i18nc("@item:inmenu", "USB printing"))
|
||||
self.setShortDescription(catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print via USB"))
|
||||
self.setDescription(catalog.i18nc("@info:tooltip", "Print via USB"))
|
||||
|
@ -179,7 +179,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
return
|
||||
CuraApplication.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerStackChanged)
|
||||
self._onGlobalContainerStackChanged()
|
||||
self.setConnectionState(ConnectionState.connected)
|
||||
self.setConnectionState(ConnectionState.Connected)
|
||||
self._update_thread.start()
|
||||
|
||||
def _onGlobalContainerStackChanged(self):
|
||||
|
@ -208,7 +208,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
self._sendCommand(command)
|
||||
|
||||
def _sendCommand(self, command: Union[str, bytes]):
|
||||
if self._serial is None or self._connection_state != ConnectionState.connected:
|
||||
if self._serial is None or self._connection_state != ConnectionState.Connected:
|
||||
return
|
||||
|
||||
new_command = cast(bytes, command) if type(command) is bytes else cast(str, command).encode() # type: bytes
|
||||
|
@ -222,7 +222,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
self._command_received.set()
|
||||
|
||||
def _update(self):
|
||||
while self._connection_state == ConnectionState.connected and self._serial is not None:
|
||||
while self._connection_state == ConnectionState.Connected and self._serial is not None:
|
||||
try:
|
||||
line = self._serial.readline()
|
||||
except:
|
||||
|
|
|
@ -66,7 +66,7 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin):
|
|||
return
|
||||
|
||||
changed_device = self._usb_output_devices[serial_port]
|
||||
if changed_device.connectionState == ConnectionState.connected:
|
||||
if changed_device.connectionState == ConnectionState.Connected:
|
||||
self.getOutputDeviceManager().addOutputDevice(changed_device)
|
||||
else:
|
||||
self.getOutputDeviceManager().removeOutputDevice(serial_port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue