Merge remote-tracking branch 'origin/master' into refactoring_machine_manager

This commit is contained in:
Lipu Fei 2018-02-21 14:05:19 +01:00
commit 9a354efd19
15 changed files with 197 additions and 30 deletions

View file

@ -208,19 +208,12 @@ class CuraContainerRegistry(ContainerRegistry):
Logger.log("e", "Incorrect profile [%s]. Could not find global profile", file_name)
return { "status": "error",
"message": catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "This profile <filename>{0}</filename> contains incorrect data, could not import it.", file_name)}
# In a profile we can have the quality_definition metadata, but if not, we get the definition
profile_definition = global_profile.getMetaDataEntry("quality_definition")
if not profile_definition:
profile_definition = global_profile.getMetaDataEntry("definition")
# The expected machine definition may be the quality_definition if defined or the current definition id
expected_machine_definition = None
profile_definition = global_profile.getMetaDataEntry("definition")
expected_machine_definition = "fdmprinter"
if parseBool(global_container_stack.getMetaDataEntry("has_machine_quality", "False")):
expected_machine_definition = global_container_stack.getMetaDataEntry("quality_definition")
if not expected_machine_definition:
expected_machine_definition = global_container_stack.definition.getId()
if not expected_machine_definition:
expected_machine_definition = global_container_stack.definition.getId()
if expected_machine_definition is not None and profile_definition is not None and profile_definition != expected_machine_definition:
Logger.log("e", "Profile [%s] is for machine [%s] but the current active machine is [%s]. Will not import the profile", file_name, profile_definition, expected_machine_definition)
return { "status": "error",