Add various dive fixups, and show pressure (if any) in the plot

Now the dive profile plot *really* needs some units.  The pressure is
just a random line otherwise.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2011-09-03 13:19:26 -07:00
parent f8e39675cc
commit 1e75ceac0d
6 changed files with 308 additions and 176 deletions

View file

@ -29,7 +29,7 @@ static void record_dive(struct dive *dive)
dive_table.dives = dives;
dive_table.allocated = allocated;
}
dives[nr] = dive;
dives[nr] = fixup_dive(dive);
dive_table.nr = nr+1;
}
@ -787,19 +787,6 @@ static void sample_end(void)
if (!dive)
return;
if (sample->time.seconds > dive->duration.seconds) {
if (sample->depth.mm)
dive->duration = sample->time;
}
if (sample->depth.mm > dive->maxdepth.mm)
dive->maxdepth.mm = sample->depth.mm;
if (sample->temperature.mkelvin) {
if (!dive->watertemp.mkelvin || dive->watertemp.mkelvin > sample->temperature.mkelvin)
dive->watertemp = sample->temperature;
}
sample = NULL;
dive->samples++;
}