From 90d15c20c4f1b0aef2508a74b29058ad21af9197 Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Sun, 26 Jul 2015 19:27:15 +1000 Subject: Planner: Count the minimum stop time towards o2time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Dirk Hohndel --- planner.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'planner.c') diff --git a/planner.c b/planner.c index f94676fe0..b6ffa5744 100644 --- a/planner.c +++ b/planner.c @@ -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; } -- cgit v1.2.3-70-g09d2