mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-27 18:09:48 -07:00
ENH: select first order variant for newly enabled printer_model
Change-Id: I841a15f908cb74e6bfa594e017349a967ab4cf0a Jira: STUDIO-10791 (cherry picked from commit f1365df997083a018a511e7581d73b4a4064601a)
This commit is contained in:
parent
adf85c5080
commit
8de11c2f01
1 changed files with 8 additions and 0 deletions
|
|
@ -776,11 +776,19 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle
|
|||
if (config == enabled_vendors.end())
|
||||
return std::string();
|
||||
|
||||
const VendorProfile & printer_profile = preset_bundle->vendors[bundle_name];
|
||||
const std::map<std::string, std::set<std::string>>& model_maps = config->second;
|
||||
//for (const auto& vendor_profile : preset_bundle->vendors) {
|
||||
for (const auto& model_it: model_maps) {
|
||||
if (model_it.second.size() > 0) {
|
||||
variant = *model_it.second.begin();
|
||||
if (model_it.second.size() > 1) {
|
||||
const VendorProfile::PrinterModel &printer_model = *std::find_if(printer_profile.models.begin(), printer_profile.models.end(),
|
||||
[id = model_it.first](auto &m) { return m.id == id; });
|
||||
for (auto &vt : printer_model.variants) {
|
||||
if (std::find(model_it.second.begin(), model_it.second.end(), vt.name) != model_it.second.end()) { variant = vt.name; break; }
|
||||
}
|
||||
}
|
||||
const auto config_old = old_enabled_vendors.find(bundle_name);
|
||||
if (config_old == old_enabled_vendors.end())
|
||||
return model_it.first;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue