Add ability to disable Power Loss Recovery on BBL machines (#11582)

* Add ability to disable Power Loss Recovery

* Fix typo in PrintConfig.hpp for power loss recovery

* Attempt to resolve Unknown option exception: disable_power_less_recovery

Add disable_power_loss_recovery property to any json which had scan_first_layer

* Revert "Attempt to resolve Unknown option exception: disable_power_less_recovery"

This reverts commit ddaf34b317.

* Fix typo

* Change attribution from BBS to Orca in PrintConfig.cpp

* Mini refactor power loss recovery handling in GCode export

- Moved power loss recovery G-code generation to a new method in GCodeWriter.
- Support Marlin 2

* Update comments and power loss recovery handling

* Implement power loss recovery G-code commands

Added functions to start and end power loss recovery with appropriate G-code commands and comments.

* Add power loss recovery methods to GCodeWriter

* refactor and fix build errors

---------

Co-authored-by: Michael Rook <michael@rook.id.au>
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Michael Rook
2025-12-11 02:19:57 +11:00
committed by GitHub
parent d8de54dfca
commit 5c547ea4a1
9 changed files with 54 additions and 25 deletions

View File

@@ -4360,11 +4360,13 @@ void TabPrinter::build_fff()
optgroup->append_single_option_line("preferred_orientation", "printer_basic_information_printable_space#preferred-orientation");
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
optgroup->append_single_option_line("printer_structure", "printer_basic_information_advanced#printer-structure");
optgroup->append_single_option_line("gcode_flavor", "printer_basic_information_advanced#g-code-flavor");
optgroup->append_single_option_line("pellet_modded_printer", "printer_basic_information_advanced#pellet-modded-printer");
optgroup->append_single_option_line("bbl_use_printhost", "printer_basic_information_advanced#use-3rd-party-print-host");
optgroup->append_single_option_line("scan_first_layer" , "printer_basic_information_advanced#scan-first-layer");
optgroup->append_single_option_line("enable_power_loss_recovery");
//option = optgroup->get_option("wrapping_exclude_area");
//option.opt.full_width = true;
//optgroup->append_single_option_line(option);
@@ -5199,7 +5201,11 @@ void TabPrinter::toggle_options()
// SoftFever: hide non-BBL settings
for (auto el : {"use_firmware_retraction", "use_relative_e_distances", "support_multi_bed_types", "pellet_modded_printer", "bed_mesh_max", "bed_mesh_min", "bed_mesh_probe_distance", "adaptive_bed_mesh_margin", "thumbnails"})
toggle_line(el, !is_BBL_printer);
auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
toggle_line("enable_power_loss_recovery", is_BBL_printer || gcf == gcfMarlinFirmware);
}
if (m_active_page->title() == L("Machine G-code")) {
PresetBundle *preset_bundle = wxGetApp().preset_bundle;