revert changes for min_layer_height check, there was legacy config on user's machine that won't pass this check. (why?)

This commit is contained in:
SoftFever 2022-12-20 11:41:11 +08:00
parent 49982a4497
commit 1eb54c49a6

View file

@ -174,15 +174,14 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
// layer_height shouldn't be equal to zero // layer_height shouldn't be equal to zero
auto gpreset = GUI::wxGetApp().preset_bundle->printers.get_edited_preset(); auto gpreset = GUI::wxGetApp().preset_bundle->printers.get_edited_preset();
auto min_lh = gpreset.config.opt_float("min_layer_height",0); if (config->opt_float("layer_height") < EPSILON)
if (min_lh > 0 && config->opt_float("layer_height") < min_lh)
{ {
wxString msg_text = wxString::Format(L"Too small layer height.\nReset to %0.3f", min_lh); const wxString msg_text = _(L("Too small layer height.\nReset to 0.2"));
MessageDialog dialog(m_msg_dlg_parent, msg_text,"", wxICON_WARNING | wxOK); MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
DynamicPrintConfig new_conf = *config; DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true; is_msg_dlg_already_exist = true;
dialog.ShowModal(); dialog.ShowModal();
new_conf.set_key_value("layer_height", new ConfigOptionFloat(min_lh)); new_conf.set_key_value("layer_height", new ConfigOptionFloat(0.2));
apply(config, &new_conf); apply(config, &new_conf);
is_msg_dlg_already_exist = false; is_msg_dlg_already_exist = false;
} }