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

test HBAT BF update

parent e808b7f6
No related branches found
No related tags found
No related merge requests found
Pipeline #24889 passed
RCU=3 RCU=0
HBAT=1 #HBAT on RCU 0..2 HBAT=0 #HBAT on RCU 0..2
#HBA=5; #HBA Element in HBAT #HBA=5; #HBA Element in HBAT
#BFX=11 #delay in 0.5ns #BFX=11 #delay in 0.5ns
#BFY=BFX+1 #BFY=BFX+1
name="HBA_element_beamformer_delays" name="HBAT_BF_delay_steps"
from test_common import * from test_common import *
import numpy as np import numpy as np
connect()
AntMask=[(x==HBAT) for x in range(3)] AntMask=[(x==HBAT) for x in range(3)]
#AntMask=[True,True,True]
setAntmask([RCU],AntMask) setAntmask([RCU],AntMask)
i=(RCU*3+HBAT)*32 i=(RCU*3+HBAT)*32
val=get_value(name+"_R") val,tp=get_value_type(name+"_R")
print("old:",val[i:i+32]) print("old:",val[i:i+32])
val[i:i+32]=np.array(range(32))[::]*0+1 val[i:i+32]=np.array(range(32))[::]
print("set:",val[i:i+32])
set_value(name+"_RW",val) set_value(name+"_RW",val,tp)
time.sleep(1) time.sleep(1)
val=get_value(name+"_R") val=get_value(name+"_R")
print("new:",val[i:i+32]) print("new:",val[i:i+32])
......
RCU=0 RCU=0
name="HBA_element_beamformer_delays" name="HBAT_BF_delay_steps"
busy="RECVTR_translator_busy_R"
AntMask=[True,True,True] AntMask=[True,True,True]
NewVal1=range(32) NewVal1=range(32)
NewVal2=[1]*32 NewVal2=[1]*32
NewValues=[NewVal1,NewVal2,NewVal1,NewVal2,NewVal1,NewVal2,NewVal1,NewVal2,NewVal1,NewVal2] #NewValues=[NewVal1,NewVal2,NewVal1,NewVal2,NewVal1,NewVal2,NewVal1,NewVal2,NewVal1,NewVal2]
#NewValues=[NewVal1,NewVal2] NewValues=[NewVal1,NewVal2]
DEBUG=False DEBUG=True
from test_common import * from test_common import *
import numpy as np import numpy as np
connect()
setAntmask([RCU],AntMask) setAntmask([RCU],AntMask)
i=(RCU*3)*32 i=(RCU*3)*32
val=get_value(name+"_R") val,tp=get_value_type(name+"_R")
if DEBUG: if DEBUG:
print("Current values:"); print("Current values:");
for x in range(3): print(val[i+x*32:i+(x+1)*32]) for x in range(3): print(val[i+x*32:i+(x+1)*32])
...@@ -23,12 +24,12 @@ for cnt,NewVal in enumerate(NewValues): ...@@ -23,12 +24,12 @@ for cnt,NewVal in enumerate(NewValues):
for x in range(3): val[i+x*32:i+(x+1)*32]=NewVal for x in range(3): val[i+x*32:i+(x+1)*32]=NewVal
set_value(name+"_RW",val) set_value(name+"_RW",val,tp)
if DEBUG: if DEBUG:
print("set:") print("set:")
for x in range(3): print(val[i+x*32:i+(x+1)*32]) for x in range(3): print(val[i+x*32:i+(x+1)*32])
time.sleep(0.5) time.sleep(1)
wait_not_busy("RCU_translator_busy_R",timeout_sec=2) wait_not_busy(busy,timeout_sec=4)
# time.sleep(0.1) # time.sleep(0.1)
val=get_value(name+"_R") val=get_value(name+"_R")
if DEBUG: if DEBUG:
......
...@@ -29,9 +29,18 @@ def get_value(name): ...@@ -29,9 +29,18 @@ def get_value(name):
var1 = root.get_child(["0:Objects", "2:"+name]) var1 = root.get_child(["0:Objects", "2:"+name])
return var1.get_value() return var1.get_value()
def set_value(name,value): def get_value_type(name):
var1 = root.get_child(["0:Objects", "2:"+name]) var1 = root.get_child(["0:Objects", "2:"+name])
var1.set_value(value) print(var1)
return var1.get_value(),var1.get_data_value().Value.VariantType
def set_value(name,value,tp=None):
var1 = root.get_child(["0:Objects", "2:"+name])
if tp is None:
var1.set_value(value)
else:
var1.set_value(value,tp)
def get_debug_value(name): def get_debug_value(name):
var1 = root.get_child(["0:Objects", "2:DEBUG", "2:"+name]) var1 = root.get_child(["0:Objects", "2:DEBUG", "2:"+name])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment