fixed graph update

This commit is contained in:
Olaf Rempel 2008-03-19 18:45:17 +01:00
parent f160148198
commit 4a1795ece4
3 changed files with 8 additions and 4 deletions

View File

@ -39,6 +39,10 @@ static void cell_graph_toggle(GtkCellRendererToggle *cell,
else else
var->flags |= TDC_GUI_GRAPH; 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, gtk_list_store_set(GTK_LIST_STORE(user_data), &it,
COL_GRAPH, !toggle, COL_GRAPH, !toggle,
-1); -1);
@ -229,7 +233,8 @@ void gui_vartab_add_var(struct tdc_var *var)
void gui_vartab_update_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; return;
/* do a dummy write to update cells */ /* do a dummy write to update cells */

View File

@ -138,6 +138,7 @@ static int tdcparser_parse(void)
tdcstore_create_board(address, pkt->name); tdcstore_create_board(address, pkt->name);
tdcstore_refresh_values(address, 250); tdcstore_refresh_values(address, 250);
tdcstore_graph_refresh(address, 50);
tdcparser_send_getvars(address); tdcparser_send_getvars(address);
} break; } break;

View File

@ -143,9 +143,7 @@ static void tdcstore_get_bitmap(int address, uint32_t *bitmap)
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
struct tdc_var *var = tdcstore_get_var(address, i); struct tdc_var *var = tdcstore_get_var(address, i);
if ((var != NULL) && (var->flags & TDC_GUI_GRAPH)) if ((var != NULL) && (var->flags & TDC_GUI_GRAPH))
tmp = (tmp << 1) | 0x01; tmp |= (1 << cnt);
else
tmp = (tmp << 1);
cnt = (cnt +1) % 32; cnt = (cnt +1) % 32;
if (cnt == 0) { if (cnt == 0) {