mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
ConfigWizard: Select an appropriate printer based on the bundle order
This commit is contained in:
parent
c8815041e2
commit
fb0836b0b2
6 changed files with 57 additions and 21 deletions
|
@ -1330,4 +1330,15 @@ const Preset& PrinterPresetCollection::default_preset_for(const DynamicPrintConf
|
|||
return this->default_preset((opt_printer_technology == nullptr || opt_printer_technology->value == ptFFF) ? 0 : 1);
|
||||
}
|
||||
|
||||
const Preset* PrinterPresetCollection::find_by_model_id(const std::string &model_id) const
|
||||
{
|
||||
if (model_id.empty()) { return nullptr; }
|
||||
|
||||
const auto it = std::find_if(cbegin(), cend(), [&](const Preset &preset) {
|
||||
return preset.config.opt_string("printer_model") == model_id;
|
||||
});
|
||||
|
||||
return it != cend() ? &*it : nullptr;
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue