From 2e1aef87a148acc0555f2dac326b44fad265507d Mon Sep 17 00:00:00 2001 From: bubnikv Date: Sun, 15 Mar 2020 08:38:17 +0100 Subject: [PATCH] The import of system profiles was improved to not inherit the "renamed_from" field as it is specific to a concrete profile. Prusa Research system profile was annotated with "renamed_from" to indicate that the PETG profiles were renamed from PET somewhere after PrusaSlicer 2.2.1 release. --- resources/profiles/PrusaResearch.idx | 1 + resources/profiles/PrusaResearch.ini | 15 ++++++++++++++- src/slic3r/GUI/PresetBundle.cpp | 6 +++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/resources/profiles/PrusaResearch.idx b/resources/profiles/PrusaResearch.idx index 9fcc8c1ad..3990bdd78 100644 --- a/resources/profiles/PrusaResearch.idx +++ b/resources/profiles/PrusaResearch.idx @@ -1,4 +1,5 @@ min_slic3r_version = 2.2.0-alpha3 +1.1.2 Added renamed_from fields for PETG filaments to indicate that they were renamed from PET. 1.1.1 Added Verbatim and Fiberlogy PETG filament profiles. Updated auto cooling settings for ABS. 1.1.1-beta Updated for PrusaSlicer 2.2.0-beta 1.1.1-alpha4 Extended list of default filaments to be installed, top/bottom_solid_min_thickness defined, infill_acceleration changed etc diff --git a/resources/profiles/PrusaResearch.ini b/resources/profiles/PrusaResearch.ini index 1b22575c0..c98384fd6 100644 --- a/resources/profiles/PrusaResearch.ini +++ b/resources/profiles/PrusaResearch.ini @@ -5,7 +5,7 @@ name = Prusa Research # Configuration version of this file. Config file will only be installed, if the config_version differs. # This means, the server may force the PrusaSlicer configuration to be downgraded. -config_version = 1.1.1 +config_version = 1.1.2 # Where to get the updates from? config_update_url = http://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/PrusaResearch/ changelog_url = http://files.prusa3d.com/?latest=slicer-profiles&lng=%1% @@ -1874,6 +1874,7 @@ filament_density = 1.04 [filament:Generic PETG] inherits = *PET* +renamed_from = "Generic PET" filament_vendor = Generic filament_cost = 27.82 filament_density = 1.27 @@ -2076,6 +2077,7 @@ temperature = 230 [filament:Prusa PETG] inherits = *PET* +renamed_from = "Prusa PET" filament_vendor = Made for Prusa filament_cost = 27.82 filament_density = 1.27 @@ -2107,6 +2109,7 @@ compatible_printers_condition = nozzle_diameter[0]!=0.6 and printer_model!="MK2S [filament:Prusa PETG @0.6 nozzle] inherits = *PET06* +renamed_from = "Prusa PET 0.6 nozzle"; "Prusa PETG 0.6 nozzle" filament_vendor = Made for Prusa filament_cost = 27.82 filament_density = 1.27 @@ -2172,6 +2175,7 @@ filament_max_volumetric_speed = 13 [filament:Generic PETG @MMU2] inherits = *PET MMU2* +renamed_from = "Generic PET MMU2"; "Generic PETG MMU2" filament_vendor = Generic [filament:Plasty Mladec PETG @MMU2] @@ -2180,6 +2184,7 @@ filament_vendor = Plasty Mladec [filament:Prusa PETG @MMU2] inherits = *PET MMU2* +renamed_from = "Prusa PET MMU2"; "Prusa PETG MMU2" filament_vendor = Made for Prusa [filament:Prusament PETG @MMU2] @@ -2189,10 +2194,12 @@ filament_vendor = Prusa Polymers [filament:Generic PETG @MMU2 0.6 nozzle] inherits = *PET MMU2 06* +renamed_from = "Generic PET MMU2 0.6 nozzle"; "Generic PETG MMU2 0.6 nozzle" filament_vendor = Generic [filament:Prusa PETG @MMU2 0.6 nozzle] inherits = *PET MMU2 06* +renamed_from = "Prusa PET MMU2 0.6 nozzle"; "Prusa PETG MMU2 0.6 nozzle" filament_vendor = Made for Prusa [filament:Prusament PETG @MMU2 0.6 nozzle] @@ -2525,6 +2532,7 @@ temperature = 275 [filament:Generic PETG @MMU1] inherits = *PETMMU1* +renamed_from = "Generic PET MMU1"; "Generic PETG MMU1" filament_vendor = Generic filament_cost = 27.82 filament_density = 1.27 @@ -2549,6 +2557,7 @@ filament_density = 1.27 [filament:Prusa PETG @MMU1] inherits = *PETMMU1* +renamed_from = "Prusa PET MMU1"; "Prusa PETG MMU1" filament_vendor = Made for Prusa filament_cost = 27.82 filament_density = 1.27 @@ -2602,6 +2611,7 @@ compatible_printers_condition = printer_model=="MK2SMM" [filament:Generic PETG @MINI] inherits = Generic PETG; *PETMINI* +renamed_from = "Generic PET MINI"; "Generic PETG MINI" filament_vendor = Generic filament_cost = 27.82 filament_density = 1.27 @@ -2702,6 +2712,7 @@ filament_cost = 24.99 [filament:Generic PETG @0.6 nozzle MINI] inherits = Generic PETG; *PETMINI06* +renamed_from = "Generic PET 0.6 nozzle MINI"; "Generic PETG 0.6 nozzle MINI" [filament:Plasty Mladec PETG @0.6 nozzle MINI] inherits = Generic PETG; *PETMINI06* @@ -2983,6 +2994,7 @@ filament_type = EDGE [filament:Prusa PETG @MINI] inherits = *PETMINI* +renamed_from = "Prusa PET MINI"; "Prusa PETG MINI" filament_vendor = Made for Prusa filament_cost = 27.82 filament_density = 1.27 @@ -2990,6 +3002,7 @@ compatible_printers_condition = printer_model=="MINI" and nozzle_diameter[0]!=0. [filament:Prusa PETG @0.6 nozzle MINI] inherits = *PETMINI06* +renamed_from = "Prusa PET 0.6 nozzle MINI"; "Prusa PETG 0.6 nozzle MINI" filament_vendor = Made for Prusa filament_cost = 27.82 filament_density = 1.27 diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 4db837be2..3a48cd675 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -1073,7 +1073,11 @@ static void flatten_configbundle_hierarchy(boost::property_tree::ptree &tree, co // Iterate in a reverse order, so the last change will be placed first in merged. for (auto it_inherits = prst->inherits.rbegin(); it_inherits != prst->inherits.rend(); ++ it_inherits) for (auto it = (*it_inherits)->node->begin(); it != (*it_inherits)->node->end(); ++ it) - if (prst->node->find(it->first) == prst->node->not_found()) + if (it->first == "renamed_from") { + // Don't inherit "renamed_from" flag, it does not make sense. The "renamed_from" flag only makes sense for a concrete preset. + if (boost::starts_with((*it_inherits)->name, "*")) + BOOST_LOG_TRIVIAL(error) << boost::format("Nonpublic intermediate preset %1% contains a \"renamed_from\" field, which is ignored") % (*it_inherits)->name; + } else if (prst->node->find(it->first) == prst->node->not_found()) prst->node->add_child(it->first, it->second); }