From 6301b8616772a5a8c4ba96e5466cded2396ad0e2 Mon Sep 17 00:00:00 2001 From: Martin Schmid Date: Fri, 28 Mar 2025 10:15:45 +0100 Subject: [PATCH 1/2] Fixed: Quotation bug in SMU filter method. --- devices/KEI2600.py | 3 ++- specifications/KEI2600.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/devices/KEI2600.py b/devices/KEI2600.py index 38cd694..29812a2 100644 --- a/devices/KEI2600.py +++ b/devices/KEI2600.py @@ -114,7 +114,8 @@ def toggle_measure_analog_filter(self, channel_idx: ChannelIndex, enable: bool, def toggle_filter(self, channel_idx: ChannelIndex, enable: bool, check_errors: bool = False) \ -> None: - self.execute(f'{self.__to_channel(channel_idx)}.measure.filter.enable = {self.__to_channel(channel_idx)}.{'FILTER_ON' if enable else 'FILTER_OFF'}') + self.execute( + f'{self.__to_channel(channel_idx)}.measure.filter.enable = {self.__to_channel(channel_idx)}.{"FILTER_ON" if enable else "FILTER_OFF"}') if check_errors: self.check_error_buffer() diff --git a/specifications/KEI2600.json b/specifications/KEI2600.json index c90ffd8..f73bdbc 100644 --- a/specifications/KEI2600.json +++ b/specifications/KEI2600.json @@ -69,7 +69,7 @@ "name": "toggle_filter", "type": "generated", "signature": "channel_idx: ChannelIndex, enable: bool", - "command": "f'{self.__to_channel(channel_idx)}.measure.filter.enable = {self.__to_channel(channel_idx)}.{'FILTER_ON' if enable else 'FILTER_OFF'}'" + "command": "f'{self.__to_channel(channel_idx)}.measure.filter.enable = {self.__to_channel(channel_idx)}.{\"FILTER_ON\" if enable else \"FILTER_OFF\"}'" }, { "name": "set_filter_type", From 02fabe247e25aa54fb6c99aaa783b5502aa844b2 Mon Sep 17 00:00:00 2001 From: Martin Schmid Date: Fri, 28 Mar 2025 10:46:17 +0100 Subject: [PATCH 2/2] Added abstract filter methods to SMU device type --- device_types/SMU.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/device_types/SMU.py b/device_types/SMU.py index 5fd8515..c31e302 100644 --- a/device_types/SMU.py +++ b/device_types/SMU.py @@ -91,6 +91,21 @@ def set_range(self, unit: ChannelUnit, channel_idx: ChannelIndex, mode: SMUMode, -> None: pass + @abstractmethod + def toggle_filter(self, channel_idx: ChannelIndex, enable: bool, check_errors: bool = False) \ + -> None: + pass + + @abstractmethod + def set_filter_type(self, channel_idx: ChannelIndex, filter_type: SMUFilterType, check_errors: bool = False) \ + -> None: + pass + + @abstractmethod + def set_filter_count(self, channel_idx: ChannelIndex, count: int, check_errors: bool = False) \ + -> None: + pass + @abstractmethod def set_sense_mode(self, channel_idx: ChannelIndex, sense_arg: SMUSense, check_errors: bool = False) \ -> None: