Emit Disable Power Loss Recovery (#11616)

* Emit Disable Power Loss Recovery

Now only works if it's enabled but the goal it's to force disable it.
With this change it will always emit the command for BBL or Marlin 2.

Co-Authored-By: Michael Rook <54159303+michaelr0@users.noreply.github.com>

* Refactor power loss recovery G-code comments

* Return empty power loss recovery when no compatible printer

* Update power loss recovery comments

Update label and tooltip for power loss recovery

* Add enum for power loss recovery mode

Refactored power loss recovery configuration to use a new PowerLossRecoveryMode enum instead of a boolean. Updated GCodeWriter and related logic to handle the new enum, allowing for 'printer_configuration', 'enable', and 'disable' options. Updated config handling, legacy value conversion, and default values accordingly.

* Update PrintConfig.cpp

---------

Co-authored-by: Michael Rook <54159303+michaelr0@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Ian Bassi
2025-12-30 13:16:47 -03:00
committed by GitHub
parent 0330e86007
commit 7c91459c37
6 changed files with 60 additions and 25 deletions

View File

@@ -61,7 +61,7 @@ public:
std::string set_input_shaping(char axis, float damp, float freq, std::string type) const;
std::string reset_e(bool force = false);
std::string update_progress(unsigned int num, unsigned int tot, bool allow_100 = false) const;
std::string enable_power_loss_recovery(bool enable);
std::string enable_power_loss_recovery(PowerLossRecoveryMode mode);
// return false if this extruder was already selected
bool need_toolchange(unsigned int filament_id) const;
std::string set_extruder(unsigned int filament_id);