aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/deco.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/deco.c')
-rw-r--r--src/deco.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/src/deco.c b/src/deco.c
index 08a3957..f39c61e 100644
--- a/src/deco.c
+++ b/src/deco.c
@@ -5,12 +5,11 @@
#include <stdbool.h>
#include "deco.h"
+#include "units.h"
#define RND(x) (round((x) *10000) / 10000)
enum ALGO ALGO_VER = ALGO_VER_DEFAULT;
-enum UNITS UNITS = UNITS_DEFAULT;
-double SURFACE_PRESSURE = SURFACE_PRESSURE_DEFAULT;
double P_WV = P_WV_DEFAULT;
double END_MAX = END_MAX_DEFAULT;
@@ -65,57 +64,6 @@ const zhl_he_t ZHL16He[] = {
{.t = 240.03, .a = 0.5119, .b = 0.9267},
};
-double bar_to_msw(double bar)
-{
- return bar * 10;
-}
-
-double msw_to_bar(double msw)
-{
- return msw / 10;
-}
-
-double bar_to_fsw(double bar)
-{
- return (bar / 1.01325) * 33.0;
-}
-
-double fsw_to_bar(double fsw)
-{
- return (fsw * 1.01325) / 33.0;
-}
-
-double msw_or_fsw(double msw, double fsw)
-{
- assert(UNITS == METRIC || UNITS == IMPERIAL);
-
- return (UNITS == METRIC) ? msw : fsw;
-}
-
-double xsw_to_bar(double xsw)
-{
- assert(UNITS == METRIC || UNITS == IMPERIAL);
-
- return (UNITS == METRIC) ? msw_to_bar(xsw) : fsw_to_bar(xsw);
-}
-
-double bar_to_xsw(double bar)
-{
- assert(UNITS == METRIC || UNITS == IMPERIAL);
-
- return (UNITS == METRIC) ? bar_to_msw(bar) : bar_to_fsw(bar);
-}
-
-double abs_depth(double gd)
-{
- return gd + SURFACE_PRESSURE;
-}
-
-double gauge_depth(double ad)
-{
- return ad - SURFACE_PRESSURE;
-}
-
void add_segment_ascdec(decostate_t *ds, double dstart, double dend, double time, const gas_t *gas)
{
assert(time > 0);