aboutsummaryrefslogtreecommitdiffstats
path: root/uemis.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 /uemis.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 'uemis.c')
-rw-r--r--uemis.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/uemis.c b/uemis.c
index 29913ca0d..1a09a2c3a 100644
--- a/uemis.c
+++ b/uemis.c
@@ -276,7 +276,7 @@ static void uemis_event(struct dive *dive, struct divecomputer *dc, struct sampl
}
#if UEMIS_DEBUG & 32
printf("%dm:%ds: p_amb_tol:%d surface:%d holdtime:%d holddepth:%d/%d ---> stopdepth:%d stoptime:%d ndl:%d\n",
- sample->time.seconds / 60, sample->time.seconds % 60, u_sample->p_amb_tol, dive->surface_pressure.mbar,
+ sample->time.seconds / 60, sample->time.seconds % 60, u_sample->p_amb_tol, dive->dc.surface_pressure.mbar,
u_sample->hold_time, u_sample->hold_depth, stopdepth, sample->stopdepth.mm, sample->stoptime.seconds, sample->ndl.seconds);
#endif
}
@@ -297,12 +297,12 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
datalen = uemis_convert_base64(base64, &data);
- dive->airtemp.mkelvin = *(uint16_t *)(data + 45) * 100 + 273150;
- dive->surface_pressure.mbar = *(uint16_t *)(data + 43);
+ dive->dc.airtemp.mkelvin = *(uint16_t *)(data + 45) * 100 + 273150;
+ dive->dc.surface_pressure.mbar = *(uint16_t *)(data + 43);
if (*(uint8_t *)(data + 19))
- dive->salinity = 10300; /* avg grams per 10l sea water */
+ dive->dc.salinity = 10300; /* avg grams per 10l sea water */
else
- dive->salinity = 10000; /* grams per 10l fresh water */
+ dive->dc.salinity = 10000; /* grams per 10l fresh water */
/* this will allow us to find the last dive read so far from this computer */
dc->model = strdup("Uemis Zurich");
@@ -346,7 +346,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
/* the SDA usually records more samples after the end of the dive --
* we want to discard those, but not cut the dive short; sadly the dive
* duration in the header is a) in minutes and b) up to 3 minutes short */
- if (u_sample->dive_time > dive->duration.seconds + 180)
+ if (u_sample->dive_time > dive->dc.duration.seconds + 180)
break;
if (u_sample->active_tank != active) {
active = u_sample->active_tank;
@@ -365,6 +365,6 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
i += 0x25;
u_sample++;
}
- dive->duration.seconds = sample->time.seconds - 1;
+ dive->dc.duration.seconds = sample->time.seconds - 1;
return;
}