Files
sf-op/script/test/TestStream.py
2021-08-17 14:06:14 +02:00

46 lines
1.2 KiB
Python
Executable File

import ch.psi.pshell.bs.DispatcherConfig.Incomplete as Incomplete
channels = ["SAROP11-PBPS117:INTENSITY", \
"SAROP11-PBPS117:XPOS", \
"SAROP11-PBPS117:YPOS", \
"SLG-LSCP2-FNS:CH0:VAL_GET", \
"SINEG01-DBPM340:Q1", \
"SINEG01-DBPM340:X1", \
"SINEG01-DBPM340:Y1", \
"SINEG01-DBPM340:Q2", \
"S20SY02-DBPM150:Q1", \
"SINEG01-DBPM340:X2", \
"SINEG01-DBPM340:Y2", \
"SLG-LSCP2-FNS:CH0:VAL_GET"]
channels = [ \
"S20SY02-DBPM150:Q1", \
"SINEG01-DBPM340:X2", \
"SLG-LSCP2-FNS:CH0:VAL_GET" \
]
#channels = ["SLG-LSCP2-FNS:CH0:VAL_GET"]
#dispatcher.config.mappingIncomplete=None
#dispatcher.config.mappingIncomplete = Incomplete.fill_null
dispatcher.config.mappingIncomplete = Incomplete.provide_as_is
#dispatcher.config.mappingIncomplete = Incomplete.drop
s1 = Stream("s1", dispatcher)
#s1.initialize()
s1.setIncomplete("fill_null")
for c in channels:
s1.addScalar(c,c, 1, 0)
s1.addScalar("SAROP11-PBPS117:INTENSITY","SAROP11-PBPS117:INTENSITY", 10, 0)
add_device(s1, True)
s1.start()
s1.waitCacheChange(5000)
print s1.take().keys()
for i in range(20):
#print s1.take().keys(), s1.take().values()
print s1.take().values()
s1.waitCacheChange(5000)
#ret = bscan (s1, 20, None, save=False)