mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 00:22:00 +08:00
Check of compatibilities for support_head_penetration<->support_head_width and
support_head_front_diameter<->support_pillar_diameter is moved to sla_print.validation()
This commit is contained in:
parent
78995013be
commit
a3bb0265b0
@ -664,6 +664,27 @@ std::string SLAPrint::validate(std::vector<std::string>*) const
|
||||
if (iexpt_cur < iexpt_min || iexpt_cur > iexpt_max)
|
||||
return _u8L("Initial exposition time is out of printer profile bounds.");
|
||||
|
||||
for (const std::string& prefix : { "", "branching" }) {
|
||||
|
||||
double head_penetration = m_full_print_config.opt_float(prefix + "support_head_penetration");
|
||||
double head_width = m_full_print_config.opt_float(prefix + "support_head_width");
|
||||
|
||||
if (head_penetration > head_width) {
|
||||
return _u8L("Invalid Head penetration") + "\n" +
|
||||
_u8L("Head penetration should not be greater than the head width.") + "\n" +
|
||||
_u8L("Please check value of head penetration in print settings or material overrides.");
|
||||
}
|
||||
|
||||
double pinhead_d = m_full_print_config.opt_float(prefix + "support_head_front_diameter");
|
||||
double pillar_d = m_full_print_config.opt_float(prefix + "support_pillar_diameter");
|
||||
|
||||
if (pinhead_d > pillar_d) {
|
||||
return _u8L("Invalid pinhead diameter") + "\n" +
|
||||
_u8L("Pinhead front diameter should be smaller than the pillar diameter.") +
|
||||
_u8L("Please check value of pinhead front diameter in print settings or material overrides.");
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -347,36 +347,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
|
||||
toggle_field("thin_walls", !have_arachne);
|
||||
}
|
||||
|
||||
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)
|
||||
{
|
||||
double head_penetration = config->opt_float("support_head_penetration");
|
||||
double head_width = config->opt_float("support_head_width");
|
||||
if (head_penetration > head_width) {
|
||||
wxString msg_text = _(L("Head penetration should not be greater than the head width."));
|
||||
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, _(L("Invalid Head penetration")), wxICON_WARNING | wxOK);
|
||||
DynamicPrintConfig new_conf = *config;
|
||||
if (dialog.ShowModal() == wxID_OK) {
|
||||
new_conf.set_key_value("support_head_penetration", new ConfigOptionFloat(head_width));
|
||||
apply(config, &new_conf);
|
||||
}
|
||||
}
|
||||
|
||||
double pinhead_d = config->opt_float("support_head_front_diameter");
|
||||
double pillar_d = config->opt_float("support_pillar_diameter");
|
||||
if (pinhead_d > pillar_d) {
|
||||
wxString msg_text = _(L("Pinhead diameter should be smaller than the pillar diameter."));
|
||||
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, _(L("Invalid pinhead diameter")), wxICON_WARNING | wxOK);
|
||||
|
||||
DynamicPrintConfig new_conf = *config;
|
||||
if (dialog.ShowModal() == wxID_OK) {
|
||||
new_conf.set_key_value("support_head_front_diameter", new ConfigOptionFloat(pillar_d / 2.0));
|
||||
apply(config, &new_conf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::toggle_print_sla_options(DynamicPrintConfig* config)
|
||||
{
|
||||
bool supports_en = config->opt_bool("supports_enable");
|
||||
|
@ -63,7 +63,6 @@ public:
|
||||
void toggle_print_fff_options(DynamicPrintConfig* config);
|
||||
|
||||
// SLA print
|
||||
void update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config = false);
|
||||
void toggle_print_sla_options(DynamicPrintConfig* config);
|
||||
|
||||
bool is_initialized_support_material_overhangs_queried() { return m_is_initialized_support_material_overhangs_queried; }
|
||||
|
@ -261,8 +261,8 @@ void ObjectSettings::update_config_values(ModelConfig* config)
|
||||
}
|
||||
|
||||
main_config.apply(config->get(), true);
|
||||
printer_technology == ptFFF ? config_manipulation.update_print_fff_config(&main_config) :
|
||||
config_manipulation.update_print_sla_config(&main_config) ;
|
||||
if (printer_technology == ptFFF)
|
||||
config_manipulation.update_print_fff_config(&main_config);
|
||||
|
||||
printer_technology == ptFFF ? config_manipulation.toggle_print_fff_options(&main_config) :
|
||||
config_manipulation.toggle_print_sla_options(&main_config) ;
|
||||
|
@ -5403,6 +5403,8 @@ void TabSLAMaterial::update()
|
||||
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptFFF)
|
||||
return;
|
||||
|
||||
toggle_options();
|
||||
|
||||
update_description_lines();
|
||||
Layout();
|
||||
|
||||
@ -5518,7 +5520,7 @@ void TabSLAMaterial::create_line_with_near_label_widget(ConfigOptionsGroupShp op
|
||||
wxWindow* check_box = CheckBox::GetNewWin(parent);
|
||||
wxGetApp().UpdateDarkUI(check_box);
|
||||
|
||||
check_box->Bind(wxEVT_CHECKBOX, [optgroup_wk, key](wxCommandEvent& evt) {
|
||||
check_box->Bind(wxEVT_CHECKBOX, [this, optgroup_wk, key](wxCommandEvent& evt) {
|
||||
const bool is_checked = evt.IsChecked();
|
||||
if (auto optgroup_sh = optgroup_wk.lock(); optgroup_sh) {
|
||||
auto opt_keys = get_override_opt_kyes_for_line(optgroup_sh->title.ToStdString(), key);
|
||||
@ -5531,6 +5533,8 @@ void TabSLAMaterial::create_line_with_near_label_widget(ConfigOptionsGroupShp op
|
||||
field->set_na_value();
|
||||
}
|
||||
}
|
||||
|
||||
toggle_options();
|
||||
});
|
||||
|
||||
m_overrides_options[key] = check_box;
|
||||
@ -5598,8 +5602,6 @@ void TabSLAMaterial::update_line_with_near_label_widget(ConfigOptionsGroupShp op
|
||||
opt_keys.push_back(opt_key);
|
||||
}
|
||||
|
||||
// m_overrides_options[key]->Enable(is_checked);
|
||||
|
||||
CheckBox::SetValue(m_overrides_options[key], is_checked);
|
||||
|
||||
for (const std::string& opt_key : opt_keys) {
|
||||
@ -5736,8 +5738,6 @@ void TabSLAPrint::update()
|
||||
|
||||
m_update_cnt++;
|
||||
|
||||
m_config_manipulation.update_print_sla_config(m_config, true);
|
||||
|
||||
update_description_lines();
|
||||
Layout();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user