From 5e56bbf2aa3f480a3e6d98e9c5a20c315cfe063f Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Mon, 5 Jan 2015 22:59:18 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- parse-xml.c | 5 +++++ 1 file changed, 5 insertions(+) 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: -- cgit v1.2.3-70-g09d2