simplified repack() logic
This commit is contained in:
@ -27,7 +27,7 @@ class BSCache:
|
||||
with source(channels=configs, receive_timeout=-1) as src:
|
||||
while running.is_set():
|
||||
msg = src.receive()
|
||||
data = repack(channels, msg)
|
||||
data = repack(msg)
|
||||
if data:
|
||||
yield data
|
||||
|
||||
@ -82,11 +82,11 @@ def make_channel_config(name, modulo, offset):
|
||||
|
||||
|
||||
|
||||
def repack(channels, message):
|
||||
def repack(message):
|
||||
data = message.data.data
|
||||
pulse_id = message.data.pulse_id
|
||||
|
||||
res = {n: data[n].value for n in channels}
|
||||
res = {n: v.value for n, v in data.items()}
|
||||
# res = {k: v for k, v in res.items() if v is not None}
|
||||
|
||||
#TODO: should this be a ValueError?
|
||||
|
Reference in New Issue
Block a user