aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2022-09-30 23:02:08 +0200
committerGravatar Tim Segers <tsegers@pm.me>2022-09-30 23:02:08 +0200
commit6af5ecc8610d0a2eb99a91a06d2780fb517032b9 (patch)
tree8c2f970f079fa957141b7b099d2534485413c070
parent0781c1aea3021ac70199963018e7639ac4cf55d2 (diff)
downloadopendeco-6af5ecc8610d0a2eb99a91a06d2780fb517032b9.tar.gz
Remove extend_to_ndl function
-rw-r--r--schedule.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/schedule.c b/schedule.c
index 0fc3c4e..c3982d2 100644
--- a/schedule.c
+++ b/schedule.c
@@ -5,7 +5,6 @@
#include "schedule.h"
-#define SAFETY_STOP_DEPTH (abs_depth(msw_to_bar(6)))
#define SWITCH_INTERMEDIATE 1
const gas_t *best_gas(const double depth, const gas_t *gasses, const int nof_gasses)
@@ -90,41 +89,6 @@ double calc_ndl(decostate_t *ds, const double depth, const double ascrate, const
return ndl;
}
-void extend_to_ndl(decostate_t *ds, const double depth, const double ascrate, const gas_t *gas,
- segment_callback_t seg_cb)
-{
- double ndl = calc_ndl(ds, depth, ascrate, gas);
-
- /* add segment to reach ndl */
- if (ndl) {
- add_segment_const(ds, depth, ndl, gas);
- seg_cb(ds, (waypoint_t){.depth = depth, .time = ndl, .gas = gas}, SEG_NDL);
- }
-
- /* either ascend directly or make a safety stop */
- if (depth < SAFETY_STOP_DEPTH || ds->max_depth < abs_depth(msw_to_bar(10))) {
- /* surface */
- add_segment_ascdec(ds, depth, SURFACE_PRESSURE, gauge_depth(depth) / ascrate, gas);
- seg_cb(ds, (waypoint_t){.depth = SURFACE_PRESSURE, .time = gauge_depth(depth) / ascrate, .gas = gas},
- SEG_SURFACE);
- } else {
- /* ascend to safety stop */
- add_segment_ascdec(ds, depth, SAFETY_STOP_DEPTH, (depth - SAFETY_STOP_DEPTH) / ascrate, gas);
- seg_cb(ds, (waypoint_t){.depth = SAFETY_STOP_DEPTH, .time = (depth - SAFETY_STOP_DEPTH) / ascrate, .gas = gas},
- SEG_TRAVEL);
-
- /* stop for 3 minutes */
- add_segment_const(ds, SAFETY_STOP_DEPTH, 3, gas);
- seg_cb(ds, (waypoint_t){.depth = SAFETY_STOP_DEPTH, .time = 3, .gas = gas}, SEG_SAFETY_STOP);
-
- /* surface */
- add_segment_ascdec(ds, SAFETY_STOP_DEPTH, SURFACE_PRESSURE, gauge_depth(SAFETY_STOP_DEPTH) / ascrate, gas);
- seg_cb(ds,
- (waypoint_t){.depth = SURFACE_PRESSURE, .time = gauge_depth(SAFETY_STOP_DEPTH) / ascrate, .gas = gas},
- SEG_SURFACE);
- }
-}
-
decoinfo_t calc_deco(decostate_t *ds, const double start_depth, const gas_t *start_gas, const gas_t *deco_gasses,
const int nof_gasses, segment_callback_t seg_cb)
{