Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BlocksScreen/lib/panels/controlTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def __init__(
self.probe_helper_page.subscribe_config[list, "PyQt_PyObject"].connect(
self.printer.on_subscribe_config
)
self.printer.extruder_update.connect(self.probe_helper_page.on_extruder_update)
self.printer.gcode_move_update.connect(
self.probe_helper_page.on_gcode_move_update
)
Expand Down
29 changes: 26 additions & 3 deletions BlocksScreen/lib/panels/widgets/probeHelperPage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import typing

from lib.panels.widgets.basePopup import BasePopup
from lib.panels.widgets.loadWidget import LoadingOverlayWidget
from lib.panels.widgets.optionCardWidget import OptionCard
from lib.utils.blocks_button import BlocksCustomButton
from lib.utils.blocks_label import BlocksLabel
Expand All @@ -10,7 +8,6 @@
from PyQt6 import QtCore, QtGui, QtWidgets



class ProbeHelper(QtWidgets.QWidget):
request_back: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
name="request_back"
Expand Down Expand Up @@ -86,6 +83,8 @@ def __init__(self, parent: QtWidgets.QWidget) -> None:
self.update()
self.block_z = False
self.block_list = False
self.target_temp = 0
self.current_temp = 0

def on_klippy_status(self, state: str):
"""Handle Klippy status event change"""
Expand Down Expand Up @@ -411,6 +410,30 @@ def handle_start_tool(self, sender: typing.Type[OptionCard]) -> None:
return
self.run_gcode_signal.emit(_cmd)

@QtCore.pyqtSlot(str, str, float, name="on_extruder_update")
def on_extruder_update(
self, extruder_name: str, field: str, new_value: float
) -> None:
"""Handle extruder update"""
if not self.helper_initialize:
return
if self.target_temp != 0:
if self.current_temp == self.target_temp:
if self.isVisible:
self.call_load_panel.emit(True, "Extruder heated up \n Please wait")
return
if field == "temperature":
self.current_temp = round(new_value, 0)
if self.isVisible:
self.call_load_panel.emit(
True,
f"Heating up ({new_value}/{self.target_temp}) \n Please wait",
)
if field == "target":
self.target_temp = round(new_value, 0)
if self.isVisible:
self.call_load_panel.emit(True, "Cleaning the nozzle \n Please wait")

@QtCore.pyqtSlot(name="handle_accept")
def handle_accept(self) -> None:
"""Accepts the configured value from the calibration"""
Expand Down
Loading