mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 17:23:23 +00:00
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
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue