summaryrefslogtreecommitdiffstats
path: root/src/ufo-roof-build-task.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ufo-roof-build-task.c')
-rw-r--r--src/ufo-roof-build-task.c15
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);