diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 6c828a415..89f8d67df 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1580,9 +1580,9 @@ void SelectMachineDialog::prepare(int print_plate_idx) m_print_plate_idx = print_plate_idx; } -void SelectMachineDialog::update_ams_status_msg(wxString msg, bool is_warning) +void SelectMachineDialog::update_ams_status_msg(wxString msg, bool can_send_print) { - auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00):wxColour(0x6B, 0x6B, 0x6B); + auto colour = can_send_print ? wxColour(0xFF, 0x6F, 0x00) : wxColour("#D01B1B"); m_statictext_ams_msg->SetForegroundColour(colour); if (msg.empty()) { @@ -1611,9 +1611,9 @@ void SelectMachineDialog::update_ams_status_msg(wxString msg, bool is_warning) } } -void SelectMachineDialog::update_priner_status_msg(wxString msg, bool is_warning) +void SelectMachineDialog::update_priner_status_msg(wxString msg, bool can_send_print) { - auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00) : wxColour(0x6B, 0x6B, 0x6B); + auto colour = can_send_print ? wxColour(0xFF, 0x6F, 0x00) : wxColour("#D01B1B"); m_text_printer_msg->SetForegroundColour(colour); if (msg.empty()) { @@ -1679,15 +1679,18 @@ void SelectMachineDialog::update_printer_status_msg_tips(const wxString& msg_tip } } -void SelectMachineDialog::update_print_status_msg(wxString msg, bool is_warning, bool is_printer_msg) +void SelectMachineDialog::update_print_status_msg(wxString msg, bool is_printer_msg, bool can_send_print, bool can_refresh) { if (is_printer_msg) { - update_ams_status_msg(wxEmptyString, false); - update_priner_status_msg(msg, is_warning); + update_ams_status_msg(wxEmptyString, can_send_print); + update_priner_status_msg(msg, can_send_print); } else { - update_ams_status_msg(msg, is_warning); - update_priner_status_msg(wxEmptyString, false); + update_ams_status_msg(msg, can_send_print); + update_priner_status_msg(wxEmptyString, can_send_print); } + + Enable_Send_Button(can_send_print); + Enable_Refresh_Button(can_refresh); } void SelectMachineDialog::update_print_error_info(int code, std::string msg, std::string extra) @@ -1728,101 +1731,61 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector 0) msg_text = wxString::Format(_L("Filament %s exceeds the number of AMS slots. Please update the printer firmware to support AMS slot assignment."), params[0]); else msg_text = _L("Filament exceeds the number of AMS slots. Please update the printer firmware to support AMS slot assignment."); - update_print_status_msg(msg_text, true, false); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, false, false, true); } else if (status == PrintDialogStatus::PrintStatusAmsMappingSuccess){ wxString msg_text = _L("Filaments to AMS slots mappings have been established. You can click a filament above to change its mapping AMS slot"); - update_print_status_msg(msg_text, false, false); - Enable_Send_Button(true); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, false, true, true); } else if (status == PrintDialogStatus::PrintStatusAmsMappingInvalid) { wxString msg_text = _L("Please click each filament above to specify its mapping AMS slot before sending the print job"); - update_print_status_msg(msg_text, true, false); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, false, false, true); } else if (status == PrintDialogStatus::PrintStatusAmsMappingMixInvalid) { wxString msg_text = _L("Please do not mix-use the Ext with AMS"); - update_print_status_msg(msg_text, true, true); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, true, false, true); } else if (status == PrintDialogStatus::PrintStatusNozzleDataInvalid) { wxString msg_text = _L("Invalid nozzle information, please refresh or manually set nozzle information."); - update_print_status_msg(msg_text, true, true); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, true, false, true); } else if (status == PrintDialogStatus::PrintStatusNozzleMatchInvalid && !params.empty()) { - update_print_status_msg(params[0], true, true); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(params[0], true, false, true); } else if (status == PrintStatusNozzleDiameterMismatch && !params.empty()) { - update_print_status_msg(params[0], true, true); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(params[0], true, false, true); } else if (status == PrintStatusNozzleTypeMismatch && !params.empty()) { - update_print_status_msg(params[0], true, true); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(params[0], true, false, true); } else if (status == PrintDialogStatus::PrintStatusAmsMappingU0Invalid) { wxString msg_text; @@ -1830,49 +1793,31 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector AMS slot."); - update_print_status_msg(msg_text, false, false); - Enable_Send_Button(true); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, false, true, true); } else if (status == PrintDialogStatus::PrintStatusNoSdcard) { wxString msg_text = _L("Storage needs to be inserted before printing."); - update_print_status_msg(msg_text, true, true); - Enable_Send_Button(false); - Enable_Refresh_Button(true); + update_print_status_msg(msg_text, true, false, true); }else if (status == PrintDialogStatus::PrintStatusUnsupportedPrinter) { wxString msg_text; try @@ -1902,37 +1847,27 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectorget_partplate_list().get_curr_plate(); @@ -1946,15 +1881,11 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector