Skip to content

bugfix/layer progress mainsail parity#280

Merged
HugoCLSC merged 3 commits into
devfrom
bugfix/layer-progress-mainsail-parity
Jul 15, 2026
Merged

bugfix/layer progress mainsail parity#280
HugoCLSC merged 3 commits into
devfrom
bugfix/layer-progress-mainsail-parity

Conversation

@gmmcosta15

@gmmcosta15 gmmcosta15 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Select the type:

  • Feature
  • Bug fix
  • Code refactor
  • Documentation

Fixes the layer-count and progress-bar behaviour reported from the field. Follow-up to #269 and #272, whose stateless-layer approach did not hold on device.

  • Freeze the layer across a pause (set on pause click and paused state, released on printing) so the Happy Hare park Z-lift no longer bumps it to a bogus value.
  • Reset layer/total/progress on a new filename, so Mainsail-started prints clear stale values (previously only screen-started prints reset).
  • Compute progress as Mainsail file-relative (getPrintPercentByFilepositionRelative): clip file position to gcode_start_byte/gcode_end_byte, so start macros read 0% and the tail matches Mainsail; falls back to raw virtual_sdcard.progress.
  • On completion show 100% and the final layer = total, and stop blanking the counters.
  • Replace CustomProgressBar.setValue(float) (incompatible override, wrong 0-100 bound) with a clamped set_progress(fraction) and add a real reset() that clears the painted value.

Motivation

Progress used raw absolute file position, so start-print macros (mesh/plate calibration) showed ~4% and the end diverged from Mainsail.The pause layer jump and the stale/blank layer readouts came from the reset living only in the screen-initiated path and from Z-fallback recompute racing the pause state update.

Tests

11 new unit tests in test_job_status_page_unit.py, plus new test_progress_bar_unit.py).

@gmmcosta15 gmmcosta15 added the enhancement New feature or request. label Jul 14, 2026
@gmmcosta15 gmmcosta15 self-assigned this Jul 14, 2026
@gmmcosta15 gmmcosta15 requested a review from HugoCLSC July 14, 2026 15:44
@HugoCLSC HugoCLSC merged commit b20344d into dev Jul 15, 2026
5 of 7 checks passed
@HugoCLSC HugoCLSC deleted the bugfix/layer-progress-mainsail-parity branch July 15, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants