summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-23 10:25:31 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-23 12:55:33 -0800
commitb6c9301e584722b9b46dffd4d759e8c60df520ad (patch)
tree2f963ec75672389692e532a8264dc83396900eb2 /libdivecomputer.c
parent3e5a508b15fe28083dfdf5a049d33e8769616395 (diff)
downloadsubsurface-b6c9301e584722b9b46dffd4d759e8c60df520ad.tar.gz
Move more dive computer filled data to the divecomputer structure
This moves the fields 'duration', 'surfacetime', 'maxdepth', 'meandepth', 'airtemp', 'watertemp', 'salinity' and 'surface_pressure' to the per-divecomputer data structure. They are filled in by the dive computer, and normally not edited. NOTE! All actual *use* of this data was then changed from dive->field to dive->dc.field programmatically with a shell-script and sed, and the result then edited for details. So while the XML save and restore code has been updated, all the displaying etc will currently always just show the first dive computer entry. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index cb4789f49..8345c859f 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -441,7 +441,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
dc_parser_destroy(parser);
return rc;
}
- dive->duration.seconds = divetime;
+ dive->dc.duration.seconds = divetime;
// Parse the maxdepth.
double maxdepth = 0.0;
@@ -451,7 +451,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
dc_parser_destroy(parser);
return rc;
}
- dive->maxdepth.mm = maxdepth * 1000 + 0.5;
+ dive->dc.maxdepth.mm = maxdepth * 1000 + 0.5;
// Parse the gas mixes.
unsigned int ngases = 0;
@@ -497,7 +497,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
/* Various libdivecomputer interface fixups */
if (first_temp_is_air && dive->dc.samples) {
- dive->airtemp = dive->dc.sample[0].temperature;
+ dive->dc.airtemp = dive->dc.sample[0].temperature;
dive->dc.sample[0].temperature.mkelvin = 0;
}