mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:28:59 +08:00
Merge branch 'master' of github.com:Ultimaker/cura
This commit is contained in:
commit
3a5b96b0e9
@ -36,6 +36,11 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# We don't have all the machines loaded in the beginning, so in order to add the missing extruder stack
|
||||
# for single extrusion machines, we subscribe to the containerAdded signal, and whenever a global stack
|
||||
# is added, we check to see if an extruder stack needs to be added.
|
||||
self.containerAdded.connect(self._onContainerAdded)
|
||||
|
||||
## Overridden from ContainerRegistry
|
||||
#
|
||||
# Adds a container to the registry.
|
||||
@ -410,6 +415,17 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
if not extruder_stacks:
|
||||
self.addExtruderStackForSingleExtrusionMachine(machine, "fdmextruder")
|
||||
|
||||
def _onContainerAdded(self, container):
|
||||
# We don't have all the machines loaded in the beginning, so in order to add the missing extruder stack
|
||||
# for single extrusion machines, we subscribe to the containerAdded signal, and whenever a global stack
|
||||
# is added, we check to see if an extruder stack needs to be added.
|
||||
if not isinstance(container, ContainerStack) or container.getMetaDataEntry("type") != "machine":
|
||||
return
|
||||
|
||||
extruder_stacks = self.findContainerStacks(type = "extruder_train", machine = container.getId())
|
||||
if not extruder_stacks:
|
||||
self.addExtruderStackForSingleExtrusionMachine(container, "fdmextruder")
|
||||
|
||||
def addExtruderStackForSingleExtrusionMachine(self, machine, extruder_id):
|
||||
new_extruder_id = extruder_id
|
||||
|
||||
@ -425,7 +441,6 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
extruder_stack.setName(extruder_definition.getName())
|
||||
extruder_stack.setDefinition(extruder_definition)
|
||||
extruder_stack.addMetaDataEntry("position", extruder_definition.getMetaDataEntry("position"))
|
||||
extruder_stack.setNextStack(machine)
|
||||
|
||||
# create empty user changes container otherwise
|
||||
user_container = InstanceContainer(extruder_stack.id + "_user")
|
||||
@ -433,7 +448,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
user_container.addMetaDataEntry("machine", extruder_stack.getId())
|
||||
from cura.CuraApplication import CuraApplication
|
||||
user_container.addMetaDataEntry("setting_version", CuraApplication.SettingVersion)
|
||||
user_container.setDefinition(machine.definition)
|
||||
user_container.setDefinition(machine.definition.getId())
|
||||
|
||||
if machine.userChanges:
|
||||
# for the newly created extruder stack, we need to move all "per-extruder" settings to the user changes
|
||||
@ -444,8 +459,8 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
user_container.addInstance(machine.userChanges.getInstance(user_setting_key))
|
||||
machine.userChanges.removeInstance(user_setting_key, postpone_emit = True)
|
||||
|
||||
extruder_stack.setUserChanges(user_container)
|
||||
self.addContainer(user_container)
|
||||
extruder_stack.setUserChanges(user_container)
|
||||
|
||||
variant_id = "default"
|
||||
if machine.variant.getId() not in ("empty", "empty_variant"):
|
||||
@ -491,6 +506,9 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
|
||||
self.addContainer(extruder_stack)
|
||||
|
||||
# Set next stack at the end
|
||||
extruder_stack.setNextStack(machine)
|
||||
|
||||
return extruder_stack
|
||||
|
||||
def _findQualityChangesContainerInCuraFolder(self, name):
|
||||
|
@ -369,7 +369,9 @@ class MachineManager(QObject):
|
||||
self.blurSettings.emit() # Ensure no-one has focus.
|
||||
self._cancelDelayedActiveContainerStackChanges()
|
||||
|
||||
containers = ContainerRegistry.getInstance().findContainerStacks(id = stack_id)
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
|
||||
containers = container_registry.findContainerStacks(id = stack_id)
|
||||
if containers:
|
||||
Application.getInstance().setGlobalContainerStack(containers[0])
|
||||
|
||||
|
@ -218,7 +218,7 @@ class StartSliceJob(Job):
|
||||
result[key] = stack.getProperty(key, "value")
|
||||
Job.yieldThread()
|
||||
|
||||
result["print_bed_temperature"] = result["material_bed_temperature"] #Renamed settings.
|
||||
result["print_bed_temperature"] = result["material_bed_temperature"] # Renamed settings.
|
||||
result["print_temperature"] = result["material_print_temperature"]
|
||||
result["time"] = time.strftime("%H:%M:%S") #Some extra settings.
|
||||
result["date"] = time.strftime("%d-%m-%Y")
|
||||
@ -246,10 +246,10 @@ class StartSliceJob(Job):
|
||||
|
||||
settings = self._buildReplacementTokens(stack)
|
||||
|
||||
#Also send the material GUID. This is a setting in fdmprinter, but we have no interface for it.
|
||||
# Also send the material GUID. This is a setting in fdmprinter, but we have no interface for it.
|
||||
settings["material_guid"] = stack.material.getMetaDataEntry("GUID", "")
|
||||
|
||||
#Replace the setting tokens in start and end g-code.
|
||||
# Replace the setting tokens in start and end g-code.
|
||||
settings["machine_extruder_start_code"] = self._expandGcodeTokens(settings["machine_extruder_start_code"], settings)
|
||||
settings["machine_extruder_end_code"] = self._expandGcodeTokens(settings["machine_extruder_end_code"], settings)
|
||||
|
||||
@ -269,18 +269,23 @@ class StartSliceJob(Job):
|
||||
def _buildGlobalSettingsMessage(self, stack):
|
||||
settings = self._buildReplacementTokens(stack)
|
||||
|
||||
# Pre-compute material material_bed_temp_prepend and material_print_temp_prepend
|
||||
start_gcode = settings["machine_start_gcode"]
|
||||
#Pre-compute material material_bed_temp_prepend and material_print_temp_prepend
|
||||
bed_temperature_settings = {"material_bed_temperature", "material_bed_temperature_layer_0"}
|
||||
settings["material_bed_temp_prepend"] = all(("{" + setting + "}" not in start_gcode for setting in bed_temperature_settings))
|
||||
print_temperature_settings = {"material_print_temperature", "material_print_temperature_layer_0", "default_material_print_temperature", "material_initial_print_temperature", "material_final_print_temperature", "material_standby_temperature"}
|
||||
settings["material_print_temp_prepend"] = all(("{" + setting + "}" not in start_gcode for setting in print_temperature_settings))
|
||||
|
||||
#Replace the setting tokens in start and end g-code.
|
||||
settings["machine_start_gcode"] = self._expandGcodeTokens(settings["machine_start_gcode"], settings)
|
||||
settings["machine_end_gcode"] = self._expandGcodeTokens(settings["machine_end_gcode"], settings)
|
||||
# Find the correct temperatures from the first used extruder
|
||||
extruder_stack = Application.getInstance().getExtruderManager().getUsedExtruderStacks()[0]
|
||||
extruder_0_settings = self._buildReplacementTokens(extruder_stack)
|
||||
|
||||
for key, value in settings.items(): #Add all submessages for each individual setting.
|
||||
# Replace the setting tokens in start and end g-code.
|
||||
settings["machine_start_gcode"] = self._expandGcodeTokens(settings["machine_start_gcode"], extruder_0_settings)
|
||||
settings["machine_end_gcode"] = self._expandGcodeTokens(settings["machine_end_gcode"], extruder_0_settings)
|
||||
|
||||
# Add all sub-messages for each individual setting.
|
||||
for key, value in settings.items():
|
||||
setting_message = self._slice_message.getMessage("global_settings").addRepeatedMessage("settings")
|
||||
setting_message.name = key
|
||||
setting_message.value = str(value).encode("utf-8")
|
||||
|
@ -99,7 +99,9 @@ class SliceInfo(Extension):
|
||||
"type": extruder.material.getMetaData().get("material", ""),
|
||||
"brand": extruder.material.getMetaData().get("brand", "")
|
||||
}
|
||||
extruder_dict["material_used"] = print_information.materialLengths[int(extruder.getMetaDataEntry("position", "0"))]
|
||||
extruder_position = int(extruder.getMetaDataEntry("position", "0"))
|
||||
if extruder_position in print_information.materialLengths:
|
||||
extruder_dict["material_used"] = print_information.materialLengths[extruder_position]
|
||||
extruder_dict["variant"] = extruder.variant.getName()
|
||||
extruder_dict["nozzle_size"] = extruder.getProperty("machine_nozzle_size", "value")
|
||||
|
||||
|
@ -14,7 +14,6 @@ Item {
|
||||
|
||||
property real progress: UM.Backend.progress
|
||||
property int backendState: UM.Backend.state
|
||||
property var backend: CuraApplication.getBackend() || "undefined"
|
||||
property bool activity: CuraApplication.platformActivity
|
||||
|
||||
property alias buttonRowWidth: saveRow.width
|
||||
@ -50,12 +49,10 @@ Item {
|
||||
|
||||
function sliceOrStopSlicing() {
|
||||
try {
|
||||
if (base.backendState != "undefined" && base.backend != "undefined") {
|
||||
if ([1, 5].indexOf(base.backendState) != -1) {
|
||||
backend.forceSlice();
|
||||
CuraApplication.backend.forceSlice();
|
||||
} else {
|
||||
backend.stopSlicing();
|
||||
}
|
||||
CuraApplication.backend.stopSlicing();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Could not start or stop slicing', e)
|
||||
|
@ -179,8 +179,13 @@ Item {
|
||||
iconSource: UM.Theme.getIcon("reset")
|
||||
|
||||
onClicked: {
|
||||
revertButton.focus = true;
|
||||
Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key);
|
||||
revertButton.focus = true
|
||||
|
||||
if (resetHandler) {
|
||||
resetHandler(propertyProvider.key)
|
||||
} else {
|
||||
Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key)
|
||||
}
|
||||
}
|
||||
|
||||
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile.")) }
|
||||
|
@ -22,7 +22,6 @@ Rectangle
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
property int backendState: UM.Backend.state
|
||||
|
||||
property bool monitoringPrint: UM.Controller.activeStage.stageId == "MonitorStage"
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
[general]
|
||||
version = 2
|
||||
name = Fine
|
||||
definition = ultimaker3
|
||||
|
||||
[metadata]
|
||||
type = quality
|
||||
quality_type = normal
|
||||
material = generic_bam_ultimaker3_AA_0.4
|
||||
weight = 0
|
||||
setting_version = 4
|
||||
|
||||
[values]
|
||||
cool_fan_full_at_height = =layer_height_0 + 2 * layer_height
|
||||
cool_fan_speed_max = =cool_fan_speed
|
||||
cool_min_speed = 7
|
||||
machine_nozzle_cool_down_speed = 0.75
|
||||
machine_nozzle_heat_up_speed = 1.6
|
||||
material_print_temperature = =default_material_print_temperature - 10
|
||||
# prime_tower_enable: see CURA-4248
|
||||
prime_tower_enable = =min(extruderValues('material_surface_energy')) < 100
|
||||
skin_overlap = 10
|
||||
speed_layer_0 = 20
|
||||
support_interface_enable = True
|
||||
support_interface_density = =min(extruderValues('material_surface_energy'))
|
||||
support_interface_pattern = ='lines' if support_interface_density < 100 else 'concentric'
|
||||
support_top_distance = =math.ceil(min(extruderValues('material_adhesion_tendency')) / 1) * layer_height
|
||||
support_bottom_distance = =math.ceil(min(extruderValues('material_adhesion_tendency')) / 2) * layer_height
|
||||
support_angle = 45
|
||||
support_join_distance = 5
|
||||
support_offset = 2
|
||||
support_pattern = triangles
|
||||
support_infill_rate = 10
|
||||
top_bottom_thickness = 1
|
||||
wall_thickness = 1
|
Loading…
x
Reference in New Issue
Block a user