summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-13 21:43:56 +0530
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-13 15:21:30 -0700
commit5dd0b1bad5a7e3e9d26fff3ab0919dcc4ffbbac7 (patch)
treeadf6e4db215d309a62085d4c0cb6761fcd79288c /parse-xml.c
parent20b9c241f0e4351604c90bfd7ed528689a21ee6b (diff)
downloadsubsurface-5dd0b1bad5a7e3e9d26fff3ab0919dcc4ffbbac7.tar.gz
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 <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c9
1 files 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];