FIX: printer diameter select & param extruder sync

Change-Id: I4f2cff974cea24d599b7870d6a82d44d718e8a2e
Jira: STUDIO-9110
This commit is contained in:
chunmao.guo 2024-12-26 14:51:48 +08:00 committed by lane.wei
parent 1fe49fb2d1
commit 4558e3d3e7
2 changed files with 12 additions and 16 deletions

View File

@ -1053,18 +1053,6 @@ void ExtruderGroup::update_ams()
GUI::wxGetApp().plater()->update_machine_sync_status();
}
struct DiameterMessageDialog : MessageDialog
{
DiameterMessageDialog(wxWindow * parent, wxString diameter_left, wxString diameter_right)
: MessageDialog(parent, _L("The software does not support using different diameter of nozzles for one print. "
"If the left and right nozzles are inconsistent, we can only proceed with single-head printing. "
"Please confirm which nozzle you would like to use for this project."), _L("Switch diameter"), wxYES_NO | wxNO_DEFAULT)
{
add_button(wxID_YES, false, wxString::Format(_L("Left nozzle: %smm"), diameter_left));
add_button(wxID_NO, true, wxString::Format(_L("Right nozzle: %smm"), diameter_right));
}
};
bool Sidebar::priv::switch_diameter(bool single)
{
wxString diameter;
@ -1074,7 +1062,13 @@ bool Sidebar::priv::switch_diameter(bool single)
auto diameter_left = left_extruder->combo_diameter->GetValue();
auto diameter_right = right_extruder->combo_diameter->GetValue();
if (diameter_left != diameter_right) {
DiameterMessageDialog dlg(this->plater, diameter_left, diameter_right);
MessageDialog dlg(this->plater,
_L("The software does not support using different diameter of nozzles for one print. "
"If the left and right nozzles are inconsistent, we can only proceed with single-head printing. "
"Please confirm which nozzle you would like to use for this project."),
_L("Switch diameter"), wxYES_NO | wxNO_DEFAULT);
dlg.SetButtonLabel(wxID_YES, wxString::Format(_L("Left nozzle: %smm"), diameter_left));
dlg.SetButtonLabel(wxID_NO, wxString::Format(_L("Right nozzle: %smm"), diameter_right));
int result = dlg.ShowModal();
if (result == wxID_YES)
diameter = diameter_left;
@ -1560,8 +1554,10 @@ Sidebar::Sidebar(Plater *parent)
auto extruder = dynamic_cast<ExtruderGroup *>(dynamic_cast<ComboBox *>(evt.GetEventObject())->GetParent());
auto result = p->switch_diameter(extruder == p->single_extruder);
if (result) {
if (extruder != p->single_extruder) {
extruder->combo_diameter->SetSelection(evt.GetInt());
extruder->diameter = evt.GetString();
}
} else {
extruder->combo_diameter->SetValue(extruder->diameter);
}

View File

@ -6122,7 +6122,7 @@ void Tab::sync_excluder()
}
reload_config();
update_changed_ui();
toggle_options();
update();
if (m_active_page)
m_active_page->update_visibility(m_mode, true);
m_page_view->GetParent()->Layout();