mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 19:17:33 +00:00
FIX: printer diameter select & param extruder sync
Change-Id: I4f2cff974cea24d599b7870d6a82d44d718e8a2e Jira: STUDIO-9110 (cherry picked from commit 4558e3d3e7f3dc4d9063d06bad27dbab76203a64)
This commit is contained in:
@@ -1165,18 +1165,6 @@ void ExtruderGroup::sync_ams(MachineObject const *obj, std::vector<Ams *> const
|
|||||||
update_ams();
|
update_ams();
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
bool Sidebar::priv::switch_diameter(bool single)
|
||||||
{
|
{
|
||||||
wxString diameter;
|
wxString diameter;
|
||||||
@@ -1186,7 +1174,13 @@ bool Sidebar::priv::switch_diameter(bool single)
|
|||||||
auto diameter_left = left_extruder->combo_diameter->GetValue();
|
auto diameter_left = left_extruder->combo_diameter->GetValue();
|
||||||
auto diameter_right = right_extruder->combo_diameter->GetValue();
|
auto diameter_right = right_extruder->combo_diameter->GetValue();
|
||||||
if (diameter_left != diameter_right) {
|
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();
|
int result = dlg.ShowModal();
|
||||||
if (result == wxID_YES)
|
if (result == wxID_YES)
|
||||||
diameter = diameter_left;
|
diameter = diameter_left;
|
||||||
@@ -1756,8 +1750,10 @@ Sidebar::Sidebar(Plater *parent)
|
|||||||
auto extruder = dynamic_cast<ExtruderGroup *>(dynamic_cast<ComboBox *>(evt.GetEventObject())->GetParent());
|
auto extruder = dynamic_cast<ExtruderGroup *>(dynamic_cast<ComboBox *>(evt.GetEventObject())->GetParent());
|
||||||
auto result = p->switch_diameter(extruder == p->single_extruder);
|
auto result = p->switch_diameter(extruder == p->single_extruder);
|
||||||
if (result) {
|
if (result) {
|
||||||
extruder->combo_diameter->SetSelection(evt.GetInt());
|
if (extruder != p->single_extruder) {
|
||||||
extruder->diameter = evt.GetString();
|
extruder->combo_diameter->SetSelection(evt.GetInt());
|
||||||
|
extruder->diameter = evt.GetString();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
extruder->combo_diameter->SetValue(extruder->diameter);
|
extruder->combo_diameter->SetValue(extruder->diameter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user