diff options
author | Xiao Pan <xyz@flylightning.xyz> | 2025-05-07 21:28:44 -0700 |
---|---|---|
committer | Xiao Pan <xyz@flylightning.xyz> | 2025-05-07 21:28:44 -0700 |
commit | 2721baebd9e4d6e5c869af401c509e5e74c5a9c8 (patch) | |
tree | ec2b73db610fca1a3bffc2924452b18f0cf5c9a5 /remote_plot.c | |
parent | b84874b4cd460550f5ddfae9d807736244ed8d8e (diff) |
correct avg print size; no debug print
Diffstat (limited to 'remote_plot.c')
-rw-r--r-- | remote_plot.c | 8 |
1 files changed, 4 insertions, 4 deletions
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;i<VOLTLEN;i++) { - printf("volt[%d]: %g\n",i,data->cans.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;i<TEMPLEN;i++) { - printf("temp[%d]: %hhu\n",i,data->cans.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); |