Skip to content

Feat/toolmap widget - #290

Merged
gmmcosta15 merged 11 commits into
devfrom
feat/toolmap-widget
Sep 24, 2026
Merged

gmmcosta15 merged 11 commits into
devfrom
feat/toolmap-widget

Conversation

@Robert0Mart

@Robert0Mart Robert0Mart commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • feature

BlocksScreen/lib/utils/toolmap.py

  • Redesigned tool Map Widget

BlocksScreen/devices/amu/models.py

  • added bowden Progress

BlocksScreen/lib/panels/filamentTab.py

  • implemented toolmap widget on load / unload (fallback to old load in case of no mmu)
  • in case error hides load/unload popup

BlocksScreen/lib/panels/mainWindow.py

  • connected in case error to filament tab

@Robert0Mart
Robert0Mart force-pushed the feat/toolmap-widget branch from 2bf16ef to d78dd7d Compare August 3, 2026 16:14
@Robert0Mart
Robert0Mart marked this pull request as ready for review August 4, 2026 09:28
@gmmcosta15
gmmcosta15 self-requested a review September 22, 2026 16:30

@gmmcosta15 gmmcosta15 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1. load_popup: BasePopup | None = None is dereferenced unguarded - amuPage load/unload lambdas and basicFilamentPanel.load_filament/unload_filament all call self.load_popup.show(). An AttributeError inside a Qt slot is qFatal() -> SIGABRT -> restart loop. Make it required keyword-only; both call sites already pass it by keyword.

# amuPage.py
def __init__(self, amu_manager, parent=None, *, load_popup: BasePopup):
# basicFilamentPanel.py
def __init__(self, printer: Printer, cfg, parent=None, *, load_popup: BasePopup) -> None:

2. in_case_error hides the popup but leaves load_state = True - the new flow is if self.load_state: ... elif action in (...), so after one error the popup never re-shows until an Idle clears the flag.

 def in_case_error(self):
+    self.load_state = False
     self.load_popup.hide()

3. AMUpage.__init__ assigns self.load_popup after _build_ui()

 self.amu_manager: AMUManager = amu_manager
+self.load_popup = load_popup
 self._build_ui()
-self.load_popup = load_popup

4. The widget is driven on every MMU status update even when the popup is hidden - set_filament_pos (starts a 500 ms animation) + 3x set_sensor + set_action + set_gate_color = 6 update() calls. Move the show/hide block above them, then gate.

if self.load_state:
    ...
elif mmu_state.action in ("Loading", "Unloading"):
    ...
if not self.load_popup.isVisible():
    return
self.load_status_widget.set_filament_pos(...)

5. _animate_fill_to restarts the animation on an unchanged target

 def _animate_fill_to(self, value: float) -> None:
+    if value == self._fill_animation.endValue():
+        return
     self._fill_animation.stop()

6. An invalid gate colour keeps the previous gate's colour - there is no else, so a colourless ga's fill.

 if parsed_color.isValid():
     self.load_status_widget.set_gate_color(parsed_color)
+else:
+    self.load_status_widget.set_gate_color(self._DEFAULT_FILL)

7. "Auxiliar Extruder" typo - filamentTab.on_mmu_state_changed plus the set_left_text docstring.

-self.load_status_widget.set_left_text("Auxiliar Extruder")
+self.load_status_widget.set_left_text("Auxiliary Extruder")

@gmmcosta15
gmmcosta15 merged commit dc879a3 into dev Sep 24, 2026
8 checks passed
@gmmcosta15
gmmcosta15 deleted the feat/toolmap-widget branch September 24, 2026 08:57
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.

3 participants