diff --git a/gui_variable_tab.c b/gui_variable_tab.c index ce4f532..2f859a6 100644 --- a/gui_variable_tab.c +++ b/gui_variable_tab.c @@ -39,6 +39,10 @@ static void cell_graph_toggle(GtkCellRendererToggle *cell, else var->flags |= TDC_GUI_GRAPH; + // FIXME: assuming board 1 + tdcstore_graph_refresh(1, -1); + printf("cell_graph_toggle(%d)\n", var->id); + gtk_list_store_set(GTK_LIST_STORE(user_data), &it, COL_GRAPH, !toggle, -1); @@ -229,7 +233,8 @@ void gui_vartab_add_var(struct tdc_var *var) void gui_vartab_update_var(struct tdc_var *var) { - if (var == current_edited_var) + // TODO: update even in graph mode every xxx ms + if (var == current_edited_var || (var->flags & TDC_GUI_GRAPH)) return; /* do a dummy write to update cells */ diff --git a/tdc_parser.c b/tdc_parser.c index 307e5bb..797c5b4 100644 --- a/tdc_parser.c +++ b/tdc_parser.c @@ -138,6 +138,7 @@ static int tdcparser_parse(void) tdcstore_create_board(address, pkt->name); tdcstore_refresh_values(address, 250); + tdcstore_graph_refresh(address, 50); tdcparser_send_getvars(address); } break; diff --git a/tdc_store.c b/tdc_store.c index dd9886b..94eef38 100644 --- a/tdc_store.c +++ b/tdc_store.c @@ -143,9 +143,7 @@ static void tdcstore_get_bitmap(int address, uint32_t *bitmap) for (i = 0; i < 256; i++) { struct tdc_var *var = tdcstore_get_var(address, i); if ((var != NULL) && (var->flags & TDC_GUI_GRAPH)) - tmp = (tmp << 1) | 0x01; - else - tmp = (tmp << 1); + tmp |= (1 << cnt); cnt = (cnt +1) % 32; if (cnt == 0) {