From 5dd0b1bad5a7e3e9d26fff3ab0919dcc4ffbbac7 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Mon, 13 Jul 2015 21:43:56 +0530 Subject: Divinglog import: show stop depth / ceiling This shows the ceiling as stored by Divinglog. (I am not sure if it is DC reported ceiling, or just a calculated one.) Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- parse-xml.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/parse-xml.c b/parse-xml.c index 7a08f457f..3ab165292 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -2882,7 +2882,7 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu { int sinterval = 0; unsigned long i, len, lenprofile2 = 0; - char *ptr, temp[4], pres[5], hbeat[4]; + char *ptr, temp[4], pres[5], hbeat[4], stop[4]; short oldcyl = -1; /* We do not have samples */ @@ -2949,6 +2949,11 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu cur_sample->heartbeat = atoi(hbeat); } + if (data[4] && strlen(data[4])) { + memcpy(stop, &data[4][i * 9 + 6], 3); + cur_sample->stopdepth.mm = atoi(stop) * 1000; + } + ptr += 12; sample_end(); } @@ -3017,7 +3022,7 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) int retval = 0; sqlite3 *handle = (sqlite3 *)param; char *err = NULL; - char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3 from Logbook where ID = %d"; + char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3,Profile4 from Logbook where ID = %d"; char get_cylinder0_template[] = "select 0,TankSize,PresS,PresE,PresW,O2,He,DblTank from Logbook where ID = %d"; char get_cylinder_template[] = "select TankID,TankSize,PresS,PresE,PresW,O2,He,DblTank from Tank where LogID = %d order by TankID"; char get_buffer[1024]; -- cgit v1.2.3-70-g09d2