From a7231be9a0220e343537be9d962b33b44ef397d4 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 23 Jul 2017 21:54:41 +0300 Subject: Detect CCR/PSCR from Divinglog import Signed-off-by: Miika Turkia --- core/parse-xml.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'core/parse-xml.c') diff --git a/core/parse-xml.c b/core/parse-xml.c index 65c3eee6b..e6861d44d 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -3375,6 +3375,19 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) return 1; } + if (data[15]) { + switch (data[15][0]) { + /* OC */ + case '0': + break; + case '1': + cur_dive->dc.divemode = PSCR; + break; + case '2': + cur_dive->dc.divemode = CCR; + break; + } + } dc_settings_end(); settings_end(); @@ -3408,7 +3421,7 @@ int parse_divinglog_buffer(sqlite3 *handle, const char *url, const char *buffer, char *err = NULL; target_table = table; - char get_dives[] = "select Number,strftime('%s',Divedate || ' ' || ifnull(Entrytime,'00:00')),Country || ' - ' || City || ' - ' || Place,Buddy,Comments,Depth,Divetime,Divemaster,Airtemp,Watertemp,Weight,Divesuit,Computer,ID,Visibility from Logbook where UUID not in (select UUID from DeletedRecords)"; + char get_dives[] = "select Number,strftime('%s',Divedate || ' ' || ifnull(Entrytime,'00:00')),Country || ' - ' || City || ' - ' || Place,Buddy,Comments,Depth,Divetime,Divemaster,Airtemp,Watertemp,Weight,Divesuit,Computer,ID,Visibility,SupplyType from Logbook where UUID not in (select UUID from DeletedRecords)"; retval = sqlite3_exec(handle, get_dives, &divinglog_dive, handle, &err); -- cgit v1.2.3-70-g09d2