mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 02:16:02 +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) {
|
if (printer) {
|
||||||
materials.add_printer(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;
|
Technology technology;
|
||||||
// use vector for the presets to purpose of save of presets sorting in the bundle
|
// use vector for the presets to purpose of save of presets sorting in the bundle
|
||||||
std::vector<const Preset*> presets;
|
std::vector<const Preset*> presets;
|
||||||
// String is alias of material, size_t number of compatible printers counters
|
// String is alias of material, set is set of compatible printers
|
||||||
std::map<std::string, size_t> compatibility_counter;
|
std::map<std::string, std::set<const Preset*>> compatibility_counter;
|
||||||
std::set<std::string> types;
|
std::set<std::string> types;
|
||||||
std::set<const Preset*> printers;
|
std::set<const Preset*> printers;
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ struct Materials
|
|||||||
size_t get_printer_counter(const Preset* preset) {
|
size_t get_printer_counter(const Preset* preset) {
|
||||||
for (auto it : compatibility_counter) {
|
for (auto it : compatibility_counter) {
|
||||||
if (it.first == preset->alias)
|
if (it.first == preset->alias)
|
||||||
return it.second;
|
return it.second.size();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user