Skip to content
Snippets Groups Projects
Commit 78bf590c authored by David Hammer's avatar David Hammer
Browse files

Squashed commit of the following:

commit ddc65f71
Author: David Hammer <dhammer@mailbox.org>
Date:   Wed Aug 25 16:58:47 2021 +0200

    Add individual source names to their metadata

commit 5ba47ce0
Author: David Hammer <dhammer@mailbox.org>
Date:   Wed Aug 25 16:48:12 2021 +0200

    Add metadata for control sources, too
parent 9251066c
No related branches found
No related tags found
2 merge requests!12Snapshot: field test deployed version as of end of run 202201,!3Base correction device, CalCat interaction, DSSC and AGIPD devices
...@@ -42,15 +42,6 @@ class ShmemToZMQ(PipeToZeroMQ.PipeToZeroMQ): ...@@ -42,15 +42,6 @@ class ShmemToZMQ(PipeToZeroMQ.PipeToZeroMQ):
new_meta = {} new_meta = {}
new_data = {} new_data = {}
# additional unstacked sources
if data.has("unstacked"):
for source in data.get("unstacked").getKeys():
forward, ignore = self._filter_properties(data, source)
new_data[source] = conversion.hash_to_dict(
data.get(f"unstacked.{source}"), paths=forward, version=self.version
)
data.erase("unstacked")
# stacked data from ModuleStacker # stacked data from ModuleStacker
for source, handle_string in zip(data.get("sources"), data.get("image.data")): for source, handle_string in zip(data.get("sources"), data.get("image.data")):
if source not in self.sources: if source not in self.sources:
...@@ -64,6 +55,7 @@ class ShmemToZMQ(PipeToZeroMQ.PipeToZeroMQ): ...@@ -64,6 +55,7 @@ class ShmemToZMQ(PipeToZeroMQ.PipeToZeroMQ):
new_meta[source] = conversion.meta_to_dict(metadata) new_meta[source] = conversion.meta_to_dict(metadata)
new_meta[source]["ignored_keys"] = ignore new_meta[source]["ignored_keys"] = ignore
new_meta[source]["source"] = source
shmem_name, _, _, shmem_index = shmem_utils.parse_shmem_handle( shmem_name, _, _, shmem_index = shmem_utils.parse_shmem_handle(
handle_string handle_string
...@@ -105,6 +97,17 @@ class ShmemToZMQ(PipeToZeroMQ.PipeToZeroMQ): ...@@ -105,6 +97,17 @@ class ShmemToZMQ(PipeToZeroMQ.PipeToZeroMQ):
new_data[source] = (dic, arr) new_data[source] = (dic, arr)
# note: assumes version "2.2" of the PipeToZeroMQ packing format # note: assumes version "2.2" of the PipeToZeroMQ packing format
# additional unstacked sources
if data.has("unstacked"):
for source in data.get("unstacked").getKeys():
forward, ignore = self._filter_properties(data, source)
new_data[source] = conversion.hash_to_dict(
data.get(f"unstacked.{source}"), paths=forward, version=self.version
)
new_meta[source] = conversion.meta_to_dict(metadata)
new_meta[source]["source"] = source
data.erase("unstacked")
# forward data to all connected ZMQ sockets # forward data to all connected ZMQ sockets
self._send(new_data, new_meta) self._send(new_data, new_meta)
......
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