show real voltage value

This commit is contained in:
Olaf Rempel 2008-06-22 23:50:55 +02:00
parent 8027ce29b7
commit 349e7b7156

View File

@ -96,7 +96,9 @@ static void update_status_boxes(struct blmc_status *status)
snprintf(buf, sizeof(buf), "%d", status->current); snprintf(buf, sizeof(buf), "%d", status->current);
gtk_entry_set_text(GTK_ENTRY(entry404), buf); gtk_entry_set_text(GTK_ENTRY(entry404), buf);
snprintf(buf, sizeof(buf), "%d", status->voltage); double voltage = (status->voltage * 5.00 * (18000 + 4700)) / (6 * 1024 * 4700);
snprintf(buf, sizeof(buf), "%2.3f", voltage);
gtk_entry_set_text(GTK_ENTRY(entry405), buf); gtk_entry_set_text(GTK_ENTRY(entry405), buf);
} }