From 65e4b4d26d7c02ab372d0f62cdc64be5adbed1e6 Mon Sep 17 00:00:00 2001 From: Huibean Date: Mon, 11 Nov 2024 14:42:36 +0800 Subject: [PATCH] fix esc status label update after pannel close --- dronecan_gui_tool/panels/esc_panel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dronecan_gui_tool/panels/esc_panel.py b/dronecan_gui_tool/panels/esc_panel.py index ec84646..b224d56 100644 --- a/dronecan_gui_tool/panels/esc_panel.py +++ b/dronecan_gui_tool/panels/esc_panel.py @@ -13,6 +13,7 @@ from PyQt5.QtCore import QTimer, Qt from logging import getLogger from ..widgets import make_icon_button, get_icon, get_monospace_font +import sip __all__ = 'PANEL_NAME', 'spawn', 'get_icon' @@ -176,7 +177,8 @@ def __init__(self, parent, node): def _on_esc_status(self, msg): if msg.message.esc_index < len(self._sliders): sl = self._sliders[msg.message.esc_index] - sl.update_status(msg) + if sl and not sip.isdeleted(sl): + sl.update_status(msg) def _do_broadcast(self): try: