aboutsummaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-17 15:04:52 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-17 08:51:04 -0700
commit5d12723656c6643ff26f309442aa0b470f32d100 (patch)
tree3811052e3abba76e5fdd9cfcaeb2b35518e137d0 /parse-xml.c
parent6e109a21292463a744f56de85dc1bef330b8d8c0 (diff)
downloadsubsurface-5d12723656c6643ff26f309442aa0b470f32d100.tar.gz
Divinglog import: update O2sensors and dive mode
This is my best guess, and I have no sample logs that would prove my assumption. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 5c6af49fb..3d0c6a1e5 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -3006,6 +3006,20 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu
}
+ /*
+ * My best guess is that if we have o2sensors, then it
+ * is either CCR or PSCR dive. And the first time we
+ * have O2 sensor readings, we can count them to get
+ * the amount O2 sensors.
+ */
+
+ if (!cur_dive->dc.no_o2sensors) {
+ cur_dive->dc.no_o2sensors = cur_sample->o2sensor[0].mbar ? 1 : 0 +
+ cur_sample->o2sensor[1].mbar ? 1 : 0 +
+ cur_sample->o2sensor[2].mbar ? 1 : 0;
+ cur_dive->dc.divemode = CCR;
+ }
+
ptr += 12;
sample_end();
}