Added "Filament spool weight" option to filament options

This commit is contained in:
YuSanka 2020-03-09 16:20:50 +01:00
parent e83fb4582c
commit 3d3e36ba8d
7 changed files with 58 additions and 3 deletions

View file

@ -1100,6 +1100,12 @@ void Tab::update_frequently_changed_parameters()
}
}
void Tab::update_sliced_info_on_plater()
{
wxGetApp().sidebar().update_sliced_info_sizer();
wxGetApp().sidebar().Layout();
}
void TabPrint::build()
{
m_presets = &m_preset_bundle->prints;
@ -1484,6 +1490,19 @@ void TabFilament::build()
optgroup->append_single_option_line("extrusion_multiplier");
optgroup->append_single_option_line("filament_density");
optgroup->append_single_option_line("filament_cost");
optgroup->append_single_option_line("filament_spool_weight");
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value)
{
update_dirty();
if (opt_key== "filament_spool_weight")
// Change of this option only has an influence to an update of "Sliced Info"
update_sliced_info_on_plater();
else
// update configuration for its check and to schedule a background process, if needed
update();
};
optgroup = page->new_optgroup(_(L("Temperature")) + wxString(" °C", wxConvUTF8));
Line line = { _(L("Extruder")), "" };
@ -3567,8 +3586,7 @@ void TabSLAMaterial::build()
update_dirty();
// Change of any from those options influences for an update of "Sliced Info"
wxGetApp().sidebar().update_sliced_info_sizer();
wxGetApp().sidebar().Layout();
update_sliced_info_on_plater();
};
optgroup = page->new_optgroup(_(L("Layers")));