summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-13 21:43:54 +0530
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-13 15:21:30 -0700
commit669a8085d97735d043cfc4ae6e2e55bfac55f236 (patch)
tree4c157fc3fd3193b77bf8ae159177423fc29080b4 /parse-xml.c
parentad79476f5426e0589e47316ed5ea7dc4f3b24682 (diff)
downloadsubsurface-669a8085d97735d043cfc4ae6e2e55bfac55f236.tar.gz
Divinglog import: include heartbeat info
Note, that this patch is not tested with real data as I do not have log that would include heartbeat available. 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 abca70510..7a08f457f 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];
+ char *ptr, temp[4], pres[5], hbeat[4];
short oldcyl = -1;
/* We do not have samples */
@@ -2944,6 +2944,11 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu
cur_sample->cylinderpressure.mbar = atoi(pres) * 100;
}
+ if (data[3] && strlen(data[3])) {
+ memcpy(hbeat, &data[3][i * 14 + 8], 3);
+ cur_sample->heartbeat = atoi(hbeat);
+ }
+
ptr += 12;
sample_end();
}
@@ -3012,7 +3017,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 from Logbook where ID = %d";
+ char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3 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];