fix(job-status): current layer stuck at 0 during print - #336
Open
gmmcosta15 wants to merge 1 commit into
Open
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.
Description
Current layer showed
0/totalfor the whole print. Regression from #280:_reset_job_display()clearedlayer_fallback, and the Z-estimate could only be re-armed by aprint_stats.infoupdate, which Klipper never sends again when the slicer omitsSET_PRINT_STATS_INFO(unchanged field, so Moonraker never re-emits it).layer_fallbackgate for_reported_layer(sticky,Nonewhen Klipper reports nothing)._refresh_layer_display()mirrors Mainsail's pure getters:info.current_layerwins, else the Z estimate, recomputed on every filament advance and on metadata arrival._max_layers()followsgetPrintMaxLayersprecedence:info.total_layer-> metadatalayer_count-> geometry estimate._layer_from_z()keeps the last displayed layer when inputs are missing, so the counter never flickers back to 0.on_fileinfo()by filename:fileinfois a global signal, so browsing a file mid-print was overwriting the running job's totals.Motivation
The counter must be stable and match Mainsail, which computes it as a derived value every frame rather than behind a one-shot arming flag. Any flag armed only by an
infodelta is unreachable on printers whose gcode has noSET_PRINT_STATS_INFO, which is the field case that broke.