dynamic list

This commit is contained in:
SoftFever 2024-07-07 00:11:37 +08:00
parent c2320e03a5
commit 8ff7b0fac2
3 changed files with 72 additions and 11 deletions

View file

@ -1431,9 +1431,16 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
m_config->set_key_value("pellet_flow_coefficient", new ConfigOptionFloats{double_value});
}
auto bSEMM = m_config->opt_bool("single_extruder_multi_material");
if (opt_key == "single_extruder_multi_material" ){
wxGetApp().sidebar().show_add_del_filament_button(bSEMM);
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
}
if(opt_key == "purge_in_prime_tower")
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
if (opt_key == "single_extruder_multi_material" )
wxGetApp().sidebar().show_add_del_filament_button(m_config->opt_bool("single_extruder_multi_material"));
if (opt_key == "enable_prime_tower") {
auto timelapse_type = m_config->option<ConfigOptionEnum<TimelapseType>>("timelapse_type");
@ -1647,7 +1654,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
//Orca: sync filament num if it's a multi tool printer
if (opt_key == "extruders_count" && !m_config->opt_bool("single_extruder_multi_material")){
if (opt_key == "extruders_count" && !bSEMM){
auto num_extruder = boost::any_cast<size_t>(value);
wxColour new_col = Plater::get_next_color_for_filament();
std::string new_color = new_col.GetAsString(wxC2S_HTML_SYNTAX).ToStdString();