mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Do more dive fixup for each dive computer
In commit b6c9301e58
("Move more dive computer filled data to the
divecomputer structure") we moved the fields that get filled in by the
dive computers to be per-divecomputer data structures.
This patch re-creates some of those fields back in the "struct dive",
but now the fields are initialized to be a reasonable average from the
dive computer data. We already did some of this for the temperature
min/max fields for the statistics, so this just continues that trend.
The goal is to make it easy to look at "dive values" without having to
iterate over dive computers every time you do. Just do it once in
"fixup_dive()" instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b286ea638c
commit
926fcef2a1
7 changed files with 86 additions and 51 deletions
|
@ -172,7 +172,7 @@ static void save_airpressure(FILE *f, struct divecomputer *dc)
|
|||
static void save_salinity(FILE *f, struct divecomputer *dc)
|
||||
{
|
||||
/* only save if we have a value that isn't the default of sea water */
|
||||
if (!dc->salinity || dc->salinity == 10300)
|
||||
if (!dc->salinity || dc->salinity == SEAWATER_SALINITY)
|
||||
return;
|
||||
fputs(" <water", f);
|
||||
show_salinity(f, dc->salinity, " salinity='", "'");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue