From 307bb051e6fb8b2d6fbe4dfb849e4f11140f0219 Mon Sep 17 00:00:00 2001 From: "liz.li" Date: Thu, 31 Oct 2024 16:22:04 +0800 Subject: [PATCH] ENH: refresh FilamentUnPrintableOnFirstLayer error state jira: none Change-Id: Ifec994cdba2c9590d4c1f8b59e6052593fd05bc2 (cherry picked from commit 04eeb40e1eba976e0921686bf6d66599a90e81cc) --- src/slic3r/GUI/GLCanvas3D.cpp | 9 +++++++++ src/slic3r/GUI/NotificationManager.cpp | 15 +++++++++++++++ src/slic3r/GUI/NotificationManager.hpp | 5 +++++ src/slic3r/GUI/PartPlate.hpp | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7482221d3e..85ebd0c1ac 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2961,6 +2961,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re //BBS:exclude the assmble view if (m_canvas_type != ECanvasType::CanvasAssembleView) { _set_warning_notification_if_needed(EWarning::GCodeConflict); + _set_warning_notification(EWarning::FilamentUnPrintableOnFirstLayer, false); // checks for geometry outside the print volume to render it accordingly if (!m_volumes.empty()) { ModelInstanceEPrintVolumeState state; @@ -10110,6 +10111,14 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state) notification_manager.close_slicing_serious_warning_notification(text); break; case SLICING_ERROR: + if (warning == EWarning::FilamentUnPrintableOnFirstLayer) { + if (state) { + notification_manager.bbl_show_bed_filament_incompatible_notification(text); + } + else { + notification_manager.bbl_close_bed_filament_incompatible_notification(); + } + } if (warning == EWarning::FilamentPrintableError) { if (state) notification_manager.push_slicing_customize_error_notification(NotificationType::BBLFilamentPrintableError, NotificationLevel::ErrorNotificationLevel, text); diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 5d85ef2699..5988779432 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -3077,6 +3077,21 @@ void NotificationManager::bbl_close_gcode_overlap_notification() if (notification->get_type() == NotificationType::BBLGcodeOverlap) { notification->close(); } } +void NotificationManager::bbl_show_bed_filament_incompatible_notification(const std::string& text) +{ + auto callback = [](wxEvtHandler*) { + const wxString bed_filament_compatibility_wiki = "https://wiki.bambulab.com/en/general/filament-guide-material-table"; + wxGetApp().open_browser_with_warning_dialog(bed_filament_compatibility_wiki); + return false; + }; + push_notification_data({ NotificationType::BBLBedFilamentIncompatible,NotificationLevel::ErrorNotificationLevel,0,_u8L("Error:") + "\n" + text,"Click for more.",callback }, 0); +} + +void NotificationManager::bbl_close_bed_filament_incompatible_notification() +{ + close_notification_of_type(NotificationType::BBLBedFilamentIncompatible); +} + void NotificationManager::bbl_show_sole_text_notification(NotificationType sType, const std::string &text, bool bOverride, int level, bool autohide) { NotificationLevel nlevel; diff --git a/src/slic3r/GUI/NotificationManager.hpp b/src/slic3r/GUI/NotificationManager.hpp index b42cee9eb5..28db1cb0d9 100644 --- a/src/slic3r/GUI/NotificationManager.hpp +++ b/src/slic3r/GUI/NotificationManager.hpp @@ -157,6 +157,7 @@ enum class NotificationType BBLFilamentPrintableError, BBLSliceLimitError, BBLSliceMultiExtruderHeightOutside, + BBLBedFilamentIncompatible, NotificationTypeCount }; @@ -360,6 +361,10 @@ public: void bbl_show_gcode_overlap_notification(); void bbl_close_gcode_overlap_notification(); + //BBS--bed filament match + void bbl_show_bed_filament_incompatible_notification(const std::string& text); + void bbl_close_bed_filament_incompatible_notification(); + //BBS--sole notification void bbl_show_sole_text_notification(NotificationType sType,const std::string &text, bool bOverride, int level, bool autohide); void bbl_chose_sole_text_notification(NotificationType sType); diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index 92f9fdc941..47ad324e46 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -451,7 +451,7 @@ public: bool result = m_slice_result_valid; if (result) result = m_gcode_result ? - (!m_gcode_result->toolpath_outside && m_gcode_result->gcode_check_result.error_code == 0) : + (!m_gcode_result->toolpath_outside && m_gcode_result->gcode_check_result.error_code == 0 && !m_gcode_result->filament_printable_reuslt.has_value()) : false;// && !m_gcode_result->conflict_result.has_value() gcode conflict can also print return result; }