Feat/toolmap widget - #290
Conversation
2bf16ef to
d78dd7d
Compare
There was a problem hiding this comment.
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_popup4. 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")
Description
BlocksScreen/lib/utils/toolmap.py
BlocksScreen/devices/amu/models.py
BlocksScreen/lib/panels/filamentTab.py
BlocksScreen/lib/panels/mainWindow.py