Commit a4f8fff9 authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge remote-tracking branch 'origin/develop' into feature-21-TM7

Conflicts:
	targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
parents a2420288 ee934102
This diff is collapsed.
...@@ -13,6 +13,7 @@ struct filter { ...@@ -13,6 +13,7 @@ struct filter {
} v; } v;
int (*eval)(struct filter *this, event e); int (*eval)(struct filter *this, event e);
void (*free)(struct filter *this);
}; };
/****************************************************************************/ /****************************************************************************/
...@@ -52,7 +53,23 @@ int eval_evarg(struct filter *f, event e) ...@@ -52,7 +53,23 @@ int eval_evarg(struct filter *f, event e)
} }
/****************************************************************************/ /****************************************************************************/
/* filter construction functions */ /* free memory functions */
/****************************************************************************/
void free_op2(struct filter *f)
{
free_filter(f->v.op2.a);
free_filter(f->v.op2.b);
free(f);
}
void free_noop(struct filter *f)
{
free(f);
}
/****************************************************************************/
/* filter construction/destruction functions */
/****************************************************************************/ /****************************************************************************/
filter *filter_and(filter *a, filter *b) filter *filter_and(filter *a, filter *b)
...@@ -60,6 +77,7 @@ filter *filter_and(filter *a, filter *b) ...@@ -60,6 +77,7 @@ filter *filter_and(filter *a, filter *b)
struct filter *ret = calloc(1, sizeof(struct filter)); struct filter *ret = calloc(1, sizeof(struct filter));
if (ret == NULL) abort(); if (ret == NULL) abort();
ret->eval = eval_and; ret->eval = eval_and;
ret->free = free_op2;
ret->v.op2.a = a; ret->v.op2.a = a;
ret->v.op2.b = b; ret->v.op2.b = b;
return ret; return ret;
...@@ -70,6 +88,7 @@ filter *filter_eq(filter *a, filter *b) ...@@ -70,6 +88,7 @@ filter *filter_eq(filter *a, filter *b)
struct filter *ret = calloc(1, sizeof(struct filter)); struct filter *ret = calloc(1, sizeof(struct filter));
if (ret == NULL) abort(); if (ret == NULL) abort();
ret->eval = eval_eq; ret->eval = eval_eq;
ret->free = free_op2;
ret->v.op2.a = a; ret->v.op2.a = a;
ret->v.op2.b = b; ret->v.op2.b = b;
return ret; return ret;
...@@ -80,6 +99,7 @@ filter *filter_int(int v) ...@@ -80,6 +99,7 @@ filter *filter_int(int v)
struct filter *ret = calloc(1, sizeof(struct filter)); struct filter *ret = calloc(1, sizeof(struct filter));
if (ret == NULL) abort(); if (ret == NULL) abort();
ret->eval = eval_int; ret->eval = eval_int;
ret->free = free_noop;
ret->v.v = v; ret->v.v = v;
return ret; return ret;
} }
...@@ -97,6 +117,7 @@ filter *filter_evarg(void *database, char *event_name, char *varname) ...@@ -97,6 +117,7 @@ filter *filter_evarg(void *database, char *event_name, char *varname)
f = get_format(database, event_id); f = get_format(database, event_id);
ret->eval = eval_evarg; ret->eval = eval_evarg;
ret->free = free_noop;
ret->v.evarg.event_type = event_id; ret->v.evarg.event_type = event_id;
ret->v.evarg.arg_index = -1; ret->v.evarg.arg_index = -1;
...@@ -114,6 +135,14 @@ filter *filter_evarg(void *database, char *event_name, char *varname) ...@@ -114,6 +135,14 @@ filter *filter_evarg(void *database, char *event_name, char *varname)
return ret; return ret;
} }
void free_filter(filter *_f)
{
struct filter *f;
if (_f == NULL) return;
f = _f;
f->free(f);
}
/****************************************************************************/ /****************************************************************************/
/* eval function */ /* eval function */
/****************************************************************************/ /****************************************************************************/
......
...@@ -12,4 +12,6 @@ filter *filter_evarg(void *database, char *event_name, char *varname); ...@@ -12,4 +12,6 @@ filter *filter_evarg(void *database, char *event_name, char *varname);
int filter_eval(filter *f, event e); int filter_eval(filter *f, event e);
void free_filter(filter *f);
#endif /* _FILTER_H_ */ #endif /* _FILTER_H_ */
...@@ -39,6 +39,7 @@ widget *new_space(gui *gui, int width, int height); ...@@ -39,6 +39,7 @@ widget *new_space(gui *gui, int width, int height);
widget *new_image(gui *gui, unsigned char *data, int length); widget *new_image(gui *gui, unsigned char *data, int length);
void label_set_clickable(gui *gui, widget *label, int clickable); void label_set_clickable(gui *gui, widget *label, int clickable);
void label_set_text(gui *gui, widget *label, char *text);
void container_set_child_growable(gui *_gui, widget *_this, void container_set_child_growable(gui *_gui, widget *_this,
widget *child, int growable); widget *child, int growable);
...@@ -49,6 +50,7 @@ void xy_plot_set_range(gui *gui, widget *this, ...@@ -49,6 +50,7 @@ void xy_plot_set_range(gui *gui, widget *this,
void xy_plot_set_points(gui *gui, widget *this, void xy_plot_set_points(gui *gui, widget *this,
int plot, int npoints, float *x, float *y); int plot, int npoints, float *x, float *y);
void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height); void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height);
void xy_plot_set_title(gui *gui, widget *this, char *label);
void textlist_add(gui *gui, widget *this, const char *text, int position, void textlist_add(gui *gui, widget *this, const char *text, int position,
int color); int color);
......
...@@ -141,7 +141,7 @@ struct button_widget { ...@@ -141,7 +141,7 @@ struct button_widget {
struct label_widget { struct label_widget {
struct widget common; struct widget common;
const char *t; char *t;
int color; int color;
int width; /* as given by the graphic's backend */ int width; /* as given by the graphic's backend */
int height; /* as given by the graphic's backend */ int height; /* as given by the graphic's backend */
......
...@@ -81,3 +81,21 @@ void label_set_clickable(gui *_g, widget *_this, int clickable) ...@@ -81,3 +81,21 @@ void label_set_clickable(gui *_g, widget *_this, int clickable)
gunlock(g); gunlock(g);
} }
void label_set_text(gui *_g, widget *_this, char *text)
{
struct gui *g = _g;
struct label_widget *this = _this;
glock(g);
free(this->t);
this->t = strdup(text); if (this->t == NULL) OOM;
x_text_get_dimensions(g->x, DEFAULT_FONT, text,
&this->width, &this->height, &this->baseline);
send_event(g, REPACK, this->common.id);
gunlock(g);
}
...@@ -290,3 +290,22 @@ void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height) ...@@ -290,3 +290,22 @@ void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height)
gunlock(g); gunlock(g);
} }
void xy_plot_set_title(gui *_gui, widget *_this, char *label)
{
struct gui *g = _gui;
struct xy_plot_widget *this = _this;
glock(g);
free(this->label);
this->label = strdup(label); if (this->label == NULL) OOM;
/* TODO: be sure calling X there is valid wrt "global model" (we are
* not in the "gui thread") */
x_text_get_dimensions(g->x, DEFAULT_FONT, label,
&this->label_width, &this->label_height, &this->label_baseline);
send_event(g, REPACK, this->common.id);
gunlock(g);
}
#include "logger.h" #include "logger.h"
#include "logger_defs.h" #include "logger_defs.h"
#include "filter/filter.h"
#include <stdlib.h> #include <stdlib.h>
void logger_add_view(logger *_l, view *v) void logger_add_view(logger *_l, view *v)
...@@ -13,5 +14,6 @@ void logger_add_view(logger *_l, view *v) ...@@ -13,5 +14,6 @@ void logger_add_view(logger *_l, view *v)
void logger_set_filter(logger *_l, void *filter) void logger_set_filter(logger *_l, void *filter)
{ {
struct logger *l = _l; struct logger *l = _l;
free_filter(l->filter);
l->filter = filter; l->filter = filter;
} }
...@@ -1130,7 +1130,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1130,7 +1130,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#endif #endif
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_DL)) return; if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)==SF_UL)) return;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+offset,1);
if (do_meas==1) start_meas(&eNB->phy_proc_tx); if (do_meas==1) start_meas(&eNB->phy_proc_tx);
......
...@@ -883,11 +883,8 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -883,11 +883,8 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
if (openair0_cfg[card].rx_freq[ant]>0) { if (openair0_cfg[card].rx_freq[ant]>0) {
p_exmimo_config->rf.rf_mode[ant] += (RXEN + DMAMODE_RX + RXLPFNORM + RXLPFEN + rx_filter); p_exmimo_config->rf.rf_mode[ant] += (RXEN + DMAMODE_RX + RXLPFNORM + RXLPFEN + rx_filter);
p_exmimo_config->rf.rf_freq_rx[ant] = (unsigned int)openair0_cfg[card].rx_freq[ant]; p_exmimo_config->rf.rf_freq_rx[ant] = (unsigned int)openair0_cfg[card].rx_freq[ant];
printf("openair0 : programming card %d RX antenna %d (freq %u, gain %d)\n",card,ant,p_exmimo_config->rf.rf_freq_rx[ant],p_exmimo_config->rf.rx_gain[ant][0]);
switch (openair0_cfg[card].rxg_mode[ant]) { switch (openair0_cfg[card].rxg_mode[ant]) {
default: default:
case max_gain: case max_gain:
...@@ -923,6 +920,11 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -923,6 +920,11 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
} }
break; break;
} }
printf("openair0 : programming card %d RX antenna %d (freq %u, gain %d)\n",card,ant,p_exmimo_config->rf.rf_freq_rx[ant],p_exmimo_config->rf.rx_gain[ant][0]);
} else {
p_exmimo_config->rf.rf_mode[ant] = 0;
p_exmimo_config->rf.do_autocal[ant] = 0;
} }
p_exmimo_config->rf.rf_local[ant] = rf_local[ant]; p_exmimo_config->rf.rf_local[ant] = rf_local[ant];
......
...@@ -1344,12 +1344,6 @@ void init_openair0() { ...@@ -1344,12 +1344,6 @@ void init_openair0() {
else else
openair0_cfg[card].rx_freq[i]=0.0; openair0_cfg[card].rx_freq[i]=0.0;
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
card,i, openair0_cfg[card].tx_gain[i],
openair0_cfg[card].rx_gain[i],
openair0_cfg[card].tx_freq[i],
openair0_cfg[card].rx_freq[i]);
openair0_cfg[card].autocal[i] = 1; openair0_cfg[card].autocal[i] = 1;
openair0_cfg[card].tx_gain[i] = tx_gain[0][i]; openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
if (UE_flag == 0) { if (UE_flag == 0) {
...@@ -1359,10 +1353,12 @@ void init_openair0() { ...@@ -1359,10 +1353,12 @@ void init_openair0() {
openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB - rx_gain_off; openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB - rx_gain_off;
} }
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
card,i, openair0_cfg[card].tx_gain[i],
openair0_cfg[card].rx_gain[i],
openair0_cfg[card].tx_freq[i],
openair0_cfg[card].rx_freq[i]);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment