FIX: GUI: refine the error message when switch plate

also refine the text
jira: STUDIO-9809

Change-Id: Ifce527d3d19ead80b314611de8f3f861dc598188
This commit is contained in:
lane.wei 2025-01-18 11:33:47 +08:00
parent 3a6784342a
commit 014996d425
2 changed files with 29 additions and 6 deletions

View File

@ -127,8 +127,8 @@ float RetinaHelper::get_scale_factor() { return float(m_window->GetContentScaleF
std::string get_object_limited_text() { std::string get_object_limited_text() {
std::string object_limited_text = _u8L("An object is laid on the left/right nozzle only area.\n" 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 make sure the filaments used by this object on this area are not mapped to the other nozzles."); "Please ensure the filaments used by this object are not arranged to other nozzles.");
return object_limited_text; return object_limited_text;
} }
@ -1435,6 +1435,8 @@ static bool construct_error_string(ObjectFilamentResults& object_result, std::st
static std::pair<bool, bool> construct_extruder_unprintable_error(ObjectFilamentResults& object_result, std::string& left_extruder_unprintable_text, std::string& right_extruder_unprintable_text) static std::pair<bool, bool> 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()) if (object_result.filaments.empty())
return {false,false}; return {false,false};

View File

@ -15624,6 +15624,8 @@ int Plater::select_sliced_plate(int plate_index)
extern std::string get_object_limited_text(); extern std::string get_object_limited_text();
extern std::string& get_object_clashed_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) 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); p->view3D->get_canvas3d()->set_sequential_print_clearance_polygons(polygons, height_polygons);
} }
auto clashed_text = get_object_clashed_text(); std::string clashed_text = get_object_clashed_text();
if (!model_fits) { if (state == ModelInstancePVS_Partly_Outside) {
if(!clashed_text.empty()) p->notification_manager->push_plater_error_notification(clashed_text);
p->notification_manager->push_plater_error_notification(clashed_text);
} }
else { else {
p->notification_manager->close_plater_error_notification(clashed_text); 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) { if (state == ModelInstancePVS_Limited) {
p->notification_manager->push_plater_warning_notification(get_object_limited_text()); p->notification_manager->push_plater_warning_notification(get_object_limited_text());