NEW: set bed type when printing

Change-Id: I94b32e6264ecae4a8a6ca20eed0d08d13c6e391d
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-03-12 18:02:33 +08:00 committed by Lane.Wei
parent 34ec55db80
commit f3aa76e4c2
4 changed files with 16 additions and 3 deletions

View file

@ -133,7 +133,7 @@ void PartPlate::init()
m_print = nullptr;
}
BedType PartPlate::get_bed_type() const
BedType PartPlate::get_bed_type(bool load_from_project) const
{
std::string bed_type_key = "curr_bed_type";
@ -144,6 +144,12 @@ BedType PartPlate::get_bed_type() const
return bed_type;
}
if (!load_from_project || !wxGetApp().preset_bundle)
return btDefault;
DynamicConfig& proj_cfg = wxGetApp().preset_bundle->project_config;
if (proj_cfg.has(bed_type_key))
return proj_cfg.opt_enum<BedType>(bed_type_key);
return btDefault;
}