From be3595c63e5d310624f03be05cb2d2006c4963d2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 10 Jan 2022 12:24:53 +0100 Subject: Generate placeholder filename/event earlier Previously, a placeholder was put in the queue ("ZMQdata //" or "ASAPOdata //"), and replaced by image_read_data_block. Instead, the "final" placeholder can be put in the queue already. Note that ASAP::O, at least, will replace this placeholder with a filename delivered by the data transport. --- src/process_image.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/process_image.c') diff --git a/src/process_image.c b/src/process_image.c index 9151528d..71be87cc 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -199,6 +199,14 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, iargs->no_mask_data); profile_end("read-data-block"); if ( image == NULL ) return; + + /* image_read_data_block() will leave the filename/event as + * NULL, because there's no file (duh). Fill them in now with + * the values passed down to us. These values might be + * meaningful (e.g. ASAP::O), or just placeholders. */ + image->filename = strdup(pargs->filename); + image->ev = strdup(pargs->event); + } else { profile_start("file-wait-open-read"); image = file_wait_open_read(pargs->filename, pargs->event, -- cgit v1.2.3 From 992e25b007f8a418fd7860cc34a441932cdf023c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 3 May 2022 15:28:46 +0200 Subject: indexamajig: Track metadata (e.g. for ASAP::O) --- src/process_image.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'src/process_image.c') diff --git a/src/process_image.c b/src/process_image.c index 71be87cc..de2d8792 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -188,22 +188,45 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, int any_crystals; if ( pargs->zmq_data != NULL ) { - set_last_task(last_task, "unpacking messagepack object"); - profile_start("read-data-block"); + + set_last_task(last_task, "unpacking ZMQ data"); + profile_start("read-zmq-data"); image = image_read_data_block(iargs->dtempl, pargs->zmq_data, pargs->zmq_data_size, + NULL, + iargs->data_format, + serial, + iargs->no_image_data, + iargs->no_mask_data); + profile_end("read-zmq-data"); + if ( image == NULL ) return; + + /* image_read_data_block() will leave the filename/event as + * NULL, because there's no file (duh). Fill them in now with + * the values passed down to us. For ZMQ, these values are just + * placeholders. */ + image->filename = strdup(pargs->filename); + image->ev = strdup(pargs->event); + + } else if ( pargs->asapo_data != NULL ) { + + set_last_task(last_task, "unpacking ASAP::O data"); + profile_start("read-asapo-data"); + image = image_read_data_block(iargs->dtempl, + pargs->asapo_data, + pargs->asapo_data_size, + pargs->asapo_meta, iargs->data_format, serial, iargs->no_image_data, iargs->no_mask_data); - profile_end("read-data-block"); + profile_end("read-asapo-data"); if ( image == NULL ) return; /* image_read_data_block() will leave the filename/event as * NULL, because there's no file (duh). Fill them in now with - * the values passed down to us. These values might be - * meaningful (e.g. ASAP::O), or just placeholders. */ + * the values passed down to us from ASAP::O. */ image->filename = strdup(pargs->filename); image->ev = strdup(pargs->event); -- cgit v1.2.3