| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- 40 unit tests across 8 test classes covering all public slots: on_print_start, _handle_print_state, on_print_stats_update, on_gcode_move_update, virtual_sdcard_update, pause_resume_print, handleCancel, on_fileinfo - tests/widgets/conftest.py: fix cross-suite isolation (clears empty lib.* stubs registered by network conftest, ensures BlocksScreen/on sys.path) - jobStatusPage: frozenset class constants, compound guard, if/elif chains, _post_event helper, walrus list comprehension, removed no-op QPixmap.scaled, removed spurious show() on collapse
…slots (#258) # Description Select the type: - [ ] Feature - [x] Bug fix - [ ] Code refactor - [ ] Documentation Follow-up hardening for the `jobStatusPage` layer logic introduced in **#208**. Fixes a field-observed bug where the current-layer counter jumped whenever the toolhead raised Z (travel moves / Z-hop) to reach another region of the plate, and aligns the layer-source priority with Mainsail's getters. - Reject transient Z rises: the current layer now commits an advance only once Z has settled (confirmed across two samples) and never regresses, so Z-hop and travel moves no longer bump the layer number. - Respect reported totals: a Klipper-reported `print_stats.info.total_layer` (or `current_file.layer_count`) is no longer overwritten by the geometry estimate, matching Mainsail's `getPrintMaxLayers` priority. - `on_flowguard_update`: renamed params that shadowed the `str`/`dict` builtins, added type hints, and applied each key independently so a partial delta no longer raises `KeyError`. - `handleCancel`: replaced the disconnect+reconnect dance with a single `UniqueConnection` (guarded) connect. - `showEvent`: now calls `super().showEvent()`. - Simplified `toggle_thumbnail_expansion`, merged the duplicate valid-state branch in `_handle_print_state`, and tidied the print-stats dispatch. # Motivation The Z-based layer fallback read the instantaneous `gcode_move.gcode_position[2]`, so any non-print Z motion (Z-hop, travel to a taller area) was interpreted as a layer change and the counter flickered. Since `gcode_position` is published on essentially every move, a two-sample "Z settled" filter reliably distinguishes a real layer advance from a transient hop while keeping the counter monotonic. The layer-source priority was also corrected to match Mainsail so a reported total layer count is never clobbered by the geometry estimate. # Tests New/updated cases: transient Z-hop does not bump the layer, layer never regresses, reported `total_layer` not overridden by estimate, flowguard partial vs full payload, plus the two-sample settle behavior. Co-authored-by: Hugo Costa <hugo.santos.costa@gmail.com>
## Description - [x] bugfix **BlocksScreen/lib/panels/widgets/jobStatusPage.py** - fixed bug brought back on pr #208 **tests/widgets/test_job_status_page_unit.py** - commented some test ## TODO - probeHelperPage is calling to get shown at the start of machine , normally dosent affect anything but trying to make jobstatuspage show when paused dosent work because of that --------- Co-authored-by: Roberto Martins <roberto.martins@blockstec.com>
| Back | FazBrowse Home | New Git URL |
Description
Refactors helper_methods.py and jobStatusPage.py, and adds a full unit test suite for JobStatusWidget.
jobStatusPage.py
helper_methods.py
tests/widgets/test_job_status_page_unit.py - 40 unit tests
tests/widgets/conftest.py
Motivation
The refactors reduce duplicated code and allocation overhead in the hottest print-progress paths. The test suite documents the expected slot behaviour and will catch regressions in the state machine, signal wiring, and layer-calculation logic.
Tests
Widget tests alone: 40 passed