Skip to content

Commit d2a0f67

Browse files
authored
bugfix: minor bugs across pages after PRs (#341)
## Description - [x] bugfix **BlocksScreen/lib/panels/filamentTab.py** - revert back if gate >1 lost on a pr **BlocksScreen/lib/panels/utilitiesTab.py** - removed unnecesarry connection **BlocksScreen/lib/panels/widgets/FilamentTab/spoolmanPage.py** - decreased maximun height **BlocksScreen/lib/panels/widgets/PrintTab/filesPage.py** - added minimum height **BlocksScreen/lib/panels/widgets/UtilitiesTab/routinePage.py** - fixed axis routine check not working
1 parent 84f6379 commit d2a0f67

5 files changed

Lines changed: 8 additions & 35 deletions

File tree

‎BlocksScreen/lib/panels/filamentTab.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,9 @@ def on_mmu_state_changed(self, mmu_state):
947947
self._previous_gate_states[gate_info.index] = current_state
948948

949949
if previous_state is False and current_state is True:
950-
self.popup_gates.append({"gate": gate_info.index})
951-
self.handle_popup()
950+
if len(mmu_state.gates) > 1:
951+
self.popup_gates.append({"gate": gate_info.index})
952+
self.handle_popup()
952953
elif previous_state is True and gate_info.status == GateStatus.EMPTY:
953954
self._clear_gate_map(gate_info)
954955

‎BlocksScreen/lib/panels/utilitiesTab.py‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ class UtilitiesTab(QtWidgets.QStackedWidget):
2323
run_gcode_signal: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
2424
str, name="run-gcode"
2525
)
26-
subscribe_config: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
27-
[list, "PyQt_PyObject"],
28-
[str, "PyQt_PyObject"],
29-
name="on-subscribe-config",
30-
)
3126
update_available: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
3227
bool, name="update-available"
3328
)
@@ -103,7 +98,6 @@ def __init__(
10398
self.printer.printer_config.connect(
10499
self.routines_page.on_printer_config_received
105100
)
106-
self.routines_page.subscribe_config.connect(self.subscribe_config)
107101
self.on_object_list.connect(self.routines_page.on_object_list)
108102

109103
# --- Axis Maintenance ---
@@ -126,13 +120,6 @@ def __init__(
126120
# --- Websocket/Printer Signals ---
127121
self.run_gcode_signal.connect(self.ws.api.run_gcode)
128122

129-
self.subscribe_config[str, "PyQt_PyObject"].connect(
130-
self.printer.on_subscribe_config
131-
)
132-
self.subscribe_config[list, "PyQt_PyObject"].connect(
133-
self.printer.on_subscribe_config
134-
)
135-
136123
def ask_input_shaper(self) -> None:
137124
"""Ask whether to run the automatic input shaper."""
138125
self.is_popup.show()

‎BlocksScreen/lib/panels/widgets/FilamentTab/spoolmanPage.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def showEvent(self, event: QtGui.QShowEvent | None) -> None: # noqa: N802
326326
return super().showEvent(event)
327327

328328
def _setup_ui(self) -> None: # noqa: N802
329-
self.setMaximumHeight(470)
329+
self.setMaximumHeight(410)
330330

331331
size_policy = QtWidgets.QSizePolicy(
332332
QtWidgets.QSizePolicy.Policy.MinimumExpanding,

‎BlocksScreen/lib/panels/widgets/PrintTab/filesPage.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ def _create_header_layout(self) -> QtWidgets.QHBoxLayout:
657657
layout.addStretch(1)
658658

659659
self._sort_combo = BlocksComboBox(parent=self)
660+
self._sort_combo.setMinimumWidth(200)
660661
for name in self.SORTING_TYPES:
661662
self._sort_combo.addItem(name)
662663
self._sort_combo.currentTextChanged.connect(self._on_sort_key_changed)

‎BlocksScreen/lib/panels/widgets/UtilitiesTab/routinePage.py‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ class RoutineCheckPage(QtWidgets.QWidget):
2323
request_tb_page: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
2424
name="request-tb-page"
2525
)
26-
subscribe_config: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
27-
[list, "PyQt_PyObject"],
28-
[str, "PyQt_PyObject"],
29-
name="on-subscribe-config",
30-
)
3126

3227
HOMED_AXES = frozenset("xyz")
3328

@@ -99,20 +94,9 @@ def on_object_list(self, object_list: list):
9994
if base_name == "fan_generic" or base_name == "fan":
10095
self.fans.append(obj.removeprefix(base_name + " "))
10196

102-
@QtCore.pyqtSlot(dict, name="on_object_config")
103-
@QtCore.pyqtSlot(list, name="on_object_config")
104-
def on_object_config(self, config: dict | list) -> None:
105-
"""Handle receiving printer object configurations"""
106-
if not config:
107-
return
108-
self.axis_limits.update(self.parse_axis_limits(config))
109-
11097
def on_printer_config_received(self, config: dict) -> None:
111-
"""Handle printer configuration"""
112-
for axis in ("x", "y", "z"):
113-
self.subscribe_config[str, "PyQt_PyObject"].emit(
114-
f"stepper_{axis}", self.on_object_config
115-
)
98+
"""Read the stepper travel ranges from the printer configuration."""
99+
self.axis_limits = self.parse_axis_limits(config)
116100

117101
@QtCore.pyqtSlot(str, str, name="on_toolhead_update")
118102
def on_toolhead_update(self, field: str, value: str) -> None:
@@ -288,7 +272,7 @@ def parse_axis_limits(
288272
if pos_min is None and pos_max is None:
289273
continue
290274

291-
low = float(pos_min) if pos_min is not None else -math.inf
275+
low = float(pos_min) if pos_min is not None else 0.0
292276
high = float(pos_max) if pos_max is not None else math.inf
293277

294278
endstop_raw = value.get("position_endstop")

0 commit comments

Comments
 (0)