Generate 'watertemp' field from samples if required

Sure, it's redundant, but it's convenient for the general dive info.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2011-09-01 22:21:16 -07:00
parent f7fb74f3a7
commit 2cd2cafdf4

View file

@ -600,6 +600,11 @@ static void sample_end(void)
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++;
}