summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-01-05 22:59:18 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-05 14:07:54 -0800
commit5e56bbf2aa3f480a3e6d98e9c5a20c315cfe063f (patch)
tree8c74a7a990c99bdcbd5d69a3f141feaa33bda975 /parse-xml.c
parent6f3ef2a964299c5e43d3b283636266b80e3c1f25 (diff)
downloadsubsurface-5e56bbf2aa3f480a3e6d98e9c5a20c315cfe063f.tar.gz
DLF import: Decode ppO2
This decodes the ppO2 value stored in the DLF files. It looks like the DiveSoft Freedom computers always stores the ppO2 value, even for OC dives. This import only stores the ppO2 value from CCR and PSCR dives, where these values comes from sensors and makes sense to store. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 14ece90d9..cde67327f 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2591,6 +2591,11 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
sample_start();
cur_sample->time.seconds = time;
cur_sample->depth.mm = ((ptr[5] << 8) + ptr[4]) * 10;
+ // Crazy precision on these stored values...
+ // Only store value if we're in CCR/PSCR mode,
+ // because we rather calculate ppo2 our selfs.
+ if (cur_dc->dctype == CCR || cur_dc->dctype == PSCR)
+ cur_sample->o2sensor[0].mbar = ((ptr[7] << 8) + ptr[6]) / 10;
sample_end();
break;
case 1: