summaryrefslogtreecommitdiffstats
path: root/planner.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 /planner.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 'planner.c')
-rw-r--r--planner.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/planner.c b/planner.c
index e77fdb995..bab24c6a9 100644
--- a/planner.c
+++ b/planner.c
@@ -34,7 +34,7 @@ void dump_plan(struct diveplan *diveplan)
printf("\nDiveplan @ %04d-%02d-%02d %02d:%02d:%02d (surfpres %dmbar):\n",
tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec,
- diveplan->surface_pressure);
+ diveplan->dc.surface_pressure);
dp = diveplan->dp;
while (dp) {
printf("\t%3u:%02u: %dmm gas: %d o2 %d h2\n", FRACTION(dp->time, 60), dp->depth, dp->o2, dp->he);
@@ -130,7 +130,7 @@ int time_at_last_depth(struct dive *dive, int next_stop, char **cached_data_p)
if (!dive)
return 0;
- surface_pressure = dive->surface_pressure.mbar / 1000.0;
+ surface_pressure = dive->dc.surface_pressure.mbar / 1000.0;
tissue_tolerance = tissue_at_end(dive, cached_data_p);
sample = &dive->dc.sample[dive->dc.samples - 1];
depth = sample->depth.mm;
@@ -184,7 +184,7 @@ struct dive *create_dive_from_plan(struct diveplan *diveplan)
#endif
dive = alloc_dive();
dive->when = diveplan->when;
- dive->surface_pressure.mbar = diveplan->surface_pressure;
+ dive->dc.surface_pressure.mbar = diveplan->surface_pressure;
dc = &dive->dc;
dc->model = strdup("Simulated Dive");
dp = diveplan->dp;