Commit 9be3a02f authored by Elena Lukashova's avatar Elena Lukashova

Adding a button to XFORMS to switch dinamically between SIC and PIA.

parent fadb9b83
......@@ -24,6 +24,7 @@
#include "lte_phy_scope.h"
#define TPUT_WINDOW_LENGTH 100
int otg_enabled;
int use_sic_receiver=0;
FL_COLOR rx_antenna_colors[4] = {FL_RED,FL_BLUE,FL_GREEN,FL_YELLOW};
float tput_time_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
float tput_enb[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
......@@ -54,6 +55,21 @@ static void dl_traffic_on_off( FL_OBJECT *button, long arg)
fl_set_object_color(button, FL_RED, FL_RED);
}
}
static void sic_receiver_on_off( FL_OBJECT *button, long arg)
{
if (fl_get_button(button)) {
fl_set_object_label(button, "SIC Receiver ON");
use_sic_receiver = 1;
fl_set_object_color(button, FL_GREEN, FL_GREEN);
} else {
fl_set_object_label(button, "SIC Receiver OFF");
use_sic_receiver = 0;
fl_set_object_color(button, FL_RED, FL_RED);
}
}
FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
{
FL_OBJECT *obj;
......@@ -398,16 +414,17 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX );
fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE );
fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color
*/
// Generic UE Button
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" );
fl_set_object_lalign(fdui->button_0, FL_ALIGN_CENTER );
//openair_daq_vars.use_ia_receiver = 0;
//use_sic_receiver = 0;
fl_set_button(fdui->button_0,0);
fl_set_object_label(fdui->button_0, "IA Receiver OFF");
fl_set_object_label(fdui->button_0, "SIC Receiver OFF");
fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
fl_set_object_callback(fdui->button_0, ia_receiver_on_off, 0 );
fl_set_object_callback(fdui->button_0, sic_receiver_on_off, 0 );
fl_hide_object(fdui->button_0);
*/
fl_end_form( );
fdui->lte_phy_scope_ue->fdui = fdui;
return fdui;
......@@ -461,6 +478,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
}
*/
}
fl_show_object(form->button_0);
if (phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]!=NULL) {
harq_pid = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1]->current_harq_pid;
if (harq_pid>=8)
......@@ -804,3 +822,5 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
for (int m=0; m<coded_bits_per_codeword1; ++m)
phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[1][m]=0;
}
......@@ -149,6 +149,8 @@ int main(int argc, char **argv)
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
double iqim=0.0;
extern int use_sic_receiver;
uint8_t extended_prefix_flag=0,transmission_mode=1,n_tx_port=1, n_tx_phy=1, n_rx=1;
uint16_t Nid_cell=0;
......@@ -722,15 +724,15 @@ int main(int argc, char **argv)
sprintf (title, "LTE PHY SCOPE eNB");
fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
/*
if (rx_type==rx_IC_single_stream) {
openair_daq_vars.use_ia_receiver = 1;
fl_set_button(form_ue->button_0,1);
fl_set_object_label(form_ue->button_0, "IA Receiver ON");
fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
if (transmission_mode==4 && rx_type == rx_SIC_dual_stream ) {
use_sic_receiver = 1;
fl_set_button(form_ue->button_0, use_sic_receiver);
fl_set_object_label(form_ue->button_0, "SIC Receiver ON");
fl_set_object_color(form_ue->button_0, FL_RED, FL_RED);
}
*/
}
if (transmission_mode==5) {
......@@ -3895,6 +3897,11 @@ int main(int argc, char **argv)
printf("[DLSIM 3 ] UE->dlsch[subframe&0x1][0][1]->pmi_alloc %d \n", UE->dlsch[subframe&0x1][0][1]->pmi_alloc);
#endif
if (transmission_mode==4 && use_sic_receiver==1)
rx_type=rx_SIC_dual_stream;
else if (transmission_mode==4 && use_sic_receiver==0)
rx_type=rx_IC_dual_stream;
switch (transmission_mode) {
case 1:
case 2:
......
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