aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/opendeco.c
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2022-10-12 16:04:51 +0200
committerGravatar Tim Segers <tsegers@pm.me>2022-10-12 16:05:56 +0200
commit879de8903e617d9e172a36045dc1b7b7ca4250c1 (patch)
tree82340b12e10ea7abb65d4c1eccf89b259f17a47a /src/opendeco.c
parent378ee4dbffb8c99ffe8a74bcce70e96851a3624a (diff)
downloadopendeco-879de8903e617d9e172a36045dc1b7b7ca4250c1.tar.gz
Add option to perform last deco stop at 6m instead of 3m
Diffstat (limited to 'src/opendeco.c')
-rw-r--r--src/opendeco.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/opendeco.c b/src/opendeco.c
index 9329383..ae95f58 100644
--- a/src/opendeco.c
+++ b/src/opendeco.c
@@ -38,6 +38,7 @@ static struct argp_option options[] = {
{"gfhigh", 'h', "NUMBER", 0, "Set the gradient factor at the surface, defaults to 75", 5},
{"decogasses", 'G', "LIST", 0, "Set the gasses available for deco", 6},
{0, 's', 0, OPTION_ARG_OPTIONAL, "Only switch gas at deco stops", 7},
+ {0, '6', 0, OPTION_ARG_OPTIONAL, "Perform last deco stop at 6m", 8},
{0, 0, 0, 0, "Informational options:", 0},
{0, 0, 0, 0, 0, 0}
};
@@ -51,6 +52,7 @@ struct arguments {
char *decogasses;
double SURFACE_PRESSURE;
int SWITCH_INTERMEDIATE;
+ int LAST_STOP_AT_SIX;
};
static error_t parse_opt(int key, char *arg, struct argp_state *state)
@@ -73,6 +75,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
case 's':
arguments->SWITCH_INTERMEDIATE = 0;
break;
+ case '6':
+ arguments->LAST_STOP_AT_SIX = 1;
+ break;
case 'G':
arguments->decogasses = arg;
break;
@@ -174,17 +179,17 @@ int main(int argc, char *argv[])
.gflow = 30,
.gfhigh = 75,
.decogasses = "",
- .SURFACE_PRESSURE = 0,
- .SWITCH_INTERMEDIATE = 1,
+ .SURFACE_PRESSURE = SURFACE_PRESSURE_DEFAULT,
+ .SWITCH_INTERMEDIATE = SWITCH_INTERMEDIATE_DEFAULT,
+ .LAST_STOP_AT_SIX = LAST_STOP_AT_SIX_DEFAULT,
};
argp_parse(&argp, argc, argv, 0, 0, &arguments);
/* apply global options */
- if (arguments.SURFACE_PRESSURE > 0)
- SURFACE_PRESSURE = arguments.SURFACE_PRESSURE;
-
+ SURFACE_PRESSURE = arguments.SURFACE_PRESSURE;
SWITCH_INTERMEDIATE = arguments.SWITCH_INTERMEDIATE;
+ LAST_STOP_AT_SIX = arguments.LAST_STOP_AT_SIX;
/* setup */
decostate_t ds;