aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/image.c6
-rw-r--r--src/im-sandbox.c19
-rw-r--r--src/process_image.c8
3 files changed, 23 insertions, 10 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 2209ffee..1bad7d00 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -1391,7 +1391,6 @@ struct image *image_read_data_block(const DataTemplate *dtempl,
int no_mask_data)
{
struct image *image;
- char tmp[64];
if ( dtempl == NULL ) {
ERROR("NULL data template!\n");
@@ -1404,9 +1403,8 @@ struct image *image_read_data_block(const DataTemplate *dtempl,
return NULL;
}
- snprintf(tmp, 63, "datablock-%i", serial);
- image->filename = strdup(tmp);
- image->ev = strdup("//");
+ image->filename = NULL;
+ image->ev = NULL;
image->data_block = data_block;
image->data_block_size = data_block_size;
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 059f4a74..158da59b 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -482,6 +482,9 @@ static int run_work(const struct index_args *iargs, Stream *st,
&event);
if ( pargs.zmq_data != NULL ) {
ok = 1;
+
+ /* ASAP::O provides a meaningful filename, which
+ * replaces the placeholder. */
free(pargs.filename);
free(pargs.event);
pargs.filename = filename;
@@ -889,15 +892,19 @@ static int fill_queue(struct get_pattern_ctx *gpctx, struct sandbox *sb)
char *evstr;
if ( sb->zmq ) {
- /* These values will be passed down to process_image,
- * but ignored. The 'real' filename, which is still a
- * 'fake' filename - only for accounting purposes - will
- * be generated by image_read_data_block(). */
+ /* These are just semi-meaningful placeholder values to
+ * be put into the queue, instead of "(null)".
+ * A unique filename is needed so that the GUI can
+ * tell the frames apart from one another.
+ * ASAP::O, for one, will replace this with a filename
+ * that corresponds to something real. */
filename = "ZMQdata";
- evstr = strdup("//");
+ evstr = malloc(64);
+ snprintf(evstr, 64, "//%i", sb->serial);
} else if ( sb->asapo ) {
filename = "ASAPOdata";
- evstr = strdup("//");
+ evstr = malloc(64);
+ snprintf(evstr, 64, "//%i", sb->serial);
} else {
if ( !get_pattern(gpctx, &filename, &evstr) ) return 1;
}
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,