FIX: GUI: refine the error message when switch plate

also refine the text
jira: STUDIO-9809

Change-Id: Ifce527d3d19ead80b314611de8f3f861dc598188
(cherry picked from commit 014996d4258cef42ce943157d6485fad9cc98ee2)
This commit is contained in:
lane.wei
2025-01-18 11:33:47 +08:00
committed by Noisyfox
parent 31f16dc42e
commit d6715225c7
2 changed files with 29 additions and 6 deletions

View File

@@ -15539,6 +15539,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)
{
@@ -15583,14 +15585,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());