From 3a52f9d31c79897da598fc9be1f0946390ee7bd5 Mon Sep 17 00:00:00 2001 From: Oksana Shliakhtun Date: Wed, 1 Mar 2023 17:47:50 +0100 Subject: [PATCH] fixes in lakeshore alarm Change-Id: Ibbcbe94d9a64d1c074025183e1310506a2cb00f4 --- frappy_psi/lakeshore.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frappy_psi/lakeshore.py b/frappy_psi/lakeshore.py index ab326d0..9bb3120 100644 --- a/frappy_psi/lakeshore.py +++ b/frappy_psi/lakeshore.py @@ -18,7 +18,7 @@ # Module authors: # Oksana Shliakhtun # ***************************************************************************** -from math import log2 + from frappy.core import Readable, Parameter, IntRange, EnumType, FloatRange, \ StringIO, HasIO, StringType, Property, Writable, Drivable, IDLE, ERROR, \ @@ -52,8 +52,6 @@ class Sensor340(LakeShore, Readable): # define the communication class to create the IO module ioClass = Ls340IO channel = Property('lakeshore channel', StringType()) - # relay_mode = Property('relay setting mode', IntRange(0, 2)) - # relay = Property('relay high/low', IntRange(1, 2)) alarm = Parameter('alarm limit', FloatRange(unit='K'), readonly=False) # # define or alter the parameters # as Readable.value exists already, we give only the modified property 'unit' @@ -77,8 +75,8 @@ class Sensor340(LakeShore, Readable): if c % 2: return ERROR, 'invalid reading' # ask for high alarm status and return warning - if '1' in str(self.communicate(f'ALARMST? {self.channel}')): - return Warning + if '1' in self.communicate(f'ALARMST? {self.channel}'): + return WARN, 'alarm triggered' return IDLE, '' def write_alarm(self, alarm):