mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Fix styling of comments
Because sentences should start with capitals
This commit is contained in:
parent
3ad1802ab6
commit
854755277c
1 changed files with 21 additions and 22 deletions
|
|
@ -74,7 +74,7 @@ class MachineManager(QObject):
|
||||||
self._application.globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
self._application.globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
||||||
self._container_registry.containerLoadComplete.connect(self._onContainersChanged)
|
self._container_registry.containerLoadComplete.connect(self._onContainersChanged)
|
||||||
|
|
||||||
## When the global container is changed, active material probably needs to be updated.
|
# When the global container is changed, active material probably needs to be updated.
|
||||||
self.globalContainerChanged.connect(self.activeMaterialChanged)
|
self.globalContainerChanged.connect(self.activeMaterialChanged)
|
||||||
self.globalContainerChanged.connect(self.activeVariantChanged)
|
self.globalContainerChanged.connect(self.activeVariantChanged)
|
||||||
self.globalContainerChanged.connect(self.activeQualityChanged)
|
self.globalContainerChanged.connect(self.activeQualityChanged)
|
||||||
|
|
@ -201,7 +201,7 @@ class MachineManager(QObject):
|
||||||
extruder_configuration.hotendID = extruder.variant.getName() if extruder.variant != empty_variant_container else None
|
extruder_configuration.hotendID = extruder.variant.getName() if extruder.variant != empty_variant_container else None
|
||||||
self._current_printer_configuration.extruderConfigurations.append(extruder_configuration)
|
self._current_printer_configuration.extruderConfigurations.append(extruder_configuration)
|
||||||
|
|
||||||
# an empty build plate configuration from the network printer is presented as an empty string, so use "" for an
|
# An empty build plate configuration from the network printer is presented as an empty string, so use "" for an
|
||||||
# empty build plate.
|
# empty build plate.
|
||||||
self._current_printer_configuration.buildplateConfiguration = self._global_container_stack.getProperty("machine_buildplate_type", "value") if self._global_container_stack.variant != empty_variant_container else ""
|
self._current_printer_configuration.buildplateConfiguration = self._global_container_stack.getProperty("machine_buildplate_type", "value") if self._global_container_stack.variant != empty_variant_container else ""
|
||||||
self.currentConfigurationChanged.emit()
|
self.currentConfigurationChanged.emit()
|
||||||
|
|
@ -247,7 +247,7 @@ class MachineManager(QObject):
|
||||||
self.updateNumberExtrudersEnabled()
|
self.updateNumberExtrudersEnabled()
|
||||||
self.globalContainerChanged.emit()
|
self.globalContainerChanged.emit()
|
||||||
|
|
||||||
# after switching the global stack we reconnect all the signals and set the variant and material references
|
# After switching the global stack we reconnect all the signals and set the variant and material references
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
self._application.getPreferences().setValue("cura/active_machine", self._global_container_stack.getId())
|
self._application.getPreferences().setValue("cura/active_machine", self._global_container_stack.getId())
|
||||||
|
|
||||||
|
|
@ -261,7 +261,7 @@ class MachineManager(QObject):
|
||||||
if global_variant.getMetaDataEntry("hardware_type") != "buildplate":
|
if global_variant.getMetaDataEntry("hardware_type") != "buildplate":
|
||||||
self._global_container_stack.setVariant(empty_variant_container)
|
self._global_container_stack.setVariant(empty_variant_container)
|
||||||
|
|
||||||
# set the global material to empty as we now use the extruder stack at all times - CURA-4482
|
# Set the global material to empty as we now use the extruder stack at all times - CURA-4482
|
||||||
global_material = self._global_container_stack.material
|
global_material = self._global_container_stack.material
|
||||||
if global_material != empty_material_container:
|
if global_material != empty_material_container:
|
||||||
self._global_container_stack.setMaterial(empty_material_container)
|
self._global_container_stack.setMaterial(empty_material_container)
|
||||||
|
|
@ -419,7 +419,7 @@ class MachineManager(QObject):
|
||||||
# Not a very pretty solution, but the extruder manager doesn't really know how many extruders there are
|
# Not a very pretty solution, but the extruder manager doesn't really know how many extruders there are
|
||||||
machine_extruder_count = self._global_container_stack.getProperty("machine_extruder_count", "value")
|
machine_extruder_count = self._global_container_stack.getProperty("machine_extruder_count", "value")
|
||||||
extruder_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
extruder_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
||||||
count = 1 # we start with the global stack
|
count = 1 # We start with the global stack
|
||||||
for stack in extruder_stacks:
|
for stack in extruder_stacks:
|
||||||
md = stack.getMetaData()
|
md = stack.getMetaData()
|
||||||
if "position" in md and int(md["position"]) >= machine_extruder_count:
|
if "position" in md and int(md["position"]) >= machine_extruder_count:
|
||||||
|
|
@ -646,7 +646,7 @@ class MachineManager(QObject):
|
||||||
new_value = self._active_container_stack.getProperty(key, "value")
|
new_value = self._active_container_stack.getProperty(key, "value")
|
||||||
extruder_stacks = [stack for stack in ExtruderManager.getInstance().getActiveExtruderStacks()]
|
extruder_stacks = [stack for stack in ExtruderManager.getInstance().getActiveExtruderStacks()]
|
||||||
|
|
||||||
# check in which stack the value has to be replaced
|
# Check in which stack the value has to be replaced
|
||||||
for extruder_stack in extruder_stacks:
|
for extruder_stack in extruder_stacks:
|
||||||
if extruder_stack != self._active_container_stack and extruder_stack.getProperty(key, "value") != new_value:
|
if extruder_stack != self._active_container_stack and extruder_stack.getProperty(key, "value") != new_value:
|
||||||
extruder_stack.userChanges.setProperty(key, "value", new_value) # TODO: nested property access, should be improved
|
extruder_stack.userChanges.setProperty(key, "value", new_value) # TODO: nested property access, should be improved
|
||||||
|
|
@ -662,7 +662,7 @@ class MachineManager(QObject):
|
||||||
for key in self._active_container_stack.userChanges.getAllKeys():
|
for key in self._active_container_stack.userChanges.getAllKeys():
|
||||||
new_value = self._active_container_stack.getProperty(key, "value")
|
new_value = self._active_container_stack.getProperty(key, "value")
|
||||||
|
|
||||||
# check if the value has to be replaced
|
# Check if the value has to be replaced
|
||||||
extruder_stack.userChanges.setProperty(key, "value", new_value)
|
extruder_stack.userChanges.setProperty(key, "value", new_value)
|
||||||
|
|
||||||
@pyqtProperty(str, notify = activeVariantChanged)
|
@pyqtProperty(str, notify = activeVariantChanged)
|
||||||
|
|
@ -731,7 +731,7 @@ class MachineManager(QObject):
|
||||||
# If the machine that is being removed is the currently active machine, set another machine as the active machine.
|
# If the machine that is being removed is the currently active machine, set another machine as the active machine.
|
||||||
activate_new_machine = (self._global_container_stack and self._global_container_stack.getId() == machine_id)
|
activate_new_machine = (self._global_container_stack and self._global_container_stack.getId() == machine_id)
|
||||||
|
|
||||||
# activate a new machine before removing a machine because this is safer
|
# Activate a new machine before removing a machine because this is safer
|
||||||
if activate_new_machine:
|
if activate_new_machine:
|
||||||
machine_stacks = CuraContainerRegistry.getInstance().findContainerStacksMetadata(type = "machine")
|
machine_stacks = CuraContainerRegistry.getInstance().findContainerStacksMetadata(type = "machine")
|
||||||
other_machine_stacks = [s for s in machine_stacks if s["id"] != machine_id]
|
other_machine_stacks = [s for s in machine_stacks if s["id"] != machine_id]
|
||||||
|
|
@ -997,12 +997,12 @@ class MachineManager(QObject):
|
||||||
if not enabled and position == ExtruderManager.getInstance().activeExtruderIndex:
|
if not enabled and position == ExtruderManager.getInstance().activeExtruderIndex:
|
||||||
ExtruderManager.getInstance().setActiveExtruderIndex(int(self._default_extruder_position))
|
ExtruderManager.getInstance().setActiveExtruderIndex(int(self._default_extruder_position))
|
||||||
|
|
||||||
# ensure that the quality profile is compatible with current combination, or choose a compatible one if available
|
# Ensure that the quality profile is compatible with current combination, or choose a compatible one if available
|
||||||
self._updateQualityWithMaterial()
|
self._updateQualityWithMaterial()
|
||||||
self.extruderChanged.emit()
|
self.extruderChanged.emit()
|
||||||
# update material compatibility color
|
# Update material compatibility color
|
||||||
self.activeQualityGroupChanged.emit()
|
self.activeQualityGroupChanged.emit()
|
||||||
# update items in SettingExtruder
|
# Update items in SettingExtruder
|
||||||
ExtruderManager.getInstance().extrudersChanged.emit(self._global_container_stack.getId())
|
ExtruderManager.getInstance().extrudersChanged.emit(self._global_container_stack.getId())
|
||||||
# Make sure the front end reflects changes
|
# Make sure the front end reflects changes
|
||||||
self.forceUpdateAllSettings()
|
self.forceUpdateAllSettings()
|
||||||
|
|
@ -1076,7 +1076,6 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
#
|
|
||||||
# Sets all quality and quality_changes containers to empty_quality and empty_quality_changes containers
|
# Sets all quality and quality_changes containers to empty_quality and empty_quality_changes containers
|
||||||
# for all stacks in the currently active machine.
|
# for all stacks in the currently active machine.
|
||||||
#
|
#
|
||||||
|
|
@ -1205,7 +1204,7 @@ class MachineManager(QObject):
|
||||||
self.rootMaterialChanged.emit()
|
self.rootMaterialChanged.emit()
|
||||||
|
|
||||||
def activeMaterialsCompatible(self) -> bool:
|
def activeMaterialsCompatible(self) -> bool:
|
||||||
# check material - variant compatibility
|
# Check material - variant compatibility
|
||||||
if self._global_container_stack is not None:
|
if self._global_container_stack is not None:
|
||||||
if Util.parseBool(self._global_container_stack.getMetaDataEntry("has_materials", False)):
|
if Util.parseBool(self._global_container_stack.getMetaDataEntry("has_materials", False)):
|
||||||
for position, extruder in self._global_container_stack.extruders.items():
|
for position, extruder in self._global_container_stack.extruders.items():
|
||||||
|
|
@ -1415,7 +1414,7 @@ class MachineManager(QObject):
|
||||||
material_diameter, root_material_id)
|
material_diameter, root_material_id)
|
||||||
self.setMaterial(position, material_node)
|
self.setMaterial(position, material_node)
|
||||||
|
|
||||||
## global_stack: if you want to provide your own global_stack instead of the current active one
|
## Global_stack: if you want to provide your own global_stack instead of the current active one
|
||||||
# if you update an active machine, special measures have to be taken.
|
# if you update an active machine, special measures have to be taken.
|
||||||
@pyqtSlot(str, "QVariant")
|
@pyqtSlot(str, "QVariant")
|
||||||
def setMaterial(self, position: str, container_node, global_stack: Optional["GlobalStack"] = None) -> None:
|
def setMaterial(self, position: str, container_node, global_stack: Optional["GlobalStack"] = None) -> None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue