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:
parent
f7fb74f3a7
commit
2cd2cafdf4
@ -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++;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user