From 11e4e4abdbe5b6afc55aad88f59d7d6458e4da0f Mon Sep 17 00:00:00 2001 From: Michael Rook Date: Fri, 5 Dec 2025 19:35:47 +1100 Subject: [PATCH] Add ability to disable Power Loss Recovery --- localization/i18n/OrcaSlicer.pot | 6 ++++++ localization/i18n/en/OrcaSlicer_en.po | 6 ++++++ resources/profiles/BBL/machine/fdm_machine_common.json | 1 + src/libslic3r/GCode.cpp | 6 +++--- src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 6 ++++++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/Tab.cpp | 3 ++- 8 files changed, 26 insertions(+), 5 deletions(-) diff --git a/localization/i18n/OrcaSlicer.pot b/localization/i18n/OrcaSlicer.pot index accaf4ea66..7bc12d5f9b 100644 --- a/localization/i18n/OrcaSlicer.pot +++ b/localization/i18n/OrcaSlicer.pot @@ -12623,6 +12623,12 @@ msgid "" "layer." msgstr "" +msgid "Disable Power Loss Recovery" +msgstr "" + +msgid "Enable this to disable power loss recovery commands in generated G-code" +msgstr "" + msgid "Nozzle type" msgstr "" diff --git a/localization/i18n/en/OrcaSlicer_en.po b/localization/i18n/en/OrcaSlicer_en.po index 0cc2afa02e..6dab2983ad 100644 --- a/localization/i18n/en/OrcaSlicer_en.po +++ b/localization/i18n/en/OrcaSlicer_en.po @@ -12912,6 +12912,12 @@ msgstr "" "Enable this to allow the camera on the printer to check the quality of the " "first layer." +msgid "Disable Power Loss Recovery" +msgstr "Disable Power Loss Recovery" + +msgid "Enable this to disable power loss recovery commands in generated G-code" +msgstr "Enable this to disable power loss recovery commands in generated G-code" + msgid "Nozzle type" msgstr "" diff --git a/resources/profiles/BBL/machine/fdm_machine_common.json b/resources/profiles/BBL/machine/fdm_machine_common.json index e33d6b9f9b..8dc151ab3b 100644 --- a/resources/profiles/BBL/machine/fdm_machine_common.json +++ b/resources/profiles/BBL/machine/fdm_machine_common.json @@ -136,6 +136,7 @@ "60" ], "scan_first_layer": "0", + "disable_power_loss_recovery": "0", "silent_mode": "0", "single_extruder_multi_material": "1", "support_air_filtration": "0", diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a5af72f4c9..6229926372 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3086,7 +3086,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato //BBS: close powerlost recovery { - if (is_bbl_printers && m_second_layer_things_done) { + if (is_bbl_printers && m_second_layer_things_done && print.config().disable_power_loss_recovery.value != true) { file.write("; close powerlost recovery\n"); file.write("M1003 S0\n"); } @@ -3168,7 +3168,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato //BBS: close powerlost recovery { - if (is_bbl_printers && m_second_layer_things_done) { + if (is_bbl_printers && m_second_layer_things_done && print.config().disable_power_loss_recovery.value != true) { file.write("; close powerlost recovery\n"); file.write("M1003 S0\n"); } @@ -4388,7 +4388,7 @@ LayerResult GCode::process_layer( if (!first_layer && !m_second_layer_things_done) { if (print.is_BBL_printer()) { // BBS: open powerlost recovery - { + if (print.config().disable_power_loss_recovery.value != true) { gcode += "; open powerlost recovery\n"; gcode += "M1003 S1\n"; } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 1dcdd83000..af176e0d45 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1007,7 +1007,7 @@ static std::vector s_Preset_printer_options { "nozzle_height", "master_extruder_id", "default_print_profile", "inherits", "silent_mode", - "scan_first_layer", "wrapping_detection_layers", "wrapping_exclude_area", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", + "scan_first_layer", "disable_power_less_recovery", "wrapping_detection_layers", "wrapping_exclude_area", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", "nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","printer_structure", "best_object_pos", "head_wrap_detect_zone", "host_type", "print_host", "printhost_apikey", "bbl_use_printhost", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 070dc35215..31e0c484a7 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3364,6 +3364,12 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(false)); + // BBS + def = this->add("disable_power_loss_recovery", coBool); + def->label = L("Disable Power Loss Recovery"); + def->tooltip = L("Enable this to disable power loss recovery commands in generated G-code"); + def->mode = comDevelop; + def->set_default_value(new ConfigOptionBool(false)); //BBS // def = this->add("spaghetti_detector", coBool); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index cc0c765530..c697b725e4 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1272,6 +1272,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionIntsNullable, filament_flush_temp)) // BBS ((ConfigOptionBool, scan_first_layer)) + ((ConfigOptionsBool, disable_power_loss_recovery)) ((ConfigOptionBool, enable_wrapping_detection)) ((ConfigOptionInt, wrapping_detection_layers)) ((ConfigOptionPoints, wrapping_exclude_area)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5c12a960bc..642a3f19b6 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4356,6 +4356,7 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("pellet_modded_printer", "pellet-flow-coefficient"); optgroup->append_single_option_line("bbl_use_printhost"); optgroup->append_single_option_line("scan_first_layer"); + optgroup->append_single_option_line("disable_power_loss_recovery"); //option = optgroup->get_option("wrapping_exclude_area"); //option.opt.full_width = true; //optgroup->append_single_option_line(option); @@ -5181,7 +5182,7 @@ void TabPrinter::toggle_options() if (m_active_page->title() == L("Basic information")) { // SoftFever: hide BBL specific settings - for (auto el : {"scan_first_layer", "bbl_calib_mark_logo", "bbl_use_printhost"}) + for (auto el : {"scan_first_layer", "disable_power_loss_recovery", "bbl_calib_mark_logo", "bbl_use_printhost"}) toggle_line(el, is_BBL_printer); // SoftFever: hide non-BBL settings