From a3d3184d6cff8d5c54da1378f7d1bdb7ea27f920 Mon Sep 17 00:00:00 2001 From: kruger <kruger@astron.nl> Date: Wed, 12 Jun 2024 08:55:14 +0100 Subject: [PATCH] fix monitor mask bug --- pypcc/config/RECVTR_HB.yaml | 14 +++++++------- pypcc/config/RECVTR_LB.yaml | 16 ++++++++-------- pypcc/opcuaserv/yamlreader.py | 4 ++++ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/pypcc/config/RECVTR_HB.yaml b/pypcc/config/RECVTR_HB.yaml index 7a764b5..63f64a9 100644 --- a/pypcc/config/RECVTR_HB.yaml +++ b/pypcc/config/RECVTR_HB.yaml @@ -358,7 +358,7 @@ variables: dim: 32 monitor: true read_parallel: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_3V3 description: RCU 3.3V voltage (V) @@ -371,7 +371,7 @@ variables: dim: 32 read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_1V8 description: RCU 1.8V voltage (V) @@ -384,7 +384,7 @@ variables: dim: 32 read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_2V5 description: RCU 2.5V voltage (V) @@ -397,7 +397,7 @@ variables: dim: 32 read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANT_VOUT description: Voltage on antenna output of RCU (V). Controlled by ANT_PWR_ON. @@ -411,7 +411,7 @@ variables: dim2: [3,32] read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANT_VIN description: RCU antenna voltage before switch (V) @@ -425,7 +425,7 @@ variables: dim2: [3,32] read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANT_IOUT description: Current drawn on antenna output of RCU (A). 15mA offset due to LED on RCU @@ -439,7 +439,7 @@ variables: dim2: [3,32] read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_DIGITAL_on description: RCU digital power enable. Controlled by calling RCU_on/RCU_off diff --git a/pypcc/config/RECVTR_LB.yaml b/pypcc/config/RECVTR_LB.yaml index b753491..d97593c 100644 --- a/pypcc/config/RECVTR_LB.yaml +++ b/pypcc/config/RECVTR_LB.yaml @@ -317,7 +317,7 @@ variables: dim: 32 monitor: true read_parallel: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_3V3 description: RCU 3.3V voltage (V) @@ -330,7 +330,7 @@ variables: dim: 32 read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_1V8 description: RCU 1.8V voltage (V) @@ -343,7 +343,7 @@ variables: dim: 32 read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_2V5 description: RCU 2.5V voltage (V) @@ -356,7 +356,7 @@ variables: dim: 32 read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANT_VOUT description: Voltage on antenna output of RCU (V). Controlled by ANT_PWR_ON. @@ -370,7 +370,7 @@ variables: dim2: [3,32] read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANT_VIN description: RCU antenna voltage before switch (V) @@ -384,7 +384,7 @@ variables: dim2: [3,32] read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANT_IOUT description: Current drawn on antenna output of RCU (A). 15mA offset due to LED on RCU @@ -398,7 +398,7 @@ variables: dim2: [3,32] read_parallel: true monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_DIGITAL_on description: RCU digital power enable. Controlled by calling RCU_on/RCU_off @@ -422,7 +422,7 @@ variables: dtype: boolean dim: 32 monitor: true - mask: RECVTR_I2C_error +# mask: RECVTR_I2C_error - name: RCU_PWR_ANALOG_on description: RCU analog power enable. Controlled by RCU_on/off diff --git a/pypcc/opcuaserv/yamlreader.py b/pypcc/opcuaserv/yamlreader.py index f82d969..5c9183b 100644 --- a/pypcc/opcuaserv/yamlreader.py +++ b/pypcc/opcuaserv/yamlreader.py @@ -191,6 +191,8 @@ class yamlreader(yamlconfig): mask=Find(self.conf['variables'],'name',mask) if not(mask): continue; mask=mask.get('OPCR',None) + if (mask is None): + mask=mask.get('OPCW',None) if (mask==None): continue; v['maskOPC']=mask if not self.monitorvarid is None: @@ -319,6 +321,8 @@ class yamlreader(yamlconfig): v=self.conf['variables'][self.monitorvarcnt]; if v.get('monitor'): mask=(v['maskOPC'].get_value() if v.get('maskOPC') else []) + if isinstance(mask,list) and (len(mask)>0) and isinstance(mask[0],int): + mask=[m==0 for m in mask] # print("monitor",v['name'],mask) # self.SetBusy() self.lastRecv=time.time() -- GitLab