UNPKG

dive-deco

Version:

A TypeScript implementation of decompression calculation algorithms for scuba diving, featuring Bühlmann ZH-L16C algorithm with gradient factors, gas management, and oxygen toxicity tracking.

21 lines (20 loc) 724 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DecoModel = void 0; const types_1 = require("./types"); const depth_1 = require("./depth"); class DecoModel { // Check if in decompression obligation inDeco() { const ceilingType = this.config().ceilingType(); switch (ceilingType) { case types_1.CeilingType.Actual: return this.ceiling().greaterThan(depth_1.Depth.zero()); case types_1.CeilingType.Adaptive: const currentGas = this.diveState().gas; const runtime = this.deco([currentGas]); return runtime.decoStages.length > 1; } } } exports.DecoModel = DecoModel;