mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Clean up formatting of documentation
Boyscouting! CURA-8463
This commit is contained in:
parent
d842013a76
commit
0516b27f2b
1 changed files with 8 additions and 7 deletions
|
@ -50,13 +50,12 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
The assumption is made the printer is a FDM printer.
|
The assumption is made the printer is a FDM printer.
|
||||||
|
|
||||||
Note that a number of settings are marked as "final". This is because decorators
|
Note that a number of settings are marked as "final". This is because decorators
|
||||||
are not inherited by children. To fix this we use the private counter part of those
|
are not inherited by children. To fix this we use the private counterpart of those
|
||||||
functions to actually have the implementation.
|
functions to actually have the implementation.
|
||||||
|
|
||||||
For all other uses it should be used in the same way as a "regular" OutputDevice.
|
For all other uses it should be used in the same way as a "regular" OutputDevice.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
printersChanged = pyqtSignal()
|
printersChanged = pyqtSignal()
|
||||||
connectionStateChanged = pyqtSignal(str)
|
connectionStateChanged = pyqtSignal(str)
|
||||||
acceptsCommandsChanged = pyqtSignal()
|
acceptsCommandsChanged = pyqtSignal()
|
||||||
|
@ -183,8 +182,8 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
@pyqtProperty(QObject, constant = True)
|
@pyqtProperty(QObject, constant = True)
|
||||||
def monitorItem(self) -> QObject:
|
def monitorItem(self) -> QObject:
|
||||||
# Note that we specifically only check if the monitor component is created.
|
# Note that we specifically only check if the monitor component is created.
|
||||||
# It could be that it failed to actually create the qml item! If we check if the item was created, it will try to
|
# It could be that it failed to actually create the qml item! If we check if the item was created, it will try
|
||||||
# create the item (and fail) every time.
|
# to create the item (and fail) every time.
|
||||||
if not self._monitor_component:
|
if not self._monitor_component:
|
||||||
self._createMonitorViewFromQML()
|
self._createMonitorViewFromQML()
|
||||||
return self._monitor_item
|
return self._monitor_item
|
||||||
|
@ -237,9 +236,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
|
|
||||||
self.acceptsCommandsChanged.emit()
|
self.acceptsCommandsChanged.emit()
|
||||||
|
|
||||||
# Returns the unique configurations of the printers within this output device
|
|
||||||
@pyqtProperty("QVariantList", notify = uniqueConfigurationsChanged)
|
@pyqtProperty("QVariantList", notify = uniqueConfigurationsChanged)
|
||||||
def uniqueConfigurations(self) -> List["PrinterConfigurationModel"]:
|
def uniqueConfigurations(self) -> List["PrinterConfigurationModel"]:
|
||||||
|
""" Returns the unique configurations of the printers within this output device """
|
||||||
return self._unique_configurations
|
return self._unique_configurations
|
||||||
|
|
||||||
def _updateUniqueConfigurations(self) -> None:
|
def _updateUniqueConfigurations(self) -> None:
|
||||||
|
@ -248,7 +247,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
if printer.printerConfiguration is not None and printer.printerConfiguration.hasAnyMaterialLoaded():
|
if printer.printerConfiguration is not None and printer.printerConfiguration.hasAnyMaterialLoaded():
|
||||||
all_configurations.add(printer.printerConfiguration)
|
all_configurations.add(printer.printerConfiguration)
|
||||||
all_configurations.update(printer.availableConfigurations)
|
all_configurations.update(printer.availableConfigurations)
|
||||||
if None in all_configurations: # Shouldn't happen, but it does. I don't see how it could ever happen. Skip adding that configuration. List could end up empty!
|
if None in all_configurations:
|
||||||
|
# Shouldn't happen, but it does. I don't see how it could ever happen. Skip adding that configuration.
|
||||||
|
# List could end up empty!
|
||||||
Logger.log("e", "Found a broken configuration in the synced list!")
|
Logger.log("e", "Found a broken configuration in the synced list!")
|
||||||
all_configurations.remove(None)
|
all_configurations.remove(None)
|
||||||
new_configurations = sorted(all_configurations, key = lambda config: config.printerType or "")
|
new_configurations = sorted(all_configurations, key = lambda config: config.printerType or "")
|
||||||
|
@ -256,9 +257,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
self._unique_configurations = new_configurations
|
self._unique_configurations = new_configurations
|
||||||
self.uniqueConfigurationsChanged.emit()
|
self.uniqueConfigurationsChanged.emit()
|
||||||
|
|
||||||
# Returns the unique configurations of the printers within this output device
|
|
||||||
@pyqtProperty("QStringList", notify = uniqueConfigurationsChanged)
|
@pyqtProperty("QStringList", notify = uniqueConfigurationsChanged)
|
||||||
def uniquePrinterTypes(self) -> List[str]:
|
def uniquePrinterTypes(self) -> List[str]:
|
||||||
|
""" Returns the unique configurations of the printers within this output device """
|
||||||
return list(sorted(set([configuration.printerType or "" for configuration in self._unique_configurations])))
|
return list(sorted(set([configuration.printerType or "" for configuration in self._unique_configurations])))
|
||||||
|
|
||||||
def _onPrintersChanged(self) -> None:
|
def _onPrintersChanged(self) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue