summaryrefslogtreecommitdiffstats
path: root/profile.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 /profile.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 'profile.c')
-rw-r--r--profile.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/profile.c b/profile.c
index 5f4149208..18987c274 100644
--- a/profile.c
+++ b/profile.c
@@ -1540,8 +1540,8 @@ static void calculate_max_limits(struct dive *dive, struct divecomputer *dc, str
memset(pi, 0, sizeof(*pi));
/* This should probably have been per-dive-computer */
- maxdepth = dive->maxdepth.mm;
- mintemp = maxtemp = dive->watertemp.mkelvin;
+ maxdepth = dive->dc.maxdepth.mm;
+ mintemp = maxtemp = dive->dc.watertemp.mkelvin;
/* Get the per-cylinder maximum pressure if they are manual */
for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
@@ -1815,7 +1815,7 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
{
int i;
double amb_pressure;
- double surface_pressure = (dive->surface_pressure.mbar ? dive->surface_pressure.mbar : SURFACE_PRESSURE) / 1000.0;
+ double surface_pressure = (dive->dc.surface_pressure.mbar ? dive->dc.surface_pressure.mbar : SURFACE_PRESSURE) / 1000.0;
for (i = 1; i < pi->nr; i++) {
int fo2, fhe, j, t0, t1;
@@ -1925,7 +1925,7 @@ static struct plot_info *create_plot_info(struct dive *dive, struct divecomputer
/* Then, calculate partial pressures and deco information */
calculate_deco_information(dive, dc, pi);
- pi->meandepth = dive->meandepth.mm;
+ pi->meandepth = dive->dc.meandepth.mm;
if (0) /* awesome for debugging - not useful otherwise */
dump_pi(pi);
@@ -1991,9 +1991,9 @@ void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale)
/* The dive has no samples, so create a few fake ones. This assumes an
ascent/descent rate of 9 m/min, which is just below the limit for FAST. */
- int duration = dive->duration.seconds;
- int maxdepth = dive->maxdepth.mm;
- int asc_desc_time = dive->maxdepth.mm*60/9000;
+ int duration = dive->dc.duration.seconds;
+ int maxdepth = dive->dc.maxdepth.mm;
+ int asc_desc_time = dive->dc.maxdepth.mm*60/9000;
if (asc_desc_time * 2 >= duration)
asc_desc_time = duration / 2;
fake[1].time.seconds = asc_desc_time;