aboutsummaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2014-06-03 19:21:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-03 17:05:25 -0700
commiteaf6d564874ac838dc4f3cca7a781034ae60ef7f (patch)
treed214c58bdc33f6dbd058afe715de357dd14d4114 /planner.c
parent1fec6453a2b7b6dcd34901a4e92dd11aae38879c (diff)
downloadsubsurface-eaf6d564874ac838dc4f3cca7a781034ae60ef7f.tar.gz
CCR code: Change to sample structure
1) All the variables in the sample structures are strongly typed 2) Two additional types were declared in units.h: o2pressure_t bearing_t 3) The following variables were added: diluentpressure o2setpoint o2sensor[3] 4) Changes to a number of files were made to chanf sample->po2 to sample->po2.mbar bearing to bearring.degrees Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/planner.c b/planner.c
index 445d375c5..32411b950 100644
--- a/planner.c
+++ b/planner.c
@@ -159,7 +159,7 @@ double tissue_at_end(struct dive *dive, char **cached_datap)
}
if (i > 0)
lastdepth = psample->depth.mm;
- tissue_tolerance = interpolate_transition(dive, t0, t1, lastdepth, sample->depth.mm, &dive->cylinder[gasidx].gasmix, sample->po2);
+ tissue_tolerance = interpolate_transition(dive, t0, t1, lastdepth, sample->depth.mm, &dive->cylinder[gasidx].gasmix, sample->po2.mbar);
psample = sample;
t0 = t1;
}
@@ -263,7 +263,7 @@ static struct dive *create_dive_from_plan(struct diveplan *diveplan, struct dive
cyl = &master_dive->cylinder[0];
oldgasmix = cyl->gasmix;
sample = prepare_sample(dc);
- sample->po2 = dp->po2;
+ sample->po2.mbar = dp->po2;
finish_sample(dc);
while (dp) {
struct gasmix gasmix = dp->gasmix;
@@ -300,7 +300,7 @@ static struct dive *create_dive_from_plan(struct diveplan *diveplan, struct dive
/* need to insert a first sample for the new gas */
add_gas_switch_event(dive, dc, lasttime + 1, idx);
sample = prepare_sample(dc);
- sample[-1].po2 = po2;
+ sample[-1].po2.mbar = po2;
sample->time.seconds = lasttime + 1;
sample->depth.mm = lastdepth;
finish_sample(dc);
@@ -311,8 +311,8 @@ static struct dive *create_dive_from_plan(struct diveplan *diveplan, struct dive
sample = prepare_sample(dc);
/* set po2 at beginning of this segment */
/* and keep it valid for last sample - where it likely doesn't matter */
- sample[-1].po2 = po2;
- sample->po2 = po2;
+ sample[-1].po2.mbar = po2;
+ sample->po2.mbar = po2;
sample->time.seconds = lasttime = time;
sample->depth.mm = lastdepth = depth;
update_cylinder_pressure(dive, sample[-1].depth.mm, depth, time - sample[-1].time.seconds,
@@ -703,7 +703,7 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, s
/* we start with gas 0, then check if that was changed */
gas = dive->cylinder[0].gasmix;
get_gas_from_events(&dive->dc, sample->time.seconds, &gas);
- po2 = dive->dc.sample[dive->dc.samples - 1].po2;
+ po2 = dive->dc.sample[dive->dc.samples - 1].po2.mbar;
if ((current_cylinder = get_gasidx(dive, &gas)) == -1) {
report_error(translate("gettextFromC", "Can't find gas %s"), gasname(&gas));
current_cylinder = 0;