diff options
author | Joakim Bygdell <j.bygdell@gmail.com> | 2015-04-09 17:41:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-04-09 14:36:17 -0700 |
commit | afea30fd8a40c16bada295b9b6a89e72d1abe607 (patch) | |
tree | ac86d6a935e04a3dc2e4c4ae4d057cfab41bcdd0 /planner.c | |
parent | 695637dcff4acef19ff7916480a3e842471f361f (diff) | |
download | subsurface-afea30fd8a40c16bada295b9b6a89e72d1abe607.tar.gz |
Recmode: Allow the user to specify gas reserve.
Since most regulators have an intermediate pressure of 10bar
the minimum value is 10 while the max is 99.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -17,8 +17,6 @@ #define TIMESTEP 3 /* second */ #define DECOTIMESTEP 60 /* seconds. Unit of deco stop times */ -#define RESERVE 40000 /* Remaining gas in recreational mode */ - int decostoplevels[] = { 0, 3000, 6000, 9000, 12000, 15000, 18000, 21000, 24000, 27000, 30000, 33000, 36000, 39000, 42000, 45000, 48000, 51000, 54000, 57000, 60000, 63000, 66000, 69000, 72000, 75000, 78000, 81000, 84000, 87000, @@ -845,13 +843,12 @@ bool trial_ascent(int trial_depth, int stoplevel, int avg_depth, int bottom_time bool enough_gas(int current_cylinder) { cylinder_t *cyl; - cyl = &displayed_dive.cylinder[current_cylinder]; if (!cyl->start.mbar) return true; if (cyl->type.size.mliter) - return (float) (cyl->end.mbar - RESERVE) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter; + return (float) (cyl->end.mbar - prefs.reserve_gas) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter; else return true; } |