Fix: chamber filtration fan does not resume after re-enabling backend#5178
Open
holdenkilbride wants to merge 1 commit intoprusa3d:masterfrom
Open
Fix: chamber filtration fan does not resume after re-enabling backend#5178holdenkilbride wants to merge 1 commit intoprusa3d:masterfrom
holdenkilbride wants to merge 1 commit intoprusa3d:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the chamber filtration backend is changed to None during an active print and then restored to Advanced Filtration or DIY, the filtration fan never comes back on for the remainder of that print.
In ChamberFiltration::step(), the disabled path (!is_enabled()) was setting needs_filtration_ = false. When the backend is re-enabled, update_needs_filtration() is called but immediately returns early due to the has_value() guard (intended to preserve M147/M148 gcode overrides). Since needs_filtration_ holds false, the fan stays off.
Fix
Set needs_filtration_ = std::nullopt instead of false in the disabled path. nullopt means "unknown — re-evaluate on next print cycle", which bypasses the M147/M148 guard and allows update_needs_filtration() to re-evaluate filament types and restore filtration correctly.
Why
False is a valid evaluated state meaning "this print does not require filtration." Using it here conflated two distinct states: "evaluated and not needed" vs "not yet evaluated." nullopt is the correct sentinel for the latter.
Behavior unchanged for:
Fixes [BUG] Toggling advanced filtration during a print will not re-enable filtration #5173