mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Display maximum CNS in the divelist
We either pick the CNS reported by the dive computer at the end of the dive, or the maximum of that and the CNS values in the samples, if any. As usual, this column in the dive list defaults to off and it is controlled by a setting in the tec page of the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9463e7895b
commit
39f80a1e0f
5 changed files with 43 additions and 2 deletions
3
dive.c
3
dive.c
|
@ -414,6 +414,7 @@ struct dive *fixup_dive(struct dive *dive)
|
|||
add_location(dive->location);
|
||||
add_suit(dive->suit);
|
||||
sanitize_cylinder_info(dive);
|
||||
dive->maxcns = dive->cns;
|
||||
dc = &dive->dc;
|
||||
for (i = 0; i < dc->samples; i++) {
|
||||
struct sample *sample = dc->sample + i;
|
||||
|
@ -474,6 +475,8 @@ struct dive *fixup_dive(struct dive *dive)
|
|||
depthtime += (time - lasttime) * (lastdepth + depth) / 2;
|
||||
lastdepth = depth;
|
||||
lasttime = time;
|
||||
if (sample->cns > dive->maxcns)
|
||||
dive->maxcns = sample->cns;
|
||||
}
|
||||
dive->start = start;
|
||||
dive->end = end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue