From: Henrik Brautaset Aronsen <[email protected]>

Leave out o2=20.9 when we save the divelog.  This will make the
log less cluttered for those who do most of their dives on air.

Signed-off-by: Henrik Brautaset Aronsen <[email protected]>
---
 save-git.c | 3 ++-
 save-xml.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/save-git.c b/save-git.c
index 6abba60..a4e059e 100644
--- a/save-git.c
+++ b/save-git.c
@@ -128,8 +128,9 @@ static void save_cylinder_info(struct membuffer *b, struct 
dive *dive)
                cylinder_t *cylinder = dive->cylinder + i;
                int volume = cylinder->type.size.mliter;
                const char *description = cylinder->type.description;
-               int o2 = cylinder->gasmix.o2.permille;
                int he = cylinder->gasmix.he.permille;
+               // hide o2 entry if this is air:
+               int o2 = is_air(cylinder->gasmix.o2.permille, he) ? 0 : 
cylinder->gasmix.o2.permille;
 
                put_string(b, "cylinder");
                if (volume)
diff --git a/save-xml.c b/save-xml.c
index e52cfdf..2641765 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -196,8 +196,9 @@ static void save_cylinder_info(struct membuffer *b, struct 
dive *dive)
                cylinder_t *cylinder = dive->cylinder + i;
                int volume = cylinder->type.size.mliter;
                const char *description = cylinder->type.description;
-               int o2 = cylinder->gasmix.o2.permille;
                int he = cylinder->gasmix.he.permille;
+               // hide o2 entry if this is air:
+               int o2 = is_air(cylinder->gasmix.o2.permille, he) ? 0 : 
cylinder->gasmix.o2.permille;
 
                put_format(b, "  <cylinder");
                if (volume)
-- 
1.8.5.2 (Apple Git-48)

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to