mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-16 12:56:41 +08:00
Merge branch '2.3' of github.com:Ultimaker/Cura
This commit is contained in:
commit
b6e6871f23
@ -338,13 +338,6 @@ class BuildVolume(SceneNode):
|
|||||||
prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2
|
prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2
|
||||||
prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2
|
prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2
|
||||||
|
|
||||||
'''disallowed_areas.append([
|
|
||||||
[prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size],
|
|
||||||
[prime_tower_x, prime_tower_y - prime_tower_size],
|
|
||||||
[prime_tower_x, prime_tower_y],
|
|
||||||
[prime_tower_x - prime_tower_size, prime_tower_y],
|
|
||||||
])'''
|
|
||||||
|
|
||||||
self._prime_tower_area = Polygon([
|
self._prime_tower_area = Polygon([
|
||||||
[prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size],
|
[prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size],
|
||||||
[prime_tower_x, prime_tower_y - prime_tower_size],
|
[prime_tower_x, prime_tower_y - prime_tower_size],
|
||||||
|
@ -172,11 +172,11 @@ class ContainerManager(QObject):
|
|||||||
containers = self._container_registry.findContainers(None, id=container_id)
|
containers = self._container_registry.findContainers(None, id=container_id)
|
||||||
if not containers:
|
if not containers:
|
||||||
UM.Logger.log("w", "Could not get metadata of container %s because it was not found.", container_id)
|
UM.Logger.log("w", "Could not get metadata of container %s because it was not found.", container_id)
|
||||||
return False
|
return ""
|
||||||
|
|
||||||
result = containers[0].getMetaDataEntry(entry_name)
|
result = containers[0].getMetaDataEntry(entry_name)
|
||||||
if result:
|
if result is not None:
|
||||||
return result
|
return str(result)
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@ -531,6 +531,12 @@ class MachineManager(QObject):
|
|||||||
|
|
||||||
containers[0].nameChanged.connect(self._onMaterialNameChanged)
|
containers[0].nameChanged.connect(self._onMaterialNameChanged)
|
||||||
|
|
||||||
|
if containers[0].getMetaDataEntry("compatible") == False:
|
||||||
|
message = Message(catalog.i18nc("@info:status",
|
||||||
|
"The selected material is imcompatible with the selected machine or configuration."))
|
||||||
|
message.show()
|
||||||
|
|
||||||
|
|
||||||
if old_quality:
|
if old_quality:
|
||||||
if old_quality_changes:
|
if old_quality_changes:
|
||||||
new_quality = self._updateQualityChangesContainer(old_quality.getMetaDataEntry("quality_type"), old_quality_changes.getMetaDataEntry("name"))
|
new_quality = self._updateQualityChangesContainer(old_quality.getMetaDataEntry("quality_type"), old_quality_changes.getMetaDataEntry("name"))
|
||||||
|
@ -82,6 +82,13 @@ class StartSliceJob(Job):
|
|||||||
self.setResult(StartJobResult.SettingError)
|
self.setResult(StartJobResult.SettingError)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
|
||||||
|
material = extruder_stack.findContainer({"type": "material"})
|
||||||
|
if material:
|
||||||
|
if material.getMetaDataEntry("compatible") == False:
|
||||||
|
self.setResult(StartJobResult.SettingError)
|
||||||
|
return
|
||||||
|
|
||||||
# Don't slice if there is a per object setting with an error value.
|
# Don't slice if there is a per object setting with an error value.
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||||
if type(node) is not SceneNode or not node.isSelectable():
|
if type(node) is not SceneNode or not node.isSelectable():
|
||||||
|
@ -54,10 +54,10 @@ class CuraProfileReader(ProfileReader):
|
|||||||
|
|
||||||
if not "general" in parser:
|
if not "general" in parser:
|
||||||
Logger.log("w", "Missing required section 'general'.")
|
Logger.log("w", "Missing required section 'general'.")
|
||||||
return None
|
return []
|
||||||
if not "version" in parser["general"]:
|
if not "version" in parser["general"]:
|
||||||
Logger.log("w", "Missing required 'version' property")
|
Logger.log("w", "Missing required 'version' property")
|
||||||
return None
|
return []
|
||||||
|
|
||||||
version = int(parser["general"]["version"])
|
version = int(parser["general"]["version"])
|
||||||
if InstanceContainer.Version != version:
|
if InstanceContainer.Version != version:
|
||||||
|
@ -83,7 +83,6 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||||||
# machine / variant combination: only changes for itself.
|
# machine / variant combination: only changes for itself.
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
if self._read_only:
|
if self._read_only:
|
||||||
Logger.log("w", "Serializing read-only container [%s], probably a programming error." % self.id)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
registry = UM.Settings.ContainerRegistry.getInstance()
|
registry = UM.Settings.ContainerRegistry.getInstance()
|
||||||
@ -428,8 +427,8 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||||||
for identifier in identifiers:
|
for identifier in identifiers:
|
||||||
machine_id = self.__product_id_map.get(identifier.get("product"), None)
|
machine_id = self.__product_id_map.get(identifier.get("product"), None)
|
||||||
if machine_id is None:
|
if machine_id is None:
|
||||||
Logger.log("w", "Cannot create material for unknown machine %s", identifier.get("product"))
|
# Lets try again with some naive heuristics.
|
||||||
continue
|
machine_id = identifier.get("product").replace(" ", "").lower()
|
||||||
|
|
||||||
definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = machine_id)
|
definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = machine_id)
|
||||||
if not definitions:
|
if not definitions:
|
||||||
@ -454,6 +453,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||||||
|
|
||||||
UM.Settings.ContainerRegistry.getInstance().addContainer(new_material)
|
UM.Settings.ContainerRegistry.getInstance().addContainer(new_material)
|
||||||
|
|
||||||
|
|
||||||
hotends = machine.iterfind("./um:hotend", self.__namespaces)
|
hotends = machine.iterfind("./um:hotend", self.__namespaces)
|
||||||
for hotend in hotends:
|
for hotend in hotends:
|
||||||
hotend_id = hotend.get("id")
|
hotend_id = hotend.get("id")
|
||||||
@ -482,14 +482,12 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||||||
else:
|
else:
|
||||||
Logger.log("d", "Unsupported material setting %s", key)
|
Logger.log("d", "Unsupported material setting %s", key)
|
||||||
|
|
||||||
if not hotend_compatibility:
|
|
||||||
continue
|
|
||||||
|
|
||||||
new_hotend_material = XmlMaterialProfile(self.id + "_" + machine_id + "_" + hotend_id.replace(" ", "_"))
|
new_hotend_material = XmlMaterialProfile(self.id + "_" + machine_id + "_" + hotend_id.replace(" ", "_"))
|
||||||
new_hotend_material.setName(self.getName())
|
new_hotend_material.setName(self.getName())
|
||||||
new_hotend_material.setMetaData(copy.deepcopy(self.getMetaData()))
|
new_hotend_material.setMetaData(copy.deepcopy(self.getMetaData()))
|
||||||
new_hotend_material.setDefinition(definition)
|
new_hotend_material.setDefinition(definition)
|
||||||
new_hotend_material.addMetaDataEntry("variant", variant_containers[0].id)
|
new_hotend_material.addMetaDataEntry("variant", variant_containers[0].id)
|
||||||
|
new_hotend_material.addMetaDataEntry("compatible", hotend_compatibility)
|
||||||
|
|
||||||
for key, value in global_setting_values.items():
|
for key, value in global_setting_values.items():
|
||||||
new_hotend_material.setProperty(key, "value", value, definition)
|
new_hotend_material.setProperty(key, "value", value, definition)
|
||||||
@ -507,7 +505,9 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
|||||||
# Change the type of this container so it is not shown as an option in menus.
|
# Change the type of this container so it is not shown as an option in menus.
|
||||||
# This uses InstanceContainer.setMetaDataEntry because otherwise all containers that
|
# This uses InstanceContainer.setMetaDataEntry because otherwise all containers that
|
||||||
# share this basefile are also updated.
|
# share this basefile are also updated.
|
||||||
|
dirty = self.isDirty()
|
||||||
super().setMetaDataEntry("type", "incompatible_material")
|
super().setMetaDataEntry("type", "incompatible_material")
|
||||||
|
super().setDirty(dirty) # reset dirty flag after setMetaDataEntry
|
||||||
|
|
||||||
def _addSettingElement(self, builder, instance):
|
def _addSettingElement(self, builder, instance):
|
||||||
try:
|
try:
|
||||||
|
@ -232,6 +232,19 @@ Column
|
|||||||
text: Cura.MachineManager.activeMaterialName
|
text: Cura.MachineManager.activeMaterialName
|
||||||
tooltip: Cura.MachineManager.activeMaterialName
|
tooltip: Cura.MachineManager.activeMaterialName
|
||||||
visible: Cura.MachineManager.hasMaterials
|
visible: Cura.MachineManager.hasMaterials
|
||||||
|
property var valueError:
|
||||||
|
{
|
||||||
|
var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible")
|
||||||
|
print(data)
|
||||||
|
if(data == "" || data == "True")
|
||||||
|
{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if(data == "False")
|
||||||
|
{
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
|
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
|
||||||
|
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
|
@ -15,7 +15,11 @@ QtObject {
|
|||||||
{
|
{
|
||||||
if(control.enabled)
|
if(control.enabled)
|
||||||
{
|
{
|
||||||
if(control.valueWarning)
|
if(control.valueError)
|
||||||
|
{
|
||||||
|
return Theme.getColor("setting_validation_error");
|
||||||
|
}
|
||||||
|
else if(control.valueWarning)
|
||||||
{
|
{
|
||||||
return Theme.getColor("setting_validation_warning");
|
return Theme.getColor("setting_validation_warning");
|
||||||
} else
|
} else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user