diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2020-01-27 05:27:25 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2020-01-27 05:27:25 +0100 |
commit | 2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea (patch) | |
tree | 09cb20c623cc8ecdfbf0b526629afcb60aa15f30 /src/ufo-roof-build-task.c | |
parent | ea424f096c05a9587ffaa0bc6e5392790a046bd7 (diff) | |
download | ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.tar.gz ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.tar.bz2 ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.tar.xz ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.zip |
Add metadata about buffer plane and sequential number. Provide filter to allow trough only the buffers acquired at the specified detector plane
Diffstat (limited to 'src/ufo-roof-build-task.c')
-rw-r--r-- | src/ufo-roof-build-task.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ufo-roof-build-task.c b/src/ufo-roof-build-task.c index 8af44db..93cb133 100644 --- a/src/ufo-roof-build-task.c +++ b/src/ufo-roof-build-task.c @@ -253,7 +253,10 @@ ufo_roof_build_task_generate (UfoTask *task, UfoRequisition *requisition) { gboolean ready = FALSE; + gulong seqid; GError *gerr = NULL; + GValue ival = G_VALUE_INIT; + GValue lval = G_VALUE_INIT; UfoRoofBuildTaskPrivate *priv = UFO_ROOF_BUILD_TASK_GET_PRIVATE (task); UfoRoofConfig *cfg = priv->cfg; @@ -264,7 +267,7 @@ ufo_roof_build_task_generate (UfoTask *task, if (priv->stop) return FALSE; - ready = ufo_roof_buffer_get_dataset(buf, output_buffer, &gerr); + ready = ufo_roof_buffer_get_dataset(buf, output_buffer, &seqid, &gerr); if (gerr) roof_print_error(gerr); if (priv->build == BUILD_UFO) { @@ -281,6 +284,16 @@ ufo_roof_build_task_generate (UfoTask *task, } } + // Metadata: plane and sequential number within the plane + g_value_init (&ival, G_TYPE_UINT); + g_value_init (&lval, G_TYPE_ULONG); + g_value_set_uint (&ival, 1 + seqid % cfg->n_planes); + ufo_buffer_set_metadata (output, "plane", &ival); + g_value_set_ulong (&lval, seqid / cfg->n_planes); + ufo_buffer_set_metadata (output, "seqid", &lval); + g_value_unset(&lval); + g_value_unset(&ival); + // FIXME: Or shall we start from counting from the ID of the first registerd dataset if ((priv->number)&&(buf->current_id >= priv->number)) { // printf("%u datasets processed, stopping\n", buf->current_id); |