diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 9003e07829..b0595ce050 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1471,7 +1471,7 @@ void SelectMachineDialog::auto_supply_with_ext(std::vector slots) { } } -bool SelectMachineDialog::is_nozzle_type_match(ExtderData data) { +bool SelectMachineDialog::is_nozzle_type_match(ExtderData data, wxString& error_message) const { if (data.total_extder_count <= 1 || data.extders.size() <= 1 || !wxGetApp().preset_bundle) return false; @@ -1516,6 +1516,24 @@ bool SelectMachineDialog::is_nozzle_type_match(ExtderData data) { if (target_machine_nozzle_id < flow_type_of_machine.size()) { if (flow_type_of_machine[target_machine_nozzle_id] != used_extruders_flow[it->first]) { + + wxString pos; + if (target_machine_nozzle_id == DEPUTY_NOZZLE_ID) + { + pos = _L("left"); + } + else if((target_machine_nozzle_id == MAIN_NOZZLE_ID)) + { + pos = _L("right"); + } + + const wxString& tips = _L("Tips: If you changed your nozzle of your printer lately, Please go to 'Device -> Printer parts' to change your nozzle setting."); + error_message = wxString::Format(_L("The nozzle flow setting of %snozzle(%s) doesn't match with the slicing file(%s). " + "Please make sure the nozzle installed matches with settings in printer, " + "then set the corresponding printer preset while slicing."), + pos, flow_type_of_machine[target_machine_nozzle_id], + used_extruders_flow[it->first]); + error_message = error_message + "\n" + tips; return false; } } @@ -1739,9 +1757,8 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectorm_extder_data)) { - show_status(PrintDialogStatus::PrintStatusNozzleMatchInvalid); + wxString error_message; + if (!is_nozzle_type_match(obj_->m_extder_data, error_message)) + { + std::vector params { error_message }; + show_status(PrintDialogStatus::PrintStatusNozzleMatchInvalid, params); return; } } diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 33d5b6df1a..6fed6f55b0 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -491,7 +491,7 @@ public: bool build_nozzles_info(std::string& nozzles_info); bool can_hybrid_mapping(ExtderData data); void auto_supply_with_ext(std::vector slots); - bool is_nozzle_type_match(ExtderData data); + bool is_nozzle_type_match(ExtderData data, wxString& error_message) const; int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id); std::string get_print_status_info(PrintDialogStatus status); diff --git a/src/slic3r/GUI/Widgets/SideTools.cpp b/src/slic3r/GUI/Widgets/SideTools.cpp index de747264f7..51895ccd55 100644 --- a/src/slic3r/GUI/Widgets/SideTools.cpp +++ b/src/slic3r/GUI/Widgets/SideTools.cpp @@ -45,8 +45,8 @@ namespace Slic3r { namespace GUI { SideToolsPanel::~SideToolsPanel() { delete m_intetval_timer; } -void SideToolsPanel::set_none_printer_mode() -{ +void SideToolsPanel::set_none_printer_mode() +{ m_none_printer = true; Refresh(); } @@ -55,26 +55,26 @@ void SideToolsPanel::on_timer(wxTimerEvent &event) { } -void SideToolsPanel::set_current_printer_name(std::string dev_name) +void SideToolsPanel::set_current_printer_name(std::string dev_name) { m_none_printer = false; m_dev_name = from_u8(dev_name); Refresh(); } -void SideToolsPanel::set_current_printer_signal(WifiSignal sign) +void SideToolsPanel::set_current_printer_signal(WifiSignal sign) { if (last_printer_signal == sign) return; - + last_printer_signal = sign; m_none_printer = false; m_wifi_type = sign; Refresh(); } -void SideToolsPanel::start_interval() -{ - m_intetval_timer->Start(SIDE_TOOL_CLICK_INTERVAL); +void SideToolsPanel::start_interval() +{ + m_intetval_timer->Start(SIDE_TOOL_CLICK_INTERVAL); m_is_in_interval = true; } @@ -85,13 +85,13 @@ void SideToolsPanel::stop_interval(wxTimerEvent& event) } -bool SideToolsPanel::is_in_interval() +bool SideToolsPanel::is_in_interval() { return m_is_in_interval; } -void SideToolsPanel::msw_rescale() -{ +void SideToolsPanel::msw_rescale() +{ m_printing_img.msw_rescale(); m_arrow_img.msw_rescale(); @@ -138,7 +138,7 @@ void SideToolsPanel::doRender(wxDC &dc) { auto left = FromDIP(15); wxSize size = GetSize(); - + //if (m_none_printer) { // dc.SetPen(SIDE_TOOLS_LIGHT_GREEN); // dc.SetBrush(SIDE_TOOLS_LIGHT_GREEN); @@ -196,7 +196,7 @@ void SideToolsPanel::doRender(wxDC &dc) auto sizet = dc.GetTextExtent(m_dev_name); auto text_end = size.x - m_wifi_none_img.GetBmpSize().x - 20; - + std::string finally_name = m_dev_name.ToStdString(); if (sizet.x > (text_end - left)) { auto limit_width = text_end - left - dc.GetTextExtent("...").x - 20; @@ -233,7 +233,7 @@ void SideToolsPanel::on_mouse_left_down(wxMouseEvent &evt) Refresh(); } -void SideToolsPanel::on_mouse_left_up(wxMouseEvent &evt) +void SideToolsPanel::on_mouse_left_up(wxMouseEvent &evt) { m_click = false; Refresh(); @@ -404,7 +404,7 @@ SideTools::SideTools(wxWindow *parent, wxWindowID id, const wxPoint &pos, const Fit(); } -void SideTools::msw_rescale() +void SideTools::msw_rescale() { m_side_tools->msw_rescale(); m_connection_info->SetCornerRadius(0);