mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 13:34:01 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
c712cbb664
4 changed files with 26 additions and 22 deletions
|
@ -165,14 +165,18 @@ class SettingVisibilityPresetsModel(ListModel):
|
|||
matching_preset_item = item
|
||||
break
|
||||
|
||||
item_to_set = self._active_preset_item
|
||||
if matching_preset_item is None:
|
||||
# The new visibility setup is "custom" should be custom
|
||||
if self._active_preset_item["id"] == "custom":
|
||||
# We are already in custom, just save the settings
|
||||
self._preferences.setValue("cura/custom_visible_settings", visibility_string)
|
||||
else:
|
||||
self._active_preset_item = self.items[0] # 0 is custom
|
||||
self.activePresetChanged.emit()
|
||||
item_to_set = self.items[0] # 0 is custom
|
||||
else:
|
||||
self._active_preset_item = matching_preset_item
|
||||
item_to_set = matching_preset_item
|
||||
|
||||
if self._active_preset_item is None or self._active_preset_item["id"] != item_to_set["id"]:
|
||||
self._active_preset_item = item_to_set
|
||||
self._preferences.setValue("cura/active_setting_visibility_preset", self._active_preset_item["id"])
|
||||
self.activePresetChanged.emit()
|
||||
|
|
|
@ -224,7 +224,11 @@ class CuraEngineBackend(QObject, Backend):
|
|||
active_build_plate = Application.getInstance().getMultiBuildPlateModel().activeBuildPlate
|
||||
build_plate_to_be_sliced = self._build_plates_to_be_sliced.pop(0)
|
||||
Logger.log("d", "Going to slice build plate [%s]!" % build_plate_to_be_sliced)
|
||||
num_objects = self._numObjects()
|
||||
num_objects = self._numObjectsPerBuildPlate()
|
||||
|
||||
self._stored_layer_data = []
|
||||
self._stored_optimized_layer_data[build_plate_to_be_sliced] = []
|
||||
|
||||
if build_plate_to_be_sliced not in num_objects or num_objects[build_plate_to_be_sliced] == 0:
|
||||
self._scene.gcode_dict[build_plate_to_be_sliced] = []
|
||||
Logger.log("d", "Build plate %s has no objects to be sliced, skipping", build_plate_to_be_sliced)
|
||||
|
@ -232,9 +236,6 @@ class CuraEngineBackend(QObject, Backend):
|
|||
self.slice()
|
||||
return
|
||||
|
||||
self._stored_layer_data = []
|
||||
self._stored_optimized_layer_data[build_plate_to_be_sliced] = []
|
||||
|
||||
if Application.getInstance().getPrintInformation() and build_plate_to_be_sliced == active_build_plate:
|
||||
Application.getInstance().getPrintInformation().setToZeroPrintInformation(build_plate_to_be_sliced)
|
||||
|
||||
|
@ -426,7 +427,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||
return False
|
||||
|
||||
## Return a dict with number of objects per build plate
|
||||
def _numObjects(self):
|
||||
def _numObjectsPerBuildPlate(self):
|
||||
num_objects = defaultdict(int)
|
||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||
# Only count sliceable objects
|
||||
|
@ -453,7 +454,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||
source_build_plate_number = source.callDecoration("getBuildPlateNumber")
|
||||
if source == self._scene.getRoot():
|
||||
# we got the root node
|
||||
num_objects = self._numObjects()
|
||||
num_objects = self._numObjectsPerBuildPlate()
|
||||
for build_plate_number in list(self._last_num_objects.keys()) + list(num_objects.keys()):
|
||||
if build_plate_number not in self._last_num_objects or num_objects[build_plate_number] != self._last_num_objects[build_plate_number]:
|
||||
self._last_num_objects[build_plate_number] = num_objects[build_plate_number]
|
||||
|
@ -604,7 +605,12 @@ class CuraEngineBackend(QObject, Backend):
|
|||
|
||||
# See if we need to process the sliced layers job.
|
||||
active_build_plate = Application.getInstance().getMultiBuildPlateModel().activeBuildPlate
|
||||
if self._layer_view_active and (self._process_layers_job is None or not self._process_layers_job.isRunning()) and active_build_plate == self._start_slice_job_build_plate:
|
||||
if (
|
||||
self._layer_view_active and
|
||||
(self._process_layers_job is None or not self._process_layers_job.isRunning()) and
|
||||
active_build_plate == self._start_slice_job_build_plate and
|
||||
active_build_plate not in self._build_plates_to_be_sliced):
|
||||
|
||||
self._startProcessSlicedLayersJob(active_build_plate)
|
||||
# self._onActiveViewChanged()
|
||||
self._start_slice_job_build_plate = None
|
||||
|
@ -733,7 +739,11 @@ class CuraEngineBackend(QObject, Backend):
|
|||
# There is data and we're not slicing at the moment
|
||||
# if we are slicing, there is no need to re-calculate the data as it will be invalid in a moment.
|
||||
# TODO: what build plate I am slicing
|
||||
if active_build_plate in self._stored_optimized_layer_data and not self._slicing and not self._process_layers_job:
|
||||
if (active_build_plate in self._stored_optimized_layer_data and
|
||||
not self._slicing and
|
||||
not self._process_layers_job and
|
||||
active_build_plate not in self._build_plates_to_be_sliced):
|
||||
|
||||
self._startProcessSlicedLayersJob(active_build_plate)
|
||||
else:
|
||||
self._layer_view_active = False
|
||||
|
|
|
@ -41,8 +41,7 @@ Menu
|
|||
MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Show All Settings")
|
||||
checkable: true
|
||||
checked: showingAllSettings
|
||||
checkable: false
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
|
|
|
@ -78,15 +78,6 @@ UM.PreferencesPage
|
|||
{
|
||||
definitionsModel.setAllExpandedVisible(false)
|
||||
}
|
||||
|
||||
// After change set "Custom" option
|
||||
|
||||
// If already "Custom" then don't do nothing
|
||||
if (visibilityPreset.currentIndex != visibilityPreset.model.count - 1)
|
||||
{
|
||||
visibilityPreset.currentIndex = visibilityPreset.model.count - 1
|
||||
UM.Preferences.setValue("cura/active_setting_visibility_preset", visibilityPreset.model.getItem(visibilityPreset.currentIndex).id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue