diff options
author | Rick Walsh <rickmwalsh@gmail.com> | 2015-07-26 19:27:15 +1000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-26 09:14:06 -0700 |
commit | 90d15c20c4f1b0aef2508a74b29058ad21af9197 (patch) | |
tree | d7c9dae733d98d5ee35c5288dc627930e1027af4 /planner.c | |
parent | 4f056228465717d04ec6712f129bddad56f21323 (diff) | |
download | subsurface-90d15c20c4f1b0aef2508a74b29058ad21af9197.tar.gz |
Planner: Count the minimum stop time towards o2time
When doing backgas breaks, count the minimum stop time towards o2time.
Previously, the initial minimum stop wasn't counted, so the time of the first
segment on oxygen was min_switch_duration + 12 minutes.
E.g. with 1 minute minimum switch duration.
Previously:
depth duration runtime gas
40m 1min 1min air
40m 34min 35min
21m 2min 37min
21m 1min 38min EAN50
18m 1min 39min
15m 3min 42min
12m 4min 46min
9m 5min 51min
6m 13min 64min oxygen <--13 minutes on O2
6m 6min 70min air
6m 2min 72min oxygen
0m 1min 73min
Now:
depth duration runtime gas
40m 1min 1min air
40m 34min 35min
21m 2min 37min
21m 1min 38min EAN50
18m 1min 39min
15m 3min 42min
12m 4min 46min
9m 5min 51min
6m 12min 63min oxygen
6m 6min 69min air
6m 2min 71min oxygen
0m 1min 72min
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1121,6 +1121,8 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool &displayed_dive.cylinder[current_cylinder].gasmix, prefs.min_switch_duration, po2, &displayed_dive, prefs.decosac); clock += prefs.min_switch_duration; + if (prefs.doo2breaks && get_o2(&displayed_dive.cylinder[current_cylinder].gasmix) == 1000) + o2time += prefs.min_switch_duration; } else { pendinggaschange = true; } @@ -1158,6 +1160,8 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool &displayed_dive.cylinder[current_cylinder].gasmix, prefs.min_switch_duration, po2, &displayed_dive, prefs.decosac); clock += prefs.min_switch_duration; + if (prefs.doo2breaks && get_o2(&displayed_dive.cylinder[current_cylinder].gasmix) == 1000) + o2time += prefs.min_switch_duration; pendinggaschange = false; } |