Commit cce6793d authored by winckel's avatar winckel
Browse files

Added LTE time column in itti_analyser.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4392 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent a58a5bc8
...@@ -772,14 +772,28 @@ static int xml_parse_doc(xmlDocPtr doc) { ...@@ -772,14 +772,28 @@ static int xml_parse_doc(xmlDocPtr doc) {
resolve_file (&head); resolve_file (&head);
resolve_union (&head); resolve_union (&head);
resolve_function (&head); resolve_function (&head);
/* Locate the root element which corresponds to the MessageDef struct */ /* Locate the root element which corresponds to the MessageDef struct */
CHECK_FCT(locate_root("MessageDef", head, &root)); CHECK_FCT(locate_root("MessageDef", head, &root));
/* Locate the message id enumeration */
/* Locate the LTE time fields */
if (locate_type("lte_time", head, &lte_time_type) == RC_OK)
{
CHECK_FCT(locate_type("frame", lte_time_type->child->child, &lte_time_frame_type));
CHECK_FCT(locate_type("slot", lte_time_type->child->child, &lte_time_slot_type));
}
/* Locate the message id field */
CHECK_FCT(locate_type("MessagesIds", head, &messages_id_enum)); CHECK_FCT(locate_type("MessagesIds", head, &messages_id_enum));
/* Locate the origin task id field */
CHECK_FCT(locate_type("originTaskId", head, &origin_task_id_type)); CHECK_FCT(locate_type("originTaskId", head, &origin_task_id_type));
/* Locate the destination task id field */
CHECK_FCT(locate_type("destinationTaskId", head, &destination_task_id_type)); CHECK_FCT(locate_type("destinationTaskId", head, &destination_task_id_type));
/* Locate the instance field */
CHECK_FCT(locate_type("instance", head, &instance_type)); CHECK_FCT(locate_type("instance", head, &instance_type));
// root->type_hr_display(root, 0); // root->type_hr_display(root, 0);
update_filters(); update_filters();
if (dissect_file != NULL) { if (dissect_file != NULL) {
g_debug("generating dissected types file \"%s\" ...", ui_main_data.dissect_file_name); g_debug("generating dissected types file \"%s\" ...", ui_main_data.dissect_file_name);
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include "xml_parse.h" #include "xml_parse.h"
types_t *messages_id_enum = NULL; types_t *messages_id_enum = NULL;
types_t *lte_time_type = NULL;
types_t *lte_time_frame_type = NULL;
types_t *lte_time_slot_type = NULL;
types_t *origin_task_id_type = NULL; types_t *origin_task_id_type = NULL;
types_t *destination_task_id_type = NULL; types_t *destination_task_id_type = NULL;
types_t *instance_type = NULL; types_t *instance_type = NULL;
...@@ -74,6 +77,30 @@ int locate_type(const char *type_name, types_t *head, types_t **type) { ...@@ -74,6 +77,30 @@ int locate_type(const char *type_name, types_t *head, types_t **type) {
return (next_type == NULL) ? RC_FAIL : RC_OK; return (next_type == NULL) ? RC_FAIL : RC_OK;
} }
uint32_t get_lte_frame(buffer_t *buffer) {
uint32_t value = 0;
if (lte_time_type !=NULL)
{
/* Fetch instance value */
buffer_fetch_bits (buffer, lte_time_type->offset + lte_time_frame_type->offset, lte_time_frame_type->child->child->size, &value);
}
return value;
}
uint32_t get_lte_slot(buffer_t *buffer) {
uint32_t value = 0;
if (lte_time_type !=NULL)
{
/* Fetch instance value */
buffer_fetch_bits (buffer, lte_time_type->offset + lte_time_slot_type->offset, lte_time_slot_type->child->child->size, &value);
}
return value;
}
uint32_t get_message_id(types_t *head, buffer_t *buffer, uint32_t *message_id) { uint32_t get_message_id(types_t *head, buffer_t *buffer, uint32_t *message_id) {
uint32_t value; uint32_t value;
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
#define LOCATE_ROOT_H_ #define LOCATE_ROOT_H_
extern types_t *messages_id_enum; extern types_t *messages_id_enum;
extern types_t *lte_time_type;
extern types_t *lte_time_frame_type;
extern types_t *lte_time_slot_type;
extern types_t *origin_task_id_type; extern types_t *origin_task_id_type;
extern types_t *destination_task_id_type; extern types_t *destination_task_id_type;
extern types_t *instance_type; extern types_t *instance_type;
...@@ -10,6 +13,10 @@ int locate_root(const char *root_name, types_t *head, types_t **root); ...@@ -10,6 +13,10 @@ int locate_root(const char *root_name, types_t *head, types_t **root);
int locate_type(const char *type_name, types_t *head, types_t **type); int locate_type(const char *type_name, types_t *head, types_t **type);
uint32_t get_lte_frame(buffer_t *buffer);
uint32_t get_lte_slot(buffer_t *buffer);
uint32_t get_message_id(types_t *head, buffer_t *buffer, uint32_t *message_id); uint32_t get_message_id(types_t *head, buffer_t *buffer, uint32_t *message_id);
char *message_id_to_string(uint32_t message_id); char *message_id_to_string(uint32_t message_id);
......
...@@ -111,20 +111,29 @@ void ui_signal_add_to_list(gpointer data, gpointer user_data) ...@@ -111,20 +111,29 @@ void ui_signal_add_to_list(gpointer data, gpointer user_data)
buffer_t *signal_buffer; buffer_t *signal_buffer;
GtkTreePath *path; GtkTreePath *path;
GtkTreeViewColumn *focus_column; GtkTreeViewColumn *focus_column;
uint32_t lte_frame;
uint32_t lte_slot;
uint32_t origin_task_id; uint32_t origin_task_id;
uint32_t destination_task_id; uint32_t destination_task_id;
uint32_t instance; uint32_t instance;
char lte_time[15];
gtk_tree_view_get_cursor (GTK_TREE_VIEW(ui_main_data.signalslist), &path, &focus_column); gtk_tree_view_get_cursor (GTK_TREE_VIEW(ui_main_data.signalslist), &path, &focus_column);
signal_buffer = (buffer_t *) data; signal_buffer = (buffer_t *) data;
lte_frame = get_lte_frame(signal_buffer);
lte_slot = get_lte_slot(signal_buffer);
sprintf(lte_time, "%d.%02d", lte_frame, lte_slot);
get_message_id (root, signal_buffer, &signal_buffer->message_id); get_message_id (root, signal_buffer, &signal_buffer->message_id);
origin_task_id = get_task_id (signal_buffer, origin_task_id_type); origin_task_id = get_task_id (signal_buffer, origin_task_id_type);
destination_task_id = get_task_id (signal_buffer, destination_task_id_type); destination_task_id = get_task_id (signal_buffer, destination_task_id_type);
instance = get_instance (signal_buffer); instance = get_instance (signal_buffer);
ui_tree_view_new_signal_ind (signal_buffer->message_number, signal_buffer->message_id, message_id_to_string (signal_buffer->message_id), ui_tree_view_new_signal_ind (signal_buffer->message_number, lte_time,
signal_buffer->message_id, message_id_to_string (signal_buffer->message_id),
origin_task_id, task_id_to_string (origin_task_id, origin_task_id_type), origin_task_id, task_id_to_string (origin_task_id, origin_task_id_type),
destination_task_id, task_id_to_string (destination_task_id, destination_task_id_type), destination_task_id, task_id_to_string (destination_task_id, destination_task_id_type),
instance, data); instance, data);
......
...@@ -55,40 +55,56 @@ static gboolean ui_tree_filter_messages(GtkTreeModel *model, GtkTreeIter *iter, ...@@ -55,40 +55,56 @@ static gboolean ui_tree_filter_messages(GtkTreeModel *model, GtkTreeIter *iter,
static void static void
ui_tree_view_init_list(GtkWidget *list) ui_tree_view_init_list(GtkWidget *list)
{ {
GtkCellRenderer *renderer; GtkCellRenderer *renderer_left;
GtkCellRenderer *renderer_right;
GtkTreeViewColumn *column; GtkTreeViewColumn *column;
renderer = gtk_cell_renderer_text_new(); renderer_left = gtk_cell_renderer_text_new();
renderer_right = gtk_cell_renderer_text_new();
// g_object_set(GTK_CELL_RENDERER_TEXT(renderer_right), "xalign", 0.5);
column = gtk_tree_view_column_new_with_attributes(
"MN", renderer_right, "text", COL_MSG_NUM, NULL);
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
column = gtk_tree_view_column_new_with_attributes( column = gtk_tree_view_column_new_with_attributes(
"MN", renderer, "text", COL_MSG_NUM, NULL); "LTE Time", renderer_right, "text", COL_LTE_TIME, NULL);
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
column = gtk_tree_view_column_new_with_attributes( column = gtk_tree_view_column_new_with_attributes(
"Signal", renderer, "text", COL_MESSAGE, NULL); "Signal", renderer_left, "text", COL_MESSAGE, NULL);
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
g_signal_connect(G_OBJECT(column), "clicked", g_signal_connect(G_OBJECT(column), "clicked",
G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_MESSAGE); G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_MESSAGE);
column = gtk_tree_view_column_new_with_attributes( column = gtk_tree_view_column_new_with_attributes(
"From", renderer, "text", COL_FROM_TASK, NULL); "From", renderer_left, "text", COL_FROM_TASK, NULL);
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
g_signal_connect(G_OBJECT(column), "clicked", g_signal_connect(G_OBJECT(column), "clicked",
G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_FROM_TASK); G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_FROM_TASK);
column = gtk_tree_view_column_new_with_attributes( column = gtk_tree_view_column_new_with_attributes(
"To", renderer, "text", COL_TO_TASK, NULL); "To", renderer_left, "text", COL_TO_TASK, NULL);
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
g_signal_connect(G_OBJECT(column), "clicked", g_signal_connect(G_OBJECT(column), "clicked",
G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_TO_TASK); G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_TO_TASK);
column = gtk_tree_view_column_new_with_attributes( column = gtk_tree_view_column_new_with_attributes(
"Ins", renderer, "text", COL_INSTANCE, NULL); "Ins", renderer_right, "text", COL_INSTANCE, NULL);
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
g_signal_connect(G_OBJECT(column), "clicked", g_signal_connect(G_OBJECT(column), "clicked",
G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_INSTANCE); G_CALLBACK(ui_callback_on_tree_column_header_click), (gpointer) COL_INSTANCE);
ui_store.store = gtk_list_store_new(NUM_COLS, ui_store.store = gtk_list_store_new(NUM_COLS,
G_TYPE_UINT, // COL_MSG_NUM G_TYPE_UINT, // COL_MSG_NUM
G_TYPE_STRING, // COL_LTE_TIME
G_TYPE_STRING, // COL_SIGNAL G_TYPE_STRING, // COL_SIGNAL
G_TYPE_STRING, // COL_FROM_TASK G_TYPE_STRING, // COL_FROM_TASK
G_TYPE_STRING, // COL_TO_TASK G_TYPE_STRING, // COL_TO_TASK
...@@ -119,7 +135,7 @@ ui_tree_view_init_list(GtkWidget *list) ...@@ -119,7 +135,7 @@ ui_tree_view_init_list(GtkWidget *list)
gtk_tree_view_columns_autosize(GTK_TREE_VIEW(list)); gtk_tree_view_columns_autosize(GTK_TREE_VIEW(list));
} }
static void ui_tree_view_add_to_list(GtkWidget *list, const uint32_t message_number, const uint32_t message_id, const gchar *signal_name, static void ui_tree_view_add_to_list(GtkWidget *list, const gchar *lte_time, const uint32_t message_number, const uint32_t message_id, const gchar *signal_name,
const uint32_t origin_task_id, const char *origin_task, const uint32_t origin_task_id, const char *origin_task,
const uint32_t destination_task_id, const char *destination_task, uint32_t instance, gpointer buffer) const uint32_t destination_task_id, const char *destination_task, uint32_t instance, gpointer buffer)
{ {
...@@ -129,6 +145,7 @@ static void ui_tree_view_add_to_list(GtkWidget *list, const uint32_t message_num ...@@ -129,6 +145,7 @@ static void ui_tree_view_add_to_list(GtkWidget *list, const uint32_t message_num
gtk_list_store_set(ui_store.store, &iter, gtk_list_store_set(ui_store.store, &iter,
/* Columns */ /* Columns */
COL_MSG_NUM , message_number, COL_MSG_NUM , message_number,
COL_LTE_TIME , lte_time,
COL_MESSAGE , signal_name, COL_MESSAGE , signal_name,
COL_FROM_TASK , origin_task, COL_FROM_TASK , origin_task,
COL_TO_TASK , destination_task, COL_TO_TASK , destination_task,
...@@ -181,7 +198,7 @@ int ui_tree_view_create(GtkWidget *window, GtkWidget *vbox) ...@@ -181,7 +198,7 @@ int ui_tree_view_create(GtkWidget *window, GtkWidget *vbox)
ui_tree_view_init_list(ui_main_data.signalslist); ui_tree_view_init_list(ui_main_data.signalslist);
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(ui_main_data.signalslist), TRUE); gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(ui_main_data.signalslist), TRUE);
gtk_widget_set_size_request(GTK_WIDGET(scrolled_window), 530, -1); gtk_widget_set_size_request(GTK_WIDGET(scrolled_window), 580, -1);
gtk_box_pack_start(GTK_BOX(hbox), scrolled_window, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), scrolled_window, FALSE, FALSE, 0);
ui_main_data.text_view = ui_signal_dissect_new(hbox); ui_main_data.text_view = ui_signal_dissect_new(hbox);
...@@ -200,7 +217,7 @@ int ui_tree_view_create(GtkWidget *window, GtkWidget *vbox) ...@@ -200,7 +217,7 @@ int ui_tree_view_create(GtkWidget *window, GtkWidget *vbox)
return 0; return 0;
} }
int ui_tree_view_new_signal_ind(const uint32_t message_number, int ui_tree_view_new_signal_ind(const uint32_t message_number, const gchar *lte_time,
const uint32_t message_id, const char *message_name, const uint32_t message_id, const char *message_name,
const uint32_t origin_task_id, const char *origin_task, const uint32_t origin_task_id, const char *origin_task,
const uint32_t destination_task_id, const char *destination_task, const uint32_t destination_task_id, const char *destination_task,
...@@ -220,7 +237,7 @@ int ui_tree_view_new_signal_ind(const uint32_t message_number, ...@@ -220,7 +237,7 @@ int ui_tree_view_new_signal_ind(const uint32_t message_number,
ui_destroy_filter_menu(FILTER_INSTANCES); ui_destroy_filter_menu(FILTER_INSTANCES);
} }
ui_tree_view_add_to_list(ui_main_data.signalslist, message_number, message_id, message_name, ui_tree_view_add_to_list(ui_main_data.signalslist, lte_time, message_number, message_id, message_name,
origin_task_id, origin_task, destination_task_id, destination_task, instance, (buffer_t *)buffer); origin_task_id, origin_task, destination_task_id, destination_task, instance, (buffer_t *)buffer);
return RC_OK; return RC_OK;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
typedef enum typedef enum
{ {
COL_MSG_NUM = 0, COL_MSG_NUM = 0,
COL_LTE_TIME,
COL_MESSAGE, COL_MESSAGE,
COL_FROM_TASK, COL_FROM_TASK,
COL_TO_TASK, COL_TO_TASK,
...@@ -19,7 +20,7 @@ typedef enum ...@@ -19,7 +20,7 @@ typedef enum
int ui_tree_view_create(GtkWidget *window, GtkWidget *vbox); int ui_tree_view_create(GtkWidget *window, GtkWidget *vbox);
int ui_tree_view_new_signal_ind(const uint32_t message_number, int ui_tree_view_new_signal_ind(const uint32_t message_number, const gchar *lte_time,
const uint32_t message_id, const char *message_name, const uint32_t message_id, const char *message_name,
const uint32_t origin_task_id, const char *origin_task, const uint32_t origin_task_id, const char *origin_task,
const uint32_t destination_task_id, const char *to_task, const uint32_t destination_task_id, const char *to_task,
......
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