From eb90f16dd57d69683f440a4ceb526dc66ff1b6cd Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Wed, 5 Feb 2025 10:37:24 +0800 Subject: [PATCH] FIX: move the function to API jira: [none] Change-Id: I2b30082148d6d9b937a218e37464727ba8fdf131 --- src/slic3r/GUI/SelectMachine.cpp | 26 ++++++++++++++------------ src/slic3r/GUI/SelectMachine.hpp | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 15acc56cb..09703ebb5 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1679,7 +1679,7 @@ void SelectMachineDialog::update_printer_status_msg_tips(const wxString& msg_tip } } -void SelectMachineDialog::update_print_status_msg(wxString msg, bool is_printer_msg, bool can_send_print, bool can_refresh) +void SelectMachineDialog::update_print_status_msg(wxString msg, bool is_printer_msg, bool can_send_print, bool can_refresh, const wxString& printer_msg_tips /*=wxEmptyString*/) { if (is_printer_msg) { update_ams_status_msg(wxEmptyString, can_send_print); @@ -1689,6 +1689,8 @@ void SelectMachineDialog::update_print_status_msg(wxString msg, bool is_printer_ update_priner_status_msg(wxEmptyString, can_send_print); } + update_printer_status_msg_tips(printer_msg_tips); + Enable_Send_Button(can_send_print); Enable_Refresh_Button(can_refresh); } @@ -1780,10 +1782,10 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector 1)) { + update_print_status_msg(params[0], true, false, true, params[1]); + } else if (status == PrintStatusNozzleDiameterMismatch && (params.size() > 1)) { + update_print_status_msg(params[0], true, false, true, params[1]); } else if (status == PrintStatusNozzleTypeMismatch && !params.empty()) { update_print_status_msg(params[0], true, false, true); } @@ -3277,8 +3279,8 @@ void SelectMachineDialog::update_show_status() if (!is_nozzle_type_match(obj_->m_extder_data, error_message)) { std::vector params { error_message }; + params.emplace_back(_L("Tips: If you changed your nozzle of your printer lately, Please go to 'Device -> Printer parts' to change your nozzle setting.")); show_status(PrintDialogStatus::PrintStatusNozzleMatchInvalid, params); - update_printer_status_msg_tips(_L("Tips: If you changed your nozzle of your printer lately, Please go to 'Device -> Printer parts' to change your nozzle setting.")); return; } } @@ -3289,26 +3291,26 @@ void SelectMachineDialog::update_show_status() float nozzle_diameter = 0; if (!is_same_nozzle_diameters(nozzle_diameter)) { - std::vector error_msg; + std::vector msg_params; if (obj_->m_extder_data.total_extder_count == 2) { const wxString& nozzle_config = wxString::Format(_L("The current nozzle diameter (Left: %.1fmm Right: %.1fmm) doesn't match with the slicing file (%.1fmm). " "Please make sure the nozzle installed matches with settings in printer, then set the " "corresponding printer preset when slicing."), obj_->m_extder_data.extders[1].current_nozzle_diameter, obj_->m_extder_data.extders[0].current_nozzle_diameter, nozzle_diameter); - error_msg.emplace_back(nozzle_config); + msg_params.emplace_back(nozzle_config); } else { const wxString& nozzle_config = wxString::Format(_L("The current nozzle diameter (%.1fmm) doesn't match with the slicing file (%.1fmm). " "Please make sure the nozzle installed matches with settings in printer, then set the " "corresponding printer preset when slicing."), obj_->m_extder_data.extders[0].current_nozzle_diameter, - nozzle_diameter); - error_msg.emplace_back(nozzle_config); + nozzle_diameter); + msg_params.emplace_back(nozzle_config); } - update_printer_status_msg_tips(_L("Tips: If you changed your nozzle of your printer lately, Please go to 'Device -> Printer parts' to change your nozzle setting.")); - return show_status(PrintDialogStatus::PrintStatusNozzleDiameterMismatch, error_msg); + msg_params.emplace_back(_L("Tips: If you changed your nozzle of your printer lately, Please go to 'Device -> Printer parts' to change your nozzle setting.")); + return show_status(PrintDialogStatus::PrintStatusNozzleDiameterMismatch, msg_params); } for (const auto& extder : obj_->m_extder_data.extders) diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index dd9e058cc..b861dfd98 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -473,7 +473,7 @@ public: void update_ams_status_msg(wxString msg, bool can_send_print); void update_priner_status_msg(wxString msg, bool can_send_print); void update_printer_status_msg_tips(const wxString& msg_tips); - void update_print_status_msg(wxString msg, bool is_printer, bool can_send_print, bool can_refresh); + void update_print_status_msg(wxString msg, bool is_printer, bool can_send_print, bool can_refresh, const wxString& printer_msg_tips = wxEmptyString); void update_print_error_info(int code, std::string msg, std::string extra); void set_flow_calibration_state(bool state, bool show_tips = true); bool has_timelapse_warning();