From 014996d4258cef42ce943157d6485fad9cc98ee2 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Sat, 18 Jan 2025 11:33:47 +0800 Subject: [PATCH] FIX: GUI: refine the error message when switch plate also refine the text jira: STUDIO-9809 Change-Id: Ifce527d3d19ead80b314611de8f3f861dc598188 --- src/slic3r/GUI/GLCanvas3D.cpp | 6 ++++-- src/slic3r/GUI/Plater.cpp | 29 +++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 15fb2c919..ea68fc8c0 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -127,8 +127,8 @@ float RetinaHelper::get_scale_factor() { return float(m_window->GetContentScaleF std::string get_object_limited_text() { - std::string object_limited_text = _u8L("An object is laid on the left/right nozzle only area.\n" - "Please make sure the filaments used by this object on this area are not mapped to the other nozzles."); + std::string object_limited_text = _u8L("An object is placed in the left/right nozzle-only area or exceeds the printable height of the left nozzle.\n" + "Please ensure the filaments used by this object are not arranged to other nozzles."); return object_limited_text; } @@ -1435,6 +1435,8 @@ static bool construct_error_string(ObjectFilamentResults& object_result, std::st static std::pair construct_extruder_unprintable_error(ObjectFilamentResults& object_result, std::string& left_extruder_unprintable_text, std::string& right_extruder_unprintable_text) { + left_extruder_unprintable_text.clear(); + right_extruder_unprintable_text.clear(); if (object_result.filaments.empty()) return {false,false}; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 4fb978e63..64d8153ce 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -15624,6 +15624,8 @@ int Plater::select_sliced_plate(int plate_index) extern std::string get_object_limited_text(); extern std::string& get_object_clashed_text(); +extern std::string& get_left_extruder_unprintable_text(); +extern std::string& get_right_extruder_unprintable_text(); void Plater::validate_current_plate(bool& model_fits, bool& validate_error) { @@ -15668,14 +15670,33 @@ void Plater::validate_current_plate(bool& model_fits, bool& validate_error) p->view3D->get_canvas3d()->set_sequential_print_clearance_polygons(polygons, height_polygons); } - auto clashed_text = get_object_clashed_text(); - if (!model_fits) { - if(!clashed_text.empty()) - p->notification_manager->push_plater_error_notification(clashed_text); + std::string clashed_text = get_object_clashed_text(); + if (state == ModelInstancePVS_Partly_Outside) { + p->notification_manager->push_plater_error_notification(clashed_text); } else { p->notification_manager->close_plater_error_notification(clashed_text); } + std::string left_unprintable_text = get_left_extruder_unprintable_text(), right_unprintable_text = get_right_extruder_unprintable_text(); + if (!left_unprintable_text.empty()) + { + p->notification_manager->push_slicing_customize_error_notification(NotificationType::LeftExtruderUnprintableError, + NotificationManager::NotificationLevel::ErrorNotificationLevel, left_unprintable_text); + } + else { + p->notification_manager->close_slicing_customize_error_notification(NotificationType::LeftExtruderUnprintableError, + NotificationManager::NotificationLevel::ErrorNotificationLevel); + } + + if (!right_unprintable_text.empty()) + { + p->notification_manager->push_slicing_customize_error_notification(NotificationType::RightExtruderUnprintableError, + NotificationManager::NotificationLevel::ErrorNotificationLevel, right_unprintable_text); + } + else { + p->notification_manager->close_slicing_customize_error_notification(NotificationType::RightExtruderUnprintableError, + NotificationManager::NotificationLevel::ErrorNotificationLevel); + } if (state == ModelInstancePVS_Limited) { p->notification_manager->push_plater_warning_notification(get_object_limited_text());