summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-16 09:51:38 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-16 09:51:38 -0700
commit60a62cf84392233445c8974ef2dc1d2c01307935 (patch)
tree21949625206dbc10b1dd58afacac411c381d7e8a /profile.c
parentec97a62f34eb9049a5face8782631853090bd85e (diff)
downloadsubsurface-60a62cf84392233445c8974ef2dc1d2c01307935.tar.gz
Minor corrections to printing of the last temperature
- the time stamp where we printed the last temp was wrong - we really shouldn't check mK for being identical - especially on dive computers that store a lot of samples Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/profile.c b/profile.c
index 72a1589d9..a56b7641f 100644
--- a/profile.c
+++ b/profile.c
@@ -343,14 +343,13 @@ static void plot_single_temp_text(struct graphics_context *gc, int sec, int mkel
static void plot_temperature_text(struct graphics_context *gc, struct plot_info *pi)
{
int i;
- int last = 0;
+ int last = 0, sec = 0;
int last_temperature = 0, last_printed_temp = 0;
if (!setup_temperature_limits(gc, pi))
return;
for (i = 0; i < pi->nr; i++) {
- int sec;
struct plot_data *entry = pi->entry+i;
int mkelvin = entry->temperature;
@@ -365,8 +364,8 @@ static void plot_temperature_text(struct graphics_context *gc, struct plot_info
last_printed_temp = mkelvin;
}
/* it would be nice to print the end temperature, if it's different */
- if (last_temperature != last_printed_temp)
- plot_single_temp_text(gc, last, last_temperature);
+ if (abs(last_temperature - last_printed_temp) > 500)
+ plot_single_temp_text(gc, sec, last_temperature);
}
static void plot_temperature_profile(struct graphics_context *gc, struct plot_info *pi)