Skip to content

Fix: chamber filtration fan does not resume after re-enabling backend#5178

Open
holdenkilbride wants to merge 1 commit intoprusa3d:masterfrom
holdenkilbride:filtration-fix
Open

Fix: chamber filtration fan does not resume after re-enabling backend#5178
holdenkilbride wants to merge 1 commit intoprusa3d:masterfrom
holdenkilbride:filtration-fix

Conversation

@holdenkilbride
Copy link
Copy Markdown

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Toggling advanced filtration during a print will not re-enable filtration

1 participant