diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 6193b04d39..a4804b4854 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -7335,8 +7335,16 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) stream << " <" << PLATE_TAG << ">\n"; //plate index stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << PLATE_IDX_ATTR << "\" " << VALUE_ATTR << "=\"" << plate_data->plate_index + 1 << "\"/>\n"; - stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << TIMELAPSE_TYPE_ATTR << "\" " << VALUE_ATTR << "=\"" << int(config.opt_enum("timelapse_type")) << "\"/>\n"; - stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << TIMELAPSE_ERROR_CODE_ATTR << "\" " << VALUE_ATTR << "=\"" << plate_data->timelapse_warning_code << "\"/>\n"; + + int timelapse_type = int(config.opt_enum("timelapse_type")); + for (auto it = plate_data->warnings.begin(); it != plate_data->warnings.end(); it++) { + if (it->msg == NOT_GENERATE_TIMELAPSE) { + timelapse_type = -1; + break; + } + } + stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << TIMELAPSE_TYPE_ATTR << "\" " << VALUE_ATTR << "=\"" << timelapse_type << "\"/>\n"; + //stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << TIMELAPSE_ERROR_CODE_ATTR << "\" " << VALUE_ATTR << "=\"" << plate_data->timelapse_warning_code << "\"/>\n"; stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << SLICE_PREDICTION_ATTR << "\" " << VALUE_ATTR << "=\"" << plate_data->get_gcode_prediction_str() << "\"/>\n"; stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << SLICE_WEIGHT_ATTR << "\" " << VALUE_ATTR << "=\"" << plate_data->get_gcode_weight_str() << "\"/>\n"; stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << OUTSIDE_ATTR << "\" " << VALUE_ATTR << "=\"" << std::boolalpha<< plate_data->toolpath_outside << "\"/>\n"; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index ffcd3ec12d..33fef6e970 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1169,6 +1169,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_timelapse_warning_code += (1 << 1); } m_processor.result().timelapse_warning_code = m_timelapse_warning_code; + m_processor.result().support_traditional_timelapse = m_support_traditional_timelapse; m_processor.finalize(true); // DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics); DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics); @@ -3542,6 +3543,9 @@ GCode::LayerResult GCode::process_layer( log_memory_info(); if (!has_wipe_tower && need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode) { + if (m_support_traditional_timelapse) + m_support_traditional_timelapse = false; + gcode += this->retract(false, false, LiftType::NormalLift); m_writer.add_object_change_labels(gcode); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 3c8fefc73a..5de5a6ddfa 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -492,6 +492,7 @@ private: std::string _encode_label_ids_to_base64(std::vector ids); int m_timelapse_warning_code = 0; + bool m_support_traditional_timelapse = true; bool m_silent_time_estimator_enabled; diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index b84e9aacfc..59ad386b76 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -4335,12 +4335,26 @@ void GCodeProcessor::update_slice_warnings() // bbs:HRC checker warning.params.clear(); warning.level = 1; - if (m_result.timelapse_warning_code != 0) { + if (!m_result.support_traditional_timelapse) { warning.msg = NOT_SUPPORT_TRADITIONAL_TIMELAPSE; warning.error_code = "1000C003"; m_result.warnings.push_back(warning); } + if (m_result.timelapse_warning_code != 0) { + if (m_result.timelapse_warning_code & 1) { + warning.msg = NOT_GENERATE_TIMELAPSE; + warning.error_code = "1001C001"; + m_result.warnings.push_back(warning); + } + + if ((m_result.timelapse_warning_code >> 1) & 1) { + warning.msg = NOT_GENERATE_TIMELAPSE; + warning.error_code = "1001C002"; + m_result.warnings.push_back(warning); + } + } + m_result.warnings.shrink_to_fit(); } diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 300276739f..7c3736d441 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -21,6 +21,7 @@ namespace Slic3r { #define NOZZLE_HRC_CHECKER "the_actual_nozzle_hrc_smaller_than_the_required_nozzle_hrc" #define BED_TEMP_TOO_HIGH_THAN_FILAMENT "bed_temperature_too_high_than_filament" #define NOT_SUPPORT_TRADITIONAL_TIMELAPSE "not_support_traditional_timelapse" +#define NOT_GENERATE_TIMELAPSE "not_generate_timelapse" enum class EMoveType : unsigned char { @@ -181,6 +182,7 @@ namespace Slic3r { //BBS: add object_label_enabled bool label_object_enabled; int timelapse_warning_code {0}; + bool support_traditional_timelapse{true}; float printable_height; SettingsIds settings_ids; size_t extruders_count; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f9bd7bad23..ae6b68651c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2841,7 +2841,10 @@ wxString Plater::get_slice_warning_string(GCodeProcessorResult::SliceWarning& wa return _L("The nozzle hardness required by the filament is higher than the default nozzle hardness of the printer. Please replace the hardened nozzle or filament, otherwise, the nozzle will be attrited or damaged."); } else if (warning.msg == NOT_SUPPORT_TRADITIONAL_TIMELAPSE) { return _L("Enabling traditional timelapse photography may cause surface imperfections. It is recommended to change to smooth mode."); - } else { + } else if (warning.msg == NOT_GENERATE_TIMELAPSE) { + return wxString(); + } + else { return wxString(warning.msg); } } diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 6368c715dc..50bbf7e595 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -2160,12 +2160,17 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector> 1) & 1) { - msg_text = _L("When print by object, machines with I3 structure will not generate timelapse videos."); + wxString msg_text; + PartPlate *plate = m_plater->get_partplate_list().get_curr_plate(); + for (auto warning : plate->get_slice_result()->warnings) { + if (warning.msg == NOT_GENERATE_TIMELAPSE) { + if (warning.error_code == "1001C001") { + msg_text = _L("When enable spiral vase mode, machines with I3 structure will not generate timelapse videos."); + } + else if (warning.error_code == "1001C002") { + msg_text = _L("When print by object, machines with I3 structure will not generate timelapse videos."); + } + } } update_print_status_msg(msg_text, true, true); Enable_Send_Button(true); @@ -2291,6 +2296,9 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) has_slice_warnings = true; } } + else if (warning.msg == NOT_GENERATE_TIMELAPSE) { + continue; + } else { wxString error_info = Plater::get_slice_warning_string(warning); if (error_info.IsEmpty()) { @@ -3197,7 +3205,7 @@ void SelectMachineDialog::update_show_status() } } - if (get_timelapse_warning_code() != 0) { + if (has_timelapse_warning()) { show_status(PrintDialogStatus::PrintStatusTimelapseWarning); return; } @@ -3268,16 +3276,22 @@ void SelectMachineDialog::update_show_status() } } -int SelectMachineDialog::get_timelapse_warning_code() +bool SelectMachineDialog::has_timelapse_warning() { PartPlate *plate = m_plater->get_partplate_list().get_curr_plate(); - return plate->timelapse_warning_code(); + for (auto warning : plate->get_slice_result()->warnings) { + if (warning.msg == NOT_GENERATE_TIMELAPSE) { + return true; + } + } + + return false; } void SelectMachineDialog::update_timelapse_enable_status() { AppConfig *config = wxGetApp().app_config; - if (get_timelapse_warning_code() == 0) { + if (!has_timelapse_warning()) { if (!config || config->get("print", "timelapse") == "0") m_checkbox_list["timelapse"]->SetValue(false); else diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index c33e282f22..0b85eab444 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -444,7 +444,7 @@ public: void update_print_error_info(int code, std::string msg, std::string extra); void set_flow_calibration_state(bool state); bool is_show_timelapse(); - int get_timelapse_warning_code(); + bool has_timelapse_warning(); void update_timelapse_enable_status(); bool is_same_printer_model(); bool is_blocking_printing();