From 760aee89a934f180b122b288f6944871dba1d816 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Thu, 5 Nov 2026 14:07:39 +1100 Subject: [PATCH] hal_glib: clear the estop when the state leaves ESTOP for any state GStat emitted state-estop-reset only for ESTOP => ESTOP_RESET. A client that resets the estop and turns the machine on between two polls goes from ESTOP straight to ON, and qtdragon and gmoccapy kept showing the estop set on a machine that was on. --- lib/python/common/hal_glib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/python/common/hal_glib.py b/lib/python/common/hal_glib.py index 6227a3dae3b..3e6820a9959 100644 --- a/lib/python/common/hal_glib.py +++ b/lib/python/common/hal_glib.py @@ -615,8 +615,9 @@ def update(self): state_new = self.old['state'] if state_new != state_old: - # set machine estop/clear - if state_old == linuxcnc.STATE_ESTOP and state_new == linuxcnc.STATE_ESTOP_RESET: + # set machine estop/clear; a reset and machine on between two + # polls go from ESTOP straight to ON and still clear the estop + if state_old == linuxcnc.STATE_ESTOP: self.emit('state-estop-reset') self.emit('interp-idle') elif state_new == linuxcnc.STATE_ESTOP: