Use M73 progress instead of byte position if possible #15449
Merged
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
Currently M73 is ignored when printing from SD. But slicers has a lot more info to estimate overall difficulty of gcode in file instead of Marlin, which operates only byte position in file to show progress on LCD. Especially that effect visible on layers with many arcs, each of them results in a lot of gcode strings.
This patch will use provided progress in M73 command after first appearance in g-code file. If g-code file doesn't contains M73 old behavior will not changes.
PS: I wrote simple script for Cura to expose internal time estimation calculation to M73 commands on every layer change, just to usage example: https://github.com/LinFor/Marlin/blob/e-bot-skr/cura-profiles/scripts/EnrichPrintProgress.py
Benefits
More accurate print progress reporting on LCD if possible.
Related Issues
#13249, #12682