ENH: add warning info when bed temperature is too high

Add bed temperature checker in gcode processer. And
save slice warning into GcodeProcessorResult.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Iee96e4ab165a3171a5a1e165450bfc360401647f
This commit is contained in:
salt.wei 2022-10-17 20:34:33 +08:00 committed by Lane.Wei
parent 48aed7fbe5
commit 99974c7f59
7 changed files with 115 additions and 12 deletions

View file

@ -2540,7 +2540,7 @@ wxColour Plater::get_next_color_for_filament()
return colors[curr_color_filamenet++ % 7];
}
wxString Plater::get_slice_warning_string(GCodeProcessorResult::SliceWarnings& warning)
wxString Plater::get_slice_warning_string(GCodeProcessorResult::SliceWarning& warning)
{
if (warning.msg == BED_TEMP_TOO_HIGH_THAN_FILAMENT) {
return _L("The bed temperature exceeds filament's vitrification temperature. Please open the front door of printer before printing to avoid nozzle clog.");

View file

@ -235,7 +235,7 @@ public:
static void setPrintSpeedTable(Slic3r::GlobalSpeedMap& printSpeedMap);
static void setExtruderParams(std::map<size_t, Slic3r::ExtruderParams>& extParas);
static wxColour get_next_color_for_filament();
static wxString get_slice_warning_string(GCodeProcessorResult::SliceWarnings& warning);
static wxString get_slice_warning_string(GCodeProcessorResult::SliceWarning& warning);
// BBS: restore
std::vector<size_t> load_files(const std::vector<boost::filesystem::path>& input_files, LoadStrategy strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig, bool ask_multi = false);

View file

@ -1767,7 +1767,8 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
//Check Printer Model Id
bool is_same_printer_type = is_same_printer_model();
confirm_text += _L("The printer type used to generate G-code is not the same type as the currently selected physical printer. It is recommend to re-slice by selecting the same printer type.\n");
if (!is_same_printer_type)
confirm_text += _L("The printer type used to generate G-code is not the same type as the currently selected physical printer. It is recommend to re-slice by selecting the same printer type.\n");
//Check slice warnings
bool has_slice_warnings = false;
@ -1776,9 +1777,13 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
if (dev) {
MachineObject* obj_ = dev->get_selected_machine();
for (auto warning : plate->get_slice_result()->warnings) {
if ((obj_->printer_type == "BL-P001" || obj_->printer_type == "BL-P002") && warning.msg == BED_TEMP_TOO_HIGH_THAN_FILAMENT) {
confirm_text += Plater::get_slice_warning_string(warning) + "\n";
} else {
if (warning.msg == BED_TEMP_TOO_HIGH_THAN_FILAMENT) {
if ((obj_->printer_type == "BL-P001" || obj_->printer_type == "BL-P002")) {
confirm_text += Plater::get_slice_warning_string(warning) + "\n";
has_slice_warnings = true;
}
}
else {
has_slice_warnings = true;
}
}