Skip to content
Snippets Groups Projects
Commit ba719de9 authored by Paulus Kruger's avatar Paulus Kruger
Browse files

Unit conversion, Kelvin2Degrees, period2RMS added

parent f4f244a1
No related branches found
No related tags found
No related merge requests found
...@@ -243,6 +243,7 @@ variables: ...@@ -243,6 +243,7 @@ variables:
devreg: VSENSE.Temp devreg: VSENSE.Temp
width: 23 width: 23
scale: 3.8265e-3 scale: 3.8265e-3
convert_unit: Kelvin2Celsius
rw: ro rw: ro
dtype: double dtype: double
monitor: true monitor: true
......
...@@ -103,7 +103,7 @@ variables: ...@@ -103,7 +103,7 @@ variables:
rw: ro rw: ro
dtype: double dtype: double
scale: 1.52588e-5 #FAN_TACHS/TACH_COUNT_FREQ/TACH_PERIODS = 1/8192/16 *2 scale: 1.52588e-5 #FAN_TACHS/TACH_COUNT_FREQ/TACH_PERIODS = 1/8192/16 *2
# monitor: true monitor: true
methods: methods:
- name: APSPUTR_Init #Called after startup to load. Should have all stored registers - name: APSPUTR_Init #Called after startup to load. Should have all stored registers
......
...@@ -304,6 +304,7 @@ variables: ...@@ -304,6 +304,7 @@ variables:
devreg: AN.Temp devreg: AN.Temp
width: 23 width: 23
scale: 4.21e-3 scale: 4.21e-3
convert_unit: Kelvin2Celsius
rw: ro rw: ro
dtype: double dtype: double
dim: 32 dim: 32
......
...@@ -4,6 +4,7 @@ import time ...@@ -4,6 +4,7 @@ import time
from yamlconfig import * from yamlconfig import *
import logging import logging
from .smbus_float import * from .smbus_float import *
from .convert_unit import *
def bytes2int(bts): def bytes2int(bts):
x=0; x=0;
for b in bts: for b in bts:
...@@ -196,6 +197,9 @@ class yamlreader(yamlconfig): ...@@ -196,6 +197,9 @@ class yamlreader(yamlconfig):
else: else:
scale=float(scale) scale=float(scale)
data2=[(d*scale) for d in data2] data2=[(d*scale) for d in data2]
convert=v.get("convert_unit")
if convert: data2=[eval(convert)(d) for d in data2]
var1=v.get('OPCR') var1=v.get('OPCR')
if not(var1): var1=v.get('OPCW') if not(var1): var1=v.get('OPCW')
if not(var1): if not(var1):
......
from test_common import * from test_common import *
name="RCU_PWR_ANT_on" name="RCU_PWR_ANT_on"
RCU=[0,1,2,3]; RCU=[2];
On=[True,True,True] On=[True,True,True]
#On=[False,False,False] #On=[False,False,False]
#Att=[10,10,10] #Att=[10,10,10]
......
...@@ -3,8 +3,8 @@ connect("opc.tcp://localhost:4843/") ...@@ -3,8 +3,8 @@ connect("opc.tcp://localhost:4843/")
#callmethod("APSCT_off") #callmethod("APSCT_off")
#time.sleep(1) #time.sleep(1)
#callmethod("APSCT_200MHz_on") callmethod("APSCT_200MHz_on")
callmethod("APSCT_160MHz_on") #callmethod("APSCT_160MHz_on")
for x in range(10): for x in range(10):
busy=get_value("APSCTTR_translator_busy_R") busy=get_value("APSCTTR_translator_busy_R")
print(busy) print(busy)
......
from test_common import * from test_common import *
connect()
RCUs=[0,1,2,3]; RCUs=[0,1,2,3];
setRCUmask(RCUs) setRCUmask(RCUs)
#for RCU in RCUs: #for RCU in RCUs:
......
from test_common import * from test_common import *
connect()
rate= 0 #seconds rate= 30 #seconds
name="RCU_monitor_rate_RW" name="RECVTR_monitor_rate_RW"
print("old:",get_value(name)) print("old:",get_value(name))
set_value(name,rate) set_value(name,rate)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment