From 27c0d48f281db722578268055058d7274202aa62 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Tue, 1 Apr 2025 11:12:32 +0800 Subject: [PATCH] FIX: protect the nozzle commands jira: [none] Change-Id: I0252026d20869467063b28339ec2cd2d7ca78569 --- src/slic3r/GUI/PrintOptionsDialog.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/slic3r/GUI/PrintOptionsDialog.cpp b/src/slic3r/GUI/PrintOptionsDialog.cpp index 55192cada..27700edbf 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.cpp +++ b/src/slic3r/GUI/PrintOptionsDialog.cpp @@ -820,6 +820,10 @@ void PrinterPartsDialog::set_nozzle_data(wxCommandEvent& evt) nozzle_id = MAIN_NOZZLE_ID; } + /*filter invalid set*/ + if (current_nozzle_type_combox && current_nozzle_type_combox->IsShown() && current_nozzle_type_combox->GetValue().IsEmpty()) { return; } + if (current_nozzle_diameter_combox && current_nozzle_diameter_combox->IsShown() && current_nozzle_diameter_combox->GetValue().IsEmpty()) { return; } + if (current_nozzle_flow_combox && current_nozzle_flow_combox->IsShown() && current_nozzle_flow_combox->GetValue().IsEmpty()) { return; } if (obj) { try { @@ -891,12 +895,18 @@ void PrinterPartsDialog::set_nozzle_data(wxCommandEvent& evt) nozzle_data += "S"; } else if (nozzle_flow == NozzleFlowType::H_FLOW) { nozzle_data += "H"; + } else { + nozzle_data += "N";/*means normal*/ + BOOST_LOG_TRIVIAL(warning) << "warning: nozzle flow type is normal!"; } if (nozzle_type == NozzleType::ntStainlessSteel) { nozzle_data += "00"; } else if (nozzle_type == NozzleType::ntHardenedSteel) { nozzle_data += "01"; + } else { + BOOST_LOG_TRIVIAL(warning) << "error: nozzle type is unknown!"; + return; } obj->m_extder_data.extders[nozzle_id].current_nozzle_diameter = nozzle_diameter;