From d2bd09bb9d63cfdbc8c389a33ec5945ffe2f80c3 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 22 Jun 2016 10:55:34 +0200 Subject: [PATCH] add function framelog_set_update_only_at_sf9 and update code about it --- common/utils/T/tracer/logger/framelog.c | 11 ++++++++++- common/utils/T/tracer/logger/logger.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/utils/T/tracer/logger/framelog.c b/common/utils/T/tracer/logger/framelog.c index 057960c38..45ae3e399 100644 --- a/common/utils/T/tracer/logger/framelog.c +++ b/common/utils/T/tracer/logger/framelog.c @@ -21,6 +21,7 @@ struct framelog { */ int skip_current; /* internal data for the skip mechanism */ int skip_on; /* internal data for the skip mechanism */ + int update_only_at_sf9; }; static void _event(void *p, event e) @@ -76,7 +77,7 @@ static void _event(void *p, event e) l->buffer[subframe * nsamples + i] = 10*log10(1.0+(float)(I*I+Q*Q)); } - if (subframe == 9) + if (l->update_only_at_sf9 == 0 || subframe == 9) for (i = 0; i < l->common.vsize; i++) l->common.v[i]->append(l->common.v[i], l->x, l->buffer, l->blength); } @@ -91,6 +92,8 @@ logger *new_framelog(event_handler *h, void *database, ret = calloc(1, sizeof(struct framelog)); if (ret == NULL) abort(); + ret->update_only_at_sf9 = 1; + ret->common.event_name = strdup(event_name); if (ret->common.event_name == NULL) abort(); ret->database = database; @@ -144,3 +147,9 @@ void framelog_set_skip(logger *_this, int skip_delay) l->skip_current = 0; l->skip_on = 0; } + +void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9) +{ + struct framelog *l = _this; + l->update_only_at_sf9 = update_only_at_sf9; +} diff --git a/common/utils/T/tracer/logger/logger.h b/common/utils/T/tracer/logger/logger.h index e3e4b97aa..c97797316 100644 --- a/common/utils/T/tracer/logger/logger.h +++ b/common/utils/T/tracer/logger/logger.h @@ -15,6 +15,7 @@ logger *new_ticklog(void *event_handler, void *database, char *event_name, char *frame_name, char *subframe_name); void framelog_set_skip(logger *_this, int skip_delay); +void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9); #include "view/view.h" -- GitLab