diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2018-03-21 12:20:36 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2018-03-21 12:20:36 +0300 |
commit | 1a1be94c99f99a63aab45a13f83711e8a007e8c2 (patch) | |
tree | bdc13f756d5142012a9497765e15df65d61c9ddd /xs/src/slic3r/GUI/PresetBundle.cpp | |
parent | ac9db81820af7b531ea548cc8f8f2b149a87db08 (diff) |
Purging volume parameters normalization - minor changes
Diffstat (limited to 'xs/src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r-- | xs/src/slic3r/GUI/PresetBundle.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/xs/src/slic3r/GUI/PresetBundle.cpp b/xs/src/slic3r/GUI/PresetBundle.cpp index d26a007bb..1d4795832 100644 --- a/xs/src/slic3r/GUI/PresetBundle.cpp +++ b/xs/src/slic3r/GUI/PresetBundle.cpp @@ -721,22 +721,21 @@ void PresetBundle::update_multi_material_filament_presets() this->filament_presets.resize(num_extruders, this->filament_presets.empty() ? this->filaments.first_visible().name : this->filament_presets.back()); - // Now verify if wiping_volumes_matrix has proper size (it is used to deduce number of extruders in wipe tower generator): std::vector<double> old_matrix = (prints.get_edited_preset().config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values; size_t old_number_of_extruders = int(sqrt(old_matrix.size())+EPSILON); - // First do it for the extruders presets (in-place): + if (num_extruders != old_number_of_extruders) { + // First verify if purging volumes presets for each extruder matches number of extruders std::vector<double>& extruders = (prints.get_edited_preset().config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values; while (extruders.size() < 2*num_extruders) { - extruders.push_back(extruders[0]); // copy the values from the first extruder - extruders.push_back(extruders[1]); + extruders.push_back(extruders.size()>1 ? extruders[0] : 50.); // copy the values from the first extruder + extruders.push_back(extruders.size()>1 ? extruders[1] : 50.); } while (extruders.size() > 2*num_extruders) { extruders.pop_back(); extruders.pop_back(); } - // Now update the purging volume matrix: - if (num_extruders != old_number_of_extruders) { + std::vector<double> new_matrix; for (unsigned int i=0;i<num_extruders;++i) for (unsigned int j=0;j<num_extruders;++j) { |