From 4558e3d3e7f3dc4d9063d06bad27dbab76203a64 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Thu, 26 Dec 2024 14:51:48 +0800 Subject: [PATCH] FIX: printer diameter select & param extruder sync Change-Id: I4f2cff974cea24d599b7870d6a82d44d718e8a2e Jira: STUDIO-9110 --- src/slic3r/GUI/Plater.cpp | 26 +++++++++++--------------- src/slic3r/GUI/Tab.cpp | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 49c7424fc..0f2c83a61 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -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(dynamic_cast(evt.GetEventObject())->GetParent()); auto result = p->switch_diameter(extruder == p->single_extruder); if (result) { - extruder->combo_diameter->SetSelection(evt.GetInt()); - extruder->diameter = evt.GetString(); + if (extruder != p->single_extruder) { + extruder->combo_diameter->SetSelection(evt.GetInt()); + extruder->diameter = evt.GetString(); + } } else { extruder->combo_diameter->SetValue(extruder->diameter); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index bbd93faf5..759f71c0e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -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();