Skip to content

feat(gui): per-run cleaning options dialog - #58

Merged
Heerpa merged 3 commits into
developfrom
feature/clean-dialog-options
Nov 11, 2026
Merged

Heerpa merged 3 commits into
developfrom
feature/clean-dialog-options

Conversation

@Heerpa

@Heerpa Heerpa commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a per-run Clean tubings options dialog to the Fluid tab, replacing the bare confirm. The operator can choose:

  • Which reservoirs to clean — a checkable row per wired reservoir (reservoirs the loaded run used are pre-checked; unused wired ones can be added; any can be deselected; falls back to all-checked when the run marks none used).
  • Per-reservoir pump-out before cleaning — Default (the design's single pre_empty_volume), Calculated (loaded − injected, from an editable per-reservoir loaded volume), or Custom.
  • Which cleaning liquids to use (all on by default; ≥1 required when liquids are configured).

Backing changes

  • LegacyArchitecture.clean_tubings gains a res_to_clean override and accepts a {reservoir_id: volume} mapping for max_reservoir_vol (per-reservoir pre-empty).
  • SystemService.cleaning_plan() describes what the procedure would operate on; clean_tubings() forwards the dialog's overrides.
  • New optional cleaning.default_reservoir_load design field seeds the loaded-volume column.

When no fluid system/design is connected the old simple confirm + whole-system clean still applies.

Behavior change

  • A cleaning pre_empty_volume of 0 now skips the pre-empty (matching the field's long-standing tooltip); previously a literal 0 still pumped each reservoir's tubing dead-volume.

Tests

New coverage for the legacy override/per-reservoir pre-empty paths, the service plan/forwarding, and the dialog (defaults, modes, validity, pre-empty-only). Includes code-review follow-up fixes. black + flake8 clean.

Targets v0.3.6 (CHANGELOG stamped).

🤖 Generated with Claude Code

Heerpa and others added 3 commits November 11, 2026 09:48
…uids)

Triggering "Clean tubings" from the Fluid tab now opens a dialog instead of
a bare confirm, letting the operator tailor each cleaning run:

- which reservoirs to clean — a checkable row per wired reservoir (the ones
  the loaded run used are pre-checked; unused wired ones can be added, any
  can be deselected; falls back to all-checked when the run marks none used);
- a per-reservoir pre-empty pump-out — Default (the design's single
  pre_empty_volume), Calculated (loaded − injected, from an editable
  per-reservoir loaded volume), or a Custom value;
- which cleaning liquids to use (all on by default).

Backing changes:
- LegacyArchitecture.clean_tubings gains a res_to_clean override and accepts
  a {reservoir_id: volume} mapping for max_reservoir_vol (per-reservoir
  pre-empty; None/non-positive skips a reservoir).
- SystemService.cleaning_plan() describes what the procedure would operate on
  (reservoirs with injected + dead volumes, cleaning rounds, defaults);
  clean_tubings() forwards the dialog's res_to_clean / cleaning_reservoirs /
  pre_empty_volumes overrides.
- New optional cleaning.default_reservoir_load design field seeds the dialog's
  loaded-volume column.

When no fluid system/design is connected the old simple confirm + whole-system
clean still applies. Tests cover the new legacy/service paths and the dialog.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Require ≥1 cleaning liquid when liquids are configured: deselecting every
  liquid while keeping a pre-empty would otherwise pass validation and run a
  pre-empty-only clean that silently cleaned nothing. Pre-empty-only stays
  allowed only when no cleaning liquids are configured at all.
- cleaning_plan(): read values, not keys, when a raw legacy config carries
  cleaning_reservoirs as a {pos: entry} dict (mirrors clean_tubings).
- Prefill the Calculated-mode loaded volume when default_reservoir_load is 0
  (was skipped by a falsy-zero check).
- Collapse the double label computation in _build_reservoir_table.
- Doc: cleaning_plan's "injected" is the planned protocol total, not actual.
- CHANGELOG: note that a cleaning pre_empty_volume of 0 now skips the
  pre-empty (matching the field's tooltip; previously it still pumped the
  tubing dead-volume).

Tests cover the liquid-required validity rule, the pre-empty-only path, and
the dict cleaning_reservoirs plan.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Heerpa
Heerpa merged commit 90aa383 into develop Nov 11, 2026
6 checks passed
@Heerpa
Heerpa deleted the feature/clean-dialog-options branch November 11, 2026 10:21
@Heerpa Heerpa mentioned this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant