mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 02:08:59 +08:00
Follow-up bc5b24e3ad : ConfigWizard: Fixed compatible printer counter for materials
This commit is contained in:
parent
0e1a0e856f
commit
3d438ea93a
@ -2603,7 +2603,7 @@ void ConfigWizard::priv::update_materials(Technology technology)
|
||||
}
|
||||
if (printer) {
|
||||
materials.add_printer(printer);
|
||||
materials.compatibility_counter[preset.alias]++;
|
||||
materials.compatibility_counter[preset.alias].insert(printer);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -323,8 +323,8 @@ struct Materials
|
||||
Technology technology;
|
||||
// use vector for the presets to purpose of save of presets sorting in the bundle
|
||||
std::vector<const Preset*> presets;
|
||||
// String is alias of material, size_t number of compatible printers counters
|
||||
std::map<std::string, size_t> compatibility_counter;
|
||||
// String is alias of material, set is set of compatible printers
|
||||
std::map<std::string, std::set<const Preset*>> compatibility_counter;
|
||||
std::set<std::string> types;
|
||||
std::set<const Preset*> printers;
|
||||
|
||||
@ -358,7 +358,7 @@ struct Materials
|
||||
size_t get_printer_counter(const Preset* preset) {
|
||||
for (auto it : compatibility_counter) {
|
||||
if (it.first == preset->alias)
|
||||
return it.second;
|
||||
return it.second.size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user