ENH: refresh FilamentUnPrintableOnFirstLayer error state
jira: none Change-Id: Ifec994cdba2c9590d4c1f8b59e6052593fd05bc2
This commit is contained in:
parent
82c72b19bd
commit
04eeb40e1e
|
@ -2809,6 +2809,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||||
//BBS:exclude the assmble view
|
//BBS:exclude the assmble view
|
||||||
if (m_canvas_type != ECanvasType::CanvasAssembleView) {
|
if (m_canvas_type != ECanvasType::CanvasAssembleView) {
|
||||||
_set_warning_notification_if_needed(EWarning::GCodeConflict);
|
_set_warning_notification_if_needed(EWarning::GCodeConflict);
|
||||||
|
_set_warning_notification(EWarning::FilamentUnPrintableOnFirstLayer, false);
|
||||||
// checks for geometry outside the print volume to render it accordingly
|
// checks for geometry outside the print volume to render it accordingly
|
||||||
if (!m_volumes.empty()) {
|
if (!m_volumes.empty()) {
|
||||||
ModelInstanceEPrintVolumeState state;
|
ModelInstanceEPrintVolumeState state;
|
||||||
|
@ -9491,7 +9492,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
|
||||||
PLATER_WARNING,
|
PLATER_WARNING,
|
||||||
PLATER_ERROR,
|
PLATER_ERROR,
|
||||||
SLICING_SERIOUS_WARNING,
|
SLICING_SERIOUS_WARNING,
|
||||||
SLICING_ERROR
|
SLICING_ERROR,
|
||||||
};
|
};
|
||||||
std::string text;
|
std::string text;
|
||||||
ErrorType error = ErrorType::PLATER_WARNING;
|
ErrorType error = ErrorType::PLATER_WARNING;
|
||||||
|
@ -9564,10 +9565,20 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
|
||||||
notification_manager.close_slicing_serious_warning_notification(text);
|
notification_manager.close_slicing_serious_warning_notification(text);
|
||||||
break;
|
break;
|
||||||
case SLICING_ERROR:
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (state)
|
if (state)
|
||||||
notification_manager.push_slicing_error_notification(text, conflictObj ? std::vector<ModelObject const*>{conflictObj} : std::vector<ModelObject const*>{});
|
notification_manager.push_slicing_error_notification(text, conflictObj ? std::vector<ModelObject const*>{conflictObj} : std::vector<ModelObject const*>{});
|
||||||
else
|
else
|
||||||
notification_manager.close_slicing_error_notification(text);
|
notification_manager.close_slicing_error_notification(text);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2684,6 +2684,21 @@ void NotificationManager::bbl_close_gcode_overlap_notification()
|
||||||
if (notification->get_type() == NotificationType::BBLGcodeOverlap) { notification->close(); }
|
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) {
|
void NotificationManager::bbl_show_sole_text_notification(NotificationType sType, const std::string &text, bool bOverride, int level, bool autohide) {
|
||||||
|
|
||||||
NotificationLevel nlevel;
|
NotificationLevel nlevel;
|
||||||
|
|
|
@ -145,6 +145,7 @@ enum class NotificationType
|
||||||
BBLPreviewOnlyMode,
|
BBLPreviewOnlyMode,
|
||||||
BBLPrinterConfigUpdateAvailable,
|
BBLPrinterConfigUpdateAvailable,
|
||||||
BBLUserPresetExceedLimit,
|
BBLUserPresetExceedLimit,
|
||||||
|
BBLBedFilamentIncompatible
|
||||||
};
|
};
|
||||||
|
|
||||||
class NotificationManager
|
class NotificationManager
|
||||||
|
@ -330,6 +331,10 @@ public:
|
||||||
void bbl_show_gcode_overlap_notification();
|
void bbl_show_gcode_overlap_notification();
|
||||||
void bbl_close_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
|
//BBS--sole notification
|
||||||
void bbl_show_sole_text_notification(NotificationType sType,const std::string &text, bool bOverride, int level, bool autohide);
|
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);
|
void bbl_chose_sole_text_notification(NotificationType sType);
|
||||||
|
|
|
@ -417,7 +417,9 @@ public:
|
||||||
{
|
{
|
||||||
bool result = m_slice_result_valid;
|
bool result = m_slice_result_valid;
|
||||||
if (result)
|
if (result)
|
||||||
result = m_gcode_result ? (!m_gcode_result->toolpath_outside) : false;// && !m_gcode_result->conflict_result.has_value() gcode conflict can also print
|
result = m_gcode_result ?
|
||||||
|
(!m_gcode_result->toolpath_outside && !m_gcode_result->filament_printable_reuslt.has_value()) :
|
||||||
|
false;// && !m_gcode_result->conflict_result.has_value() gcode conflict can also print
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue