summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parse-xml.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/parse-xml.c b/parse-xml.c
index ac6e63eba..d6c189cd2 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1718,8 +1718,10 @@ extern int dm4_dive(void *param, int columns, char **data, char **column)
* Duration = data[3]
* DiveTime = data[15]
*/
+ if (data[3])
+ cur_dive->duration.seconds = atoi(data[3]);
if (data[15])
- cur_dive->duration.seconds = atoi(data[15]);
+ cur_dive->dc.duration.seconds = atoi(data[15]);
/*
* TODO: the deviceid hash should be calculated here.
@@ -1736,11 +1738,11 @@ extern int dm4_dive(void *param, int columns, char **data, char **column)
settings_end();
if (data[6])
- cur_dive->maxdepth.mm = atof(data[6]) * 1000;
+ cur_dive->dc.maxdepth.mm = atof(data[6]) * 1000;
if (data[8])
- cur_dive->airtemp.mkelvin = (atoi(data[8]) + 273.15) * 1000;
+ cur_dive->dc.airtemp.mkelvin = (atoi(data[8]) + 273.15) * 1000;
if (data[9])
- cur_dive->watertemp.mkelvin = (atoi(data[9]) + 273.15) * 1000;
+ cur_dive->dc.watertemp.mkelvin = (atoi(data[9]) + 273.15) * 1000;
/*
* TODO: handle multiple cylinders
@@ -1765,7 +1767,7 @@ extern int dm4_dive(void *param, int columns, char **data, char **column)
cylinder_end();
if (data[14])
- cur_dive->surface_pressure.mbar = (atoi(data[14]) * 1000);
+ cur_dive->dc.surface_pressure.mbar = (atoi(data[14]) * 1000);
interval = data[16] ? atoi(data[16]) : 0;
profileBlob = (float *)data[17];
@@ -1777,7 +1779,7 @@ extern int dm4_dive(void *param, int columns, char **data, char **column)
if (profileBlob)
cur_sample->depth.mm = profileBlob[i] * 1000;
else
- cur_sample->depth.mm = cur_dive->maxdepth.mm;
+ cur_sample->depth.mm = cur_dive->dc.maxdepth.mm;
if (tempBlob)
cur_sample->temperature.mkelvin = (tempBlob[i] + 273.15) * 1000;