From 7953752593a40b3e5c042d1c1ed1b568ca96dea4 Mon Sep 17 00:00:00 2001 From: MAKOMO Date: Wed, 28 Feb 2024 14:36:02 +0100 Subject: [PATCH] gain focus on MPL canvas click --- src/artisanlib/canvas.py | 2 +- src/artisanlib/pid.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/artisanlib/canvas.py b/src/artisanlib/canvas.py index e2312f8b1..0b449057f 100644 --- a/src/artisanlib/canvas.py +++ b/src/artisanlib/canvas.py @@ -2943,7 +2943,7 @@ def disconnect_draggableannotations_motion_notifiers(self) -> None: pass def onclick(self, event:'MouseEvent') -> None: - self.aw.lcd1.setFocus() # we set the focus to the LCD1 on clicking the MPL canvas to (re-)gain focus while the event minieditor is open + self.aw.setFocus() # we set the focus to the ApplicationWindow on clicking the MPL canvas to (re-)gain focus while the event minieditor is open try: if self.ax is None: return diff --git a/src/artisanlib/pid.py b/src/artisanlib/pid.py index 5366d52c8..322fc56e6 100644 --- a/src/artisanlib/pid.py +++ b/src/artisanlib/pid.py @@ -326,7 +326,8 @@ def getDuty(self) -> Optional[float]: if self.pidSemaphore.available() < 1: self.pidSemaphore.release(1) - def derivativeFilter(self) -> LiveSosFilter: + @staticmethod + def derivativeFilter() -> LiveSosFilter: return LiveSosFilter( scipy.signal.iirfilter(1, # order Wn=0.2, # 0 < Wn < fs/2 (fs=1 -> fs/2=0.5)