From f2060935fc3cf20b5a1c3ab4fdb3bb0de67ea6cf Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Thu, 9 Jan 2025 19:56:55 +0800 Subject: [PATCH] FIX: enable set nozzle while it is unknown jira: [STUDIO-9678] Change-Id: I23014402ac796d68f77475c512ab06fc249c2a8a --- src/slic3r/GUI/PrintOptionsDialog.cpp | 67 +++++++++++++++------------ 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/src/slic3r/GUI/PrintOptionsDialog.cpp b/src/slic3r/GUI/PrintOptionsDialog.cpp index 95b43ba1f..0d93aee39 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.cpp +++ b/src/slic3r/GUI/PrintOptionsDialog.cpp @@ -861,32 +861,35 @@ bool PrinterPartsDialog::Show(bool show) auto diameter = obj->m_extder_data.extders[DEPUTY_NOZZLE_ID].current_nozzle_diameter; auto flow_type = obj->m_extder_data.extders[DEPUTY_NOZZLE_ID].current_nozzle_flow_type; + multiple_left_nozzle_type_checkbox->Enable(); + multiple_left_nozzle_diameter_checkbox->Enable(); + multiple_left_nozzle_flow_checkbox->Enable(); + multiple_left_nozzle_diameter_checkbox->Clear(); - if (type == NozzleType::ntUndefine) { + if (type == NozzleType::ntUndefine) + { multiple_left_nozzle_type_checkbox->SetValue(wxEmptyString); multiple_left_nozzle_diameter_checkbox->SetValue(wxEmptyString); multiple_left_nozzle_flow_checkbox->SetValue(wxEmptyString); - - multiple_left_nozzle_type_checkbox->Disable(); - multiple_left_nozzle_diameter_checkbox->Disable(); - multiple_left_nozzle_flow_checkbox->Disable(); - return DPIDialog::Show(show); - } else { - multiple_left_nozzle_type_checkbox->Enable(); - multiple_left_nozzle_diameter_checkbox->Enable(); - multiple_left_nozzle_flow_checkbox->Enable(); - + } + else + { std::map diameter_map; - if (type == NozzleType::ntHardenedSteel) { + if (type == NozzleType::ntHardenedSteel) + { diameter_map = nozzle_hard_diameter_map; - } else if (type == NozzleType::ntStainlessSteel) { + } + else if (type == NozzleType::ntStainlessSteel) + { diameter_map = nozzle_stainless_diameter_map; } - for (int i = 0; i < diameter_map.size(); i++) { + for (int i = 0; i < diameter_map.size(); i++) + { multiple_left_nozzle_diameter_checkbox->Append(wxString::Format(_L("%.1f"), diameter_map[i])); - if (diameter == diameter_map[i]) { + if (diameter == diameter_map[i]) + { multiple_left_nozzle_diameter_checkbox->SetSelection(i); } } @@ -902,30 +905,33 @@ bool PrinterPartsDialog::Show(bool show) multiple_right_nozzle_diameter_checkbox->Clear(); - if (type == NozzleType::ntUndefine) { + multiple_right_nozzle_type_checkbox->Enable(); + multiple_right_nozzle_diameter_checkbox->Enable(); + multiple_right_nozzle_flow_checkbox->Enable(); + + if (type == NozzleType::ntUndefine) + { multiple_right_nozzle_type_checkbox->SetValue(wxEmptyString); multiple_right_nozzle_diameter_checkbox->SetValue(wxEmptyString); multiple_right_nozzle_flow_checkbox->SetValue(wxEmptyString); - - multiple_right_nozzle_type_checkbox->Disable(); - multiple_right_nozzle_diameter_checkbox->Disable(); - multiple_right_nozzle_flow_checkbox->Disable(); - return DPIDialog::Show(show); - } else { - multiple_right_nozzle_type_checkbox->Enable(); - multiple_right_nozzle_diameter_checkbox->Enable(); - multiple_right_nozzle_flow_checkbox->Enable(); - + } + else + { std::map diameter_map; - if (type == NozzleType::ntHardenedSteel) { + if (type == NozzleType::ntHardenedSteel) + { diameter_map = nozzle_hard_diameter_map; - } else if (type == NozzleType::ntStainlessSteel) { + } + else if (type == NozzleType::ntStainlessSteel) + { diameter_map = nozzle_stainless_diameter_map; } - for (int i = 0; i < diameter_map.size(); i++) { + for (int i = 0; i < diameter_map.size(); i++) + { multiple_right_nozzle_diameter_checkbox->Append(wxString::Format(_L("%.1f"), diameter_map[i])); - if (diameter == diameter_map[i]) { + if (diameter == diameter_map[i]) + { multiple_right_nozzle_diameter_checkbox->SetSelection(i); } } @@ -934,6 +940,7 @@ bool PrinterPartsDialog::Show(bool show) if (flow_type != NozzleFlowType::NONE_FLOWTYPE) { multiple_right_nozzle_flow_checkbox->SetSelection(nozzle_flow_selection_map[flow_type]); }; } } + Layout(); Fit(); }