Avoid zero degrees Kelvin in yearly statistics

Maximum and minimum degrees in the yearly statistics were displayed
as -273.1°C if no temperature info was present.

H

From 7d9aad01133bc03980f66a2d109c9ef909e518ad Mon Sep 17 00:00:00 2001
From: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Date: Tue, 16 Oct 2012 18:13:16 +0200
Subject: [PATCH] Avoid zero degrees Kelvin in yearly statistics
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Maximum and minimum degrees in the yearly statistics were displayed
as -273.1°C if no temperature info was present.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Henrik Brautaset Aronsen 2012-10-16 18:14:34 +02:00 committed by Dirk Hohndel
parent faff4d29dd
commit 13cc5afb7f

View file

@ -290,12 +290,20 @@ static void process_interval_stats(stats_t stats_interval, GtkTreeIter *parent,
add_cell_to_tree(store, "", 12, row);
}
/* Coldest water temperature */
snprintf(value_str, sizeof(value_str), "%.1f %s\t", value, unit);
add_cell_to_tree(store, value_str, 13, row);
if (value > -100.0) {
snprintf(value_str, sizeof(value_str), "%.1f %s\t", value, unit);
add_cell_to_tree(store, value_str, 13, row);
} else {
add_cell_to_tree(store, "", 13, row);
}
/* Warmest water temperature */
value = get_temp_units(stats_interval.max_temp, &unit);
snprintf(value_str, sizeof(value_str), "%.1f %s", value, unit);
add_cell_to_tree(store, value_str, 14, row);
if (value > -100.0) {
snprintf(value_str, sizeof(value_str), "%.1f %s", value, unit);
add_cell_to_tree(store, value_str, 14, row);
} else {
add_cell_to_tree(store, "", 14, row);
}
}
void clear_statistics()