Repository navigation
fix(amu): block print starts that PRINT_START would refuse as unloaded - #363
Open
gmmcosta15 wants to merge 2 commits into
Open
gmmcosta15 wants to merge 2 commits into
gmmcosta15 wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Description
Starting a print on an unloaded machine left Happy-Hare running a job that had already been cancelled. RF50-Klipper's PRINT_START raised "Machine is unloaded", virtual_sdcard ran CANCEL_PRINT, and Happy-Hare's deferred auto-start re-opened the job (#358 closes that job afterwards). This PR runs the macro's unloaded check in BlocksScreen before the print is sent, so the start never happens and the screen says why.
Changes
print_start_refusal()returns why PRINT_START would refuse, using the macro's exact test (sensors.toolhead == False or sensors.mmu_pre_gate == False); a missing or disabled (None) sensor passes, as in the macrostart_printruns that check beforeJobStatusWidget.on_print_start; a refusal is logged and shown through a newnotifysignal, wired to the notification pageamu_manager; without one (no AMU) prints start as beforestart_printtoo, so it gets the same check as a fresh printMotivation
MMU_PRINT_START AUTOMATIC=1, which re-opens the job with the gear synced, FlowGuard armed and the tensioner in print modeconfig/print_start.cfginstead of reading HH's gate map, so BlocksScreen refuses exactly the starts the macro would refuseTests
TestPrintStartRefusal(no state, loaded/missing/disabled sensors, toolhead empty, gate empty, klippy disconnect drops the refusal), tests/widgets/test_print_start_guard_unit.py (start without AMU or refusal, refusal blocks and notifies)Future work
print_start_refusalin step withprint_start.cfgif the macro's condition changes