From 2721baebd9e4d6e5c869af401c509e5e74c5a9c8 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Wed, 7 May 2025 21:28:44 -0700 Subject: correct avg print size; no debug print --- remote_plot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'remote_plot.c') diff --git a/remote_plot.c b/remote_plot.c index 148fc33..9962281 100644 --- a/remote_plot.c +++ b/remote_plot.c @@ -438,7 +438,7 @@ static gboolean read_data(gpointer user_data) for(int i=0;icans.end->item.volt[i]); + //printf("volt[%d]: %g\n",i,data->cans.end->item.volt[i]); sum+=data->cans.end->item.volt[i]; if(i>0) { @@ -449,12 +449,12 @@ static gboolean read_data(gpointer user_data) } } avg=sum/VOLTLEN; - sprintf(str,"min/avg/max voltage: %6.4f/%.0f/%6.4f V",vmin,avg,vmax); + sprintf(str,"min/avg/max voltage: %6.4f/%6.4f/%6.4f V",vmin,avg,vmax); gtk_label_set_text(GTK_LABEL(data->volt_label),str); sum=0; for(int i=0;icans.end->item.temp[i]); + //printf("temp[%d]: %hhu\n",i,data->cans.end->item.temp[i]); sum+=data->cans.end->item.temp[i]; if(i>0) { @@ -465,7 +465,7 @@ static gboolean read_data(gpointer user_data) } } avg=sum/TEMPLEN; - sprintf(str,"min/avg/max temperature: %3hhu/%.1f/%3hhu C",tmin,avg,tmax); + sprintf(str,"min/avg/max temperature: %3hhu/%.0f/%3hhu C",tmin,avg,tmax); gtk_label_set_text(GTK_LABEL(data->temp_label),str); new_entry=false; gtk_widget_queue_draw(data->area); -- cgit v1.2.3-70-g09d2