|
@@ -128,6 +128,7 @@ class MachineManager(QObject):
|
|
|
self.activeQualityChangesGroupChanged.connect(self.activeQualityDisplayNameChanged)
|
|
|
|
|
|
self.activeStackValueChanged.connect(self._reCalculateNumUserSettings)
|
|
|
+ self.numberExtrudersEnabledChanged.connect(self.correctPrintSequence)
|
|
|
|
|
|
activeQualityDisplayNameChanged = pyqtSignal()
|
|
|
|
|
@@ -826,11 +827,6 @@ class MachineManager(QObject):
|
|
|
result = [] # type: List[str]
|
|
|
for setting_instance in container.findInstances():
|
|
|
setting_key = setting_instance.definition.key
|
|
|
- if setting_key == "print_sequence":
|
|
|
- old_value = container.getProperty(setting_key, "value")
|
|
|
- Logger.log("d", "Reset setting [%s] in [%s] because its old value [%s] is no longer valid", setting_key, container, old_value)
|
|
|
- result.append(setting_key)
|
|
|
- continue
|
|
|
if not self._global_container_stack.getProperty(setting_key, "type") in ("extruder", "optional_extruder"):
|
|
|
continue
|
|
|
|
|
@@ -862,6 +858,41 @@ class MachineManager(QObject):
|
|
|
title = catalog.i18nc("@info:title", "Settings updated"))
|
|
|
caution_message.show()
|
|
|
|
|
|
+ def correctPrintSequence(self) -> None:
|
|
|
+ """
|
|
|
+ Sets the Print Sequence setting to "all-at-once" when there are more than one enabled extruders.
|
|
|
+
|
|
|
+ This setting has to be explicitly changed whenever we have more than one enabled extruders to make sure that the
|
|
|
+ Cura UI is properly updated to reset all the UI elements changes that occur due to the one-at-a-time mode (such
|
|
|
+ as the reduced build volume, the different convex hulls of the objects etc.).
|
|
|
+ """
|
|
|
+
|
|
|
+ setting_key = "print_sequence"
|
|
|
+ new_value = "all_at_once"
|
|
|
+
|
|
|
+ if self._global_container_stack is None \
|
|
|
+ or self._global_container_stack.getProperty(setting_key, "value") == new_value \
|
|
|
+ or self.numberExtrudersEnabled < 2:
|
|
|
+ return
|
|
|
+
|
|
|
+ user_changes_container = self._global_container_stack.userChanges
|
|
|
+ quality_changes_container = self._global_container_stack.qualityChanges
|
|
|
+ print_sequence_quality_changes = quality_changes_container.getProperty(setting_key, "value")
|
|
|
+ print_sequence_user_changes = user_changes_container.getProperty(setting_key, "value")
|
|
|
+
|
|
|
+ # If the user changes container has a value and its the incorrect value, then reset the setting in the user
|
|
|
+ # changes (so that the circular revert-changes arrow will now show up in the interface)
|
|
|
+ if print_sequence_user_changes and print_sequence_user_changes != new_value:
|
|
|
+ user_changes_container.removeInstance(setting_key)
|
|
|
+ Logger.log("d", "Resetting '{}' in container '{}' because there are more than 1 enabled extruders.".format(setting_key, user_changes_container))
|
|
|
+ # If the print sequence doesn't exist in either the user changes or the quality changes (yet it still has the
|
|
|
+ # wrong value in the global stack), or it exists in the quality changes and it has the wrong value, then set it
|
|
|
+ # in the user changes
|
|
|
+ elif (not print_sequence_quality_changes and not print_sequence_user_changes) \
|
|
|
+ or (print_sequence_quality_changes and print_sequence_quality_changes != new_value):
|
|
|
+ user_changes_container.setProperty(setting_key, "value", new_value)
|
|
|
+ Logger.log("d", "Setting '{}' in '{}' to '{}' because there are more than 1 enabled extruders.".format(setting_key, user_changes_container, new_value))
|
|
|
+
|
|
|
def setActiveMachineExtruderCount(self, extruder_count: int) -> None:
|
|
|
"""Set the amount of extruders on the active machine (global stack)
|
|
|
|