From 285c237095207ff4ce666ec8e449102d11e5a22d Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Wed, 16 Apr 2025 12:22:55 +0800 Subject: [PATCH] ENH: remove nozzle setting jira: [STUDIO-11598] Change-Id: Ia10fc3bd67b61a28480b38eef0c28a088c10135e (cherry picked from commit 9b585239f7137c43cbd766540e93401dbe5e82e4) --- resources/printers/BL-P001.json | 2 +- resources/printers/BL-P002.json | 2 +- resources/printers/C11.json | 2 +- resources/printers/C12.json | 2 +- resources/printers/C13.json | 2 +- resources/printers/N1.json | 2 +- resources/printers/N2S.json | 2 +- resources/printers/version.txt | 2 +- src/slic3r/GUI/PrintOptionsDialog.cpp | 285 ++++---------------------- src/slic3r/GUI/PrintOptionsDialog.hpp | 25 +-- 10 files changed, 47 insertions(+), 279 deletions(-) diff --git a/resources/printers/BL-P001.json b/resources/printers/BL-P001.json index 227d5f4925..3f2af4ac59 100644 --- a/resources/printers/BL-P001.json +++ b/resources/printers/BL-P001.json @@ -56,7 +56,7 @@ "printer_series": "series_x1", "has_cali_line": true, "printer_is_enclosed": true, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.01.01.00": { "print": { diff --git a/resources/printers/BL-P002.json b/resources/printers/BL-P002.json index f95effc2b7..cd24ba4cc1 100644 --- a/resources/printers/BL-P002.json +++ b/resources/printers/BL-P002.json @@ -56,7 +56,7 @@ "printer_series": "series_x1", "has_cali_line": true, "printer_is_enclosed": true, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.01.01.00": { "print": { diff --git a/resources/printers/C11.json b/resources/printers/C11.json index b62abdf677..ca1a059cd4 100644 --- a/resources/printers/C11.json +++ b/resources/printers/C11.json @@ -52,7 +52,7 @@ "printer_series": "series_p1p", "has_cali_line": false, "printer_is_enclosed": false, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.02.00.00": { "print": { diff --git a/resources/printers/C12.json b/resources/printers/C12.json index 1320aca2c7..91affce172 100644 --- a/resources/printers/C12.json +++ b/resources/printers/C12.json @@ -52,7 +52,7 @@ "printer_series": "series_p1p", "has_cali_line": false, "printer_is_enclosed": true, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.02.99.10": { "print": { diff --git a/resources/printers/C13.json b/resources/printers/C13.json index 29450f5420..31c87d0535 100644 --- a/resources/printers/C13.json +++ b/resources/printers/C13.json @@ -60,7 +60,7 @@ "printer_series": "series_x1", "has_cali_line": true, "printer_is_enclosed": true, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.05.06.06": { "rv2166": "00.00.21.20" diff --git a/resources/printers/N1.json b/resources/printers/N1.json index 86089b2a42..93f36f6500 100644 --- a/resources/printers/N1.json +++ b/resources/printers/N1.json @@ -52,7 +52,7 @@ "printer_series": "series_n", "has_cali_line": false, "printer_is_enclosed": false, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.01.50.01": { "print": { diff --git a/resources/printers/N2S.json b/resources/printers/N2S.json index 4bf5d67dcf..eb85486648 100644 --- a/resources/printers/N2S.json +++ b/resources/printers/N2S.json @@ -52,7 +52,7 @@ "printer_series": "series_n", "has_cali_line": false, "printer_is_enclosed": false, - "enable_set_nozzle_info": true + "enable_set_nozzle_info": false }, "01.01.50.01": { "print": { diff --git a/resources/printers/version.txt b/resources/printers/version.txt index db694704bf..c35126eed8 100644 --- a/resources/printers/version.txt +++ b/resources/printers/version.txt @@ -1 +1 @@ -02.00.00.13 \ No newline at end of file +02.00.00.14 \ No newline at end of file diff --git a/src/slic3r/GUI/PrintOptionsDialog.cpp b/src/slic3r/GUI/PrintOptionsDialog.cpp index d6fe58f796..1a9368742b 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.cpp +++ b/src/slic3r/GUI/PrintOptionsDialog.cpp @@ -558,25 +558,6 @@ bool PrintOptionsDialog::Show(bool show) PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) : DPIDialog(parent, wxID_ANY, _L("Printer Parts"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) { - nozzle_type_map[NozzleType::ntHardenedSteel] = _L("Hardened Steel"); - nozzle_type_map[NozzleType::ntStainlessSteel] = _L("Stainless Steel"); - - nozzle_flow_map[NozzleFlowType::S_FLOW] = _L("Standard"); - nozzle_flow_map[NozzleFlowType::H_FLOW] = _L("High flow"); - - nozzle_type_selection_map[NozzleType::ntHardenedSteel] = 0; - nozzle_type_selection_map[NozzleType::ntStainlessSteel] = 1; - - nozzle_flow_selection_map[NozzleFlowType::S_FLOW] = 0; - nozzle_flow_selection_map[NozzleFlowType::H_FLOW] = 1; - - nozzle_stainless_diameter_map[0] = 0.2; - nozzle_stainless_diameter_map[1] = 0.4; - - nozzle_hard_diameter_map[0] = 0.4; - nozzle_hard_diameter_map[1] = 0.6; - nozzle_hard_diameter_map[2] = 0.8; - SetBackgroundColour(*wxWHITE); wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); @@ -603,20 +584,7 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) nozzle_type->SetForegroundColour(STATIC_TEXT_CAPTION_COL); nozzle_type->Wrap(-1); - ID_NOZZLE_TYPE_CHECKBOX_SINGLE = wxNewId(); - ID_NOZZLE_TYPE_CHECKBOX_LEFT = wxNewId(); - ID_NOZZLE_TYPE_CHECKBOX_RIGHT = wxNewId(); - ID_NOZZLE_DIAMETER_CHECKBOX_SINGLE = wxNewId(); - ID_NOZZLE_DIAMETER_CHECKBOX_LEFT = wxNewId(); - ID_NOZZLE_DIAMETER_CHECKBOX_RIGHT = wxNewId(); - ID_NOZZLE_FLOW_CHECKBOX_LEFT = wxNewId(); - ID_NOZZLE_FLOW_CHECKBOX_RIGHT = wxNewId(); - nozzle_type_checkbox = new ComboBox(single_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(180), -1), 0, NULL, wxCB_READONLY); - nozzle_type_checkbox->Append(nozzle_type_map[NozzleType::ntHardenedSteel]); - nozzle_type_checkbox->Append(nozzle_type_map[NozzleType::ntStainlessSteel]); - nozzle_type_checkbox->SetSelection(0); - line_sizer_nozzle_type->Add(nozzle_type, 0, wxALIGN_CENTER, 5); line_sizer_nozzle_type->Add(0, 0, 1, wxEXPAND, 5); @@ -667,9 +635,6 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) multiple_left_nozzle_type->SetForegroundColour(STATIC_TEXT_CAPTION_COL); multiple_left_nozzle_type_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(180), -1), 0, NULL, wxCB_READONLY); - multiple_left_nozzle_type_checkbox->Append(nozzle_type_map[NozzleType::ntHardenedSteel]); - multiple_left_nozzle_type_checkbox->Append(nozzle_type_map[NozzleType::ntStainlessSteel]); - multiple_left_nozzle_type_checkbox->SetSelection(0); auto multiple_left_nozzle_diameter = new Label(multiple_panel, _L("Nozzle Diameter")); multiple_left_nozzle_diameter->SetFont(Label::Body_14); @@ -680,8 +645,6 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) multiple_left_nozzle_flow->SetFont(Label::Body_14); multiple_left_nozzle_flow->SetForegroundColour(STATIC_TEXT_CAPTION_COL); multiple_left_nozzle_flow_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(140), -1), 0, NULL, wxCB_READONLY); - multiple_left_nozzle_flow_checkbox->Append(nozzle_flow_map[NozzleFlowType::S_FLOW]); - multiple_left_nozzle_flow_checkbox->Append(nozzle_flow_map[NozzleFlowType::H_FLOW]); multiple_left_line_sizer->Add(multiple_left_nozzle_type, 0, wxALIGN_CENTER, 0); multiple_left_line_sizer->Add(0, 0, 0, wxLEFT, FromDIP(8)); @@ -705,10 +668,7 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) multiple_right_nozzle_type->SetFont(Label::Body_14); multiple_right_nozzle_type->SetForegroundColour(STATIC_TEXT_CAPTION_COL); - multiple_right_nozzle_type_checkbox = new ComboBox(multiple_panel, ID_NOZZLE_TYPE_CHECKBOX_RIGHT, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(180), -1), 0, NULL, wxCB_READONLY); - multiple_right_nozzle_type_checkbox->Append(nozzle_type_map[NozzleType::ntHardenedSteel]); - multiple_right_nozzle_type_checkbox->Append(nozzle_type_map[NozzleType::ntStainlessSteel]); - multiple_right_nozzle_type_checkbox->SetSelection(0); + multiple_right_nozzle_type_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(180), -1), 0, NULL, wxCB_READONLY); auto multiple_right_nozzle_diameter = new Label(multiple_panel, _L("Nozzle Diameter")); multiple_right_nozzle_diameter->SetFont(Label::Body_14); @@ -719,8 +679,6 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) multiple_right_nozzle_flow->SetFont(Label::Body_14); multiple_right_nozzle_flow->SetForegroundColour(STATIC_TEXT_CAPTION_COL); multiple_right_nozzle_flow_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(140), -1), 0, NULL, wxCB_READONLY); - multiple_right_nozzle_flow_checkbox->Append(nozzle_flow_map[NozzleFlowType::S_FLOW]); - multiple_right_nozzle_flow_checkbox->Append(nozzle_flow_map[NozzleFlowType::H_FLOW]); multiple_right_line_sizer->Add(multiple_right_nozzle_type, 0, wxALIGN_CENTER, 0); multiple_right_line_sizer->Add(0, 0, 0, wxLEFT, FromDIP(8)); @@ -753,8 +711,6 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) multiple_panel->Fit(); /*inset data*/ - - sizer->Add(single_panel, 0, wxEXPAND, 0); sizer->Add(multiple_panel, 0, wxEXPAND, 0); SetSizer(sizer); @@ -764,123 +720,12 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent) single_panel->Hide(); wxGetApp().UpdateDlgDarkUI(this); - - nozzle_type_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - nozzle_diameter_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - - multiple_left_nozzle_type_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_left_nozzle_diameter_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_left_nozzle_flow_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - - multiple_right_nozzle_type_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_right_nozzle_diameter_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_right_nozzle_flow_checkbox->Connect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - - nozzle_type_checkbox->SetId(ID_NOZZLE_TYPE_CHECKBOX_SINGLE); - multiple_left_nozzle_type_checkbox->SetId(ID_NOZZLE_TYPE_CHECKBOX_LEFT); - multiple_right_nozzle_type_checkbox->SetId(ID_NOZZLE_TYPE_CHECKBOX_RIGHT); - - nozzle_diameter_checkbox->SetId(ID_NOZZLE_DIAMETER_CHECKBOX_SINGLE); - multiple_left_nozzle_diameter_checkbox->SetId(ID_NOZZLE_DIAMETER_CHECKBOX_LEFT); - multiple_right_nozzle_diameter_checkbox->SetId(ID_NOZZLE_DIAMETER_CHECKBOX_RIGHT); - - multiple_left_nozzle_flow_checkbox->SetId(ID_NOZZLE_FLOW_CHECKBOX_LEFT); - multiple_right_nozzle_flow_checkbox->SetId(ID_NOZZLE_FLOW_CHECKBOX_RIGHT); } -PrinterPartsDialog::~PrinterPartsDialog() -{ - nozzle_type_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - nozzle_diameter_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_left_nozzle_type_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_left_nozzle_diameter_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_left_nozzle_flow_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - - multiple_right_nozzle_type_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_right_nozzle_diameter_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); - multiple_right_nozzle_flow_checkbox->Disconnect(wxEVT_COMBOBOX, wxCommandEventHandler(PrinterPartsDialog::set_nozzle_data), NULL, this); -} - -void PrinterPartsDialog::set_nozzle_data(wxCommandEvent& evt) -{ - ComboBox* current_nozzle_type_combox = nullptr; - ComboBox* current_nozzle_diameter_combox = nullptr; - - int nozzle_id = MAIN_NOZZLE_ID; - - if (evt.GetId() == ID_NOZZLE_TYPE_CHECKBOX_SINGLE || - evt.GetId() == ID_NOZZLE_DIAMETER_CHECKBOX_SINGLE) { - current_nozzle_type_combox = nozzle_type_checkbox; - current_nozzle_diameter_combox = nozzle_diameter_checkbox; - nozzle_id = MAIN_NOZZLE_ID; - } - - - if (obj) { - try { - auto nozzle_type = NozzleType::ntHardenedSteel; - auto nozzle_diameter = 0.4f; - auto nozzle_flow = NozzleFlowType::NONE_FLOWTYPE; - - for (auto sm : nozzle_type_selection_map) { - if (sm.second == current_nozzle_type_combox->GetSelection()) { - nozzle_type = sm.first; - } - } - - - /*update nozzle diameter*/ - if (evt.GetId() == ID_NOZZLE_TYPE_CHECKBOX_SINGLE) { - nozzle_diameter_checkbox->Clear(); - std::map diameter_map; - if (nozzle_type == NozzleType::ntHardenedSteel) { - diameter_map = nozzle_hard_diameter_map; - } else if (nozzle_type == NozzleType::ntStainlessSteel) { - diameter_map = nozzle_stainless_diameter_map; - } - - for (int i = 0; i < diameter_map.size(); i++) { nozzle_diameter_checkbox->Append(wxString::Format(_L("%.1f"), diameter_map[i])); } - nozzle_diameter_checkbox->SetSelection(0); - } - - nozzle_diameter = std::stof(current_nozzle_diameter_combox->GetStringSelection().ToStdString()); - nozzle_diameter = round(nozzle_diameter * 10) / 10; - - if (!obj->is_enable_np) { - obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_diameter = nozzle_diameter; - obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_type = nozzle_type; - obj->command_set_printer_nozzle(NozzleTypeEumnToStr[nozzle_type], nozzle_diameter); - } - } catch (...) {} - } -} - -void PrinterPartsDialog::on_dpi_changed(const wxRect& suggested_rect) -{ - Fit(); -} - -void PrinterPartsDialog::update_machine_obj(MachineObject* obj_) -{ - if (!obj_) - { - return; - } - obj = obj_; - - nozzle_stainless_diameter_map.clear(); - if (obj->is_series_o()) - { - /*STUDIO-10089 there are only 0.2 stainless nozzle in O series*/ - nozzle_stainless_diameter_map[0] = 0.2; - } - else - { - nozzle_stainless_diameter_map[0] = 0.2; - nozzle_stainless_diameter_map[1] = 0.4; - } -} +PrinterPartsDialog::~PrinterPartsDialog() {} +void PrinterPartsDialog::on_dpi_changed(const wxRect& suggested_rect) { Fit(); } +void PrinterPartsDialog::update_machine_obj(MachineObject* obj_) { if (obj_) { obj = obj_; }} bool PrinterPartsDialog::Show(bool show) { if (show) { @@ -888,7 +733,8 @@ bool PrinterPartsDialog::Show(bool show) CentreOnParent(); /*disable editing*/ - EnableEditing(DeviceManager::get_printer_can_set_nozzle(obj->printer_type)); + EnableEditing(false); + assert(DeviceManager::get_printer_can_set_nozzle(obj->printer_type) == false);/*editing is not supported*/ if (obj->m_extder_data.extders.size() <= 1) { single_panel->Show(); @@ -896,30 +742,8 @@ bool PrinterPartsDialog::Show(bool show) auto type = obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_type; auto diameter = obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_diameter; - - nozzle_diameter_checkbox->Clear(); - - if (type == NozzleType::ntUndefine) { - nozzle_type_checkbox->SetValue(wxEmptyString); - nozzle_diameter_checkbox->SetValue(wxEmptyString); - } else { - std::map diameter_map; - if (type == NozzleType::ntHardenedSteel) { - diameter_map = nozzle_hard_diameter_map; - } else if (type == NozzleType::ntStainlessSteel) { - diameter_map = nozzle_stainless_diameter_map; - } - - for (int i = 0; i < diameter_map.size(); i++) { - nozzle_diameter_checkbox->Append(wxString::Format(_L("%.1f"), diameter_map[i])); - if (diameter == diameter_map[i]) { - nozzle_diameter_checkbox->SetSelection(i); - } - } - - nozzle_type_checkbox->SetSelection(nozzle_type_selection_map[type]); - } - + nozzle_type_checkbox->SetValue(GetString(type)); + nozzle_diameter_checkbox->SetValue(GetString(diameter)); } else { single_panel->Hide(); multiple_panel->Show(); @@ -928,77 +752,17 @@ bool PrinterPartsDialog::Show(bool show) auto type = obj->m_extder_data.extders[DEPUTY_NOZZLE_ID].current_nozzle_type; 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_diameter_checkbox->Clear(); - - 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); - } - else - { - std::map diameter_map; - if (type == NozzleType::ntHardenedSteel) - { - diameter_map = nozzle_hard_diameter_map; - } - else if (type == NozzleType::ntStainlessSteel) - { - diameter_map = nozzle_stainless_diameter_map; - } - - 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]) - { - multiple_left_nozzle_diameter_checkbox->SetSelection(i); - } - } - - multiple_left_nozzle_type_checkbox->SetSelection(nozzle_type_selection_map[type]); - if (flow_type != NozzleFlowType::NONE_FLOWTYPE) {multiple_left_nozzle_flow_checkbox->SetSelection(nozzle_flow_selection_map[flow_type]);} - } + multiple_left_nozzle_type_checkbox->SetValue(GetString(type)); + multiple_left_nozzle_diameter_checkbox->SetValue(GetString(diameter)); + multiple_left_nozzle_flow_checkbox->SetValue(GetString(flow_type)); //right type = obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_type; diameter = obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_diameter; flow_type = obj->m_extder_data.extders[MAIN_NOZZLE_ID].current_nozzle_flow_type; - - multiple_right_nozzle_diameter_checkbox->Clear(); - - 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); - } - else - { - std::map diameter_map; - if (type == NozzleType::ntHardenedSteel) - { - diameter_map = nozzle_hard_diameter_map; - } - else if (type == NozzleType::ntStainlessSteel) - { - diameter_map = nozzle_stainless_diameter_map; - } - - 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]) - { - multiple_right_nozzle_diameter_checkbox->SetSelection(i); - } - } - - multiple_right_nozzle_type_checkbox->SetSelection(nozzle_type_selection_map[type]); - if (flow_type != NozzleFlowType::NONE_FLOWTYPE) { multiple_right_nozzle_flow_checkbox->SetSelection(nozzle_flow_selection_map[flow_type]); }; - } + multiple_right_nozzle_type_checkbox->SetValue(GetString(type)); + multiple_right_nozzle_diameter_checkbox->SetValue(GetString(diameter)); + multiple_right_nozzle_flow_checkbox->SetValue(GetString(flow_type)); } Layout(); @@ -1023,4 +787,25 @@ void PrinterPartsDialog::EnableEditing(bool enable) { change_nozzle_tips->Show(!enable); multiple_change_nozzle_tips->Show(!enable); } + +wxString PrinterPartsDialog::GetString(NozzleType nozzle_type) const { + switch (nozzle_type) { + case Slic3r::ntHardenedSteel: return _L("Hardened Steel"); + case Slic3r::ntStainlessSteel: return _L("Stainless Steel"); + default: break; + } + + return wxEmptyString; +} + +wxString PrinterPartsDialog::GetString(NozzleFlowType nozzle_flow_type) const { + switch (nozzle_flow_type) { + case Slic3r::S_FLOW: return _L("Standard"); + case Slic3r::H_FLOW: return _L("High flow"); + default: break; + } + + return wxEmptyString; +} + }} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/PrintOptionsDialog.hpp b/src/slic3r/GUI/PrintOptionsDialog.hpp index 6204ad7fac..74a9cb8797 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.hpp +++ b/src/slic3r/GUI/PrintOptionsDialog.hpp @@ -24,17 +24,6 @@ namespace Slic3r { namespace GUI { class PrinterPartsDialog : public DPIDialog { protected: - wxWindowID ID_NOZZLE_TYPE_CHECKBOX_SINGLE; - wxWindowID ID_NOZZLE_TYPE_CHECKBOX_LEFT; - wxWindowID ID_NOZZLE_TYPE_CHECKBOX_RIGHT; - - wxWindowID ID_NOZZLE_DIAMETER_CHECKBOX_SINGLE; - wxWindowID ID_NOZZLE_DIAMETER_CHECKBOX_LEFT; - wxWindowID ID_NOZZLE_DIAMETER_CHECKBOX_RIGHT; - - wxWindowID ID_NOZZLE_FLOW_CHECKBOX_LEFT; - wxWindowID ID_NOZZLE_FLOW_CHECKBOX_RIGHT; - MachineObject* obj{ nullptr }; ComboBox* nozzle_type_checkbox; @@ -54,19 +43,10 @@ protected: wxPanel *single_panel; wxPanel *multiple_panel; - std::string last_nozzle_type; - std::map nozzle_type_map; - std::map nozzle_type_selection_map; - - std::map nozzle_flow_map; - std::map nozzle_flow_selection_map; - - std::map nozzle_stainless_diameter_map; - std::map nozzle_hard_diameter_map; public: PrinterPartsDialog(wxWindow* parent); ~PrinterPartsDialog(); - void set_nozzle_data(wxCommandEvent& evt); + void on_dpi_changed(const wxRect& suggested_rect) override; void update_machine_obj(MachineObject* obj_); bool Show(bool show) override; @@ -74,6 +54,9 @@ public: private: void EnableEditing(bool enable); + wxString GetString(NozzleType nozzle_type) const; + wxString GetString(NozzleFlowType nozzle_flow_type) const; + wxString GetString(float diameter) const { return wxString::FromDouble(diameter); }; };