Skip to content

vperrinfr/Diving_Deco_Educ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿคฟ Decompression Calculator

Une application web moderne de calcul de profils de dรฉcompression pour la plongรฉe sous-marine, basรฉe sur l'algorithme Bรผhlmann ZHL-16C avec facteurs de gradient.

Vue 3 TypeScript Vite

โš ๏ธ Avertissement Important

Cette application est destinรฉe ร  des fins รฉducatives uniquement.

  • Ne jamais utiliser cette application pour planifier de vraies plongรฉes
  • Toujours utiliser des ordinateurs de plongรฉe certifiรฉs
  • Suivre les procรฉdures de planification de plongรฉe appropriรฉes
  • Ne jamais plonger au-delร  de votre niveau de formation et de certification

๐ŸŒŸ Fonctionnalitรฉs

Calculs de Dรฉcompression

  • Plongรฉes simples : Calcul de profils pour des plongรฉes ร  un seul niveau
  • Plongรฉes multi-niveaux : Support des plongรฉes avec plusieurs segments de profondeur
  • Multi-gaz : Gestion de plusieurs mรฉlanges gazeux (Air, Nitrox, Trimix)
  • Algorithme Bรผhlmann ZHL-16C : Implรฉmentation complรจte avec 16 compartiments tissulaires
  • Facteurs de gradient : Personnalisation des facteurs de gradient (GF Low/High)

Visualisations

  • Graphique de profil : Visualisation interactive du profil de plongรฉe
  • Paliers de dรฉcompression : Affichage dรฉtaillรฉ de tous les paliers requis
  • Temps de plongรฉe : Calcul du temps total, temps de fond, et temps de dรฉcompression
  • Limite sans dรฉcompression (NDL) : Calcul automatique pour les plongรฉes simples

Gestion des Gaz

  • Mรฉlanges personnalisรฉs : Configuration de l'oxygรจne, azote et hรฉlium
  • Profondeur maximale d'utilisation (MOD) : Calcul automatique basรฉ sur la PpO2
  • Changements de gaz : Support des changements de gaz pendant la remontรฉe
  • Validation de sรฉcuritรฉ : Vรฉrification de la toxicitรฉ de l'oxygรจne et de la narcose

Interface Utilisateur

  • Design moderne : Interface basรฉe sur Carbon Design System d'IBM
  • Responsive : Optimisรฉ pour desktop, tablette et mobile
  • Thรจme sombre : Interface รฉlรฉgante avec thรจme sombre
  • Avertissements : Systรจme d'alertes pour les conditions dangereuses

๐Ÿš€ Installation

Prรฉrequis

  • Node.js (version 18 ou supรฉrieure)
  • npm ou yarn

ร‰tapes d'installation

  1. Cloner le dรฉpรดt
git clone <repository-url>
cd decompression-calculator
  1. Installer les dรฉpendances
npm install
  1. Lancer le serveur de dรฉveloppement
npm run dev
  1. Ouvrir dans le navigateur
http://localhost:5173

๐Ÿ“š Documentation Technique

Pour plus de dรฉtails sur l'architecture et l'implรฉmentation :

๐Ÿ“ฆ Scripts Disponibles

# Dรฉmarrer le serveur de dรฉveloppement
npm run dev

# Compiler pour la production
npm run build

# Prรฉvisualiser la version de production
npm run preview

๐Ÿ—๏ธ Architecture Technique

Stack Technologique

  • Framework : Vue 3 avec Composition API
  • Langage : TypeScript
  • Build Tool : Vite
  • UI Framework : Carbon Design System
  • Charts : Chart.js avec vue-chartjs
  • State Management : Pinia (prรชt ร  l'emploi)
  • Styling : Tailwind CSS + Carbon Styles

Structure du Projet

decompression-calculator/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ calculator/          # Composants de calcul
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DiveCalculatorInput.vue
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DiveProfileResults.vue
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GasManager.vue
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SegmentManager.vue
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ RateConfiguration.vue
โ”‚   โ”‚   โ”œโ”€โ”€ common/              # Composants communs
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ WarningsDisplay.vue
โ”‚   โ”‚   โ””โ”€โ”€ visualizations/      # Visualisations
โ”‚   โ”‚       โ””โ”€โ”€ DiveProfileChart.vue
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ buhlmann/            # Algorithme Bรผhlmann
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ constants.ts     # Constantes ZHL-16C
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ decompression.ts # Calculs de dรฉcompression
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gradientFactors.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ tissueLoading.ts # Chargement des tissus
โ”‚   โ”‚   โ”œโ”€โ”€ conversions.ts       # Conversions d'unitรฉs
โ”‚   โ”‚   โ””โ”€โ”€ gasMix.ts           # Calculs de mรฉlanges gazeux
โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts            # Dรฉfinitions TypeScript
โ”‚   โ”œโ”€โ”€ App.vue                 # Composant principal
โ”‚   โ””โ”€โ”€ main.ts                 # Point d'entrรฉe
โ”œโ”€โ”€ public/                     # Fichiers statiques
โ””โ”€โ”€ index.html                  # HTML principal

๐Ÿงฎ Algorithme Bรผhlmann ZHL-16C

Principes de Base

L'algorithme Bรผhlmann ZHL-16C modรฉlise l'absorption et l'รฉlimination des gaz inertes dans 16 compartiments tissulaires diffรฉrents, chacun avec des demi-temps spรฉcifiques :

  • Compartiments rapides : 4 ร  12.5 minutes (tissus bien perfusรฉs)
  • Compartiments lents : 18.5 ร  635 minutes (tissus peu perfusรฉs)

Facteurs de Gradient

Les facteurs de gradient permettent d'ajuster la conservativitรฉ du profil :

  • GF Low : Appliquรฉ au premier palier (ex: 30%)
  • GF High : Appliquรฉ en surface (ex: 70%)
  • Interpolation linรฉaire : Entre les deux valeurs

ร‰quations Utilisรฉes

ร‰quation de Schreiner (profondeur constante) :

P_tissue = P_inspired + (P_initial - P_inspired) ร— e^(-kร—t)

ร‰quation de Haldane (changement de profondeur) :

P_tissue = P_i0 + R ร— (t - 1/k) - (P_i0 - P_initial - R/k) ร— e^(-kร—t)

M-Value (pression ambiante tolรฉrรฉe) :

M-value = a + (P_ambient / b)

๐Ÿ“Š Paramรจtres de Plongรฉe

Plongรฉe Simple

  • Profondeur : 0-100 mรจtres
  • Temps de fond : 1-999 minutes
  • Mรฉlange gazeux : Air, Nitrox, ou Trimix personnalisรฉ
  • Facteurs de gradient : GF Low (10-90%), GF High (50-100%)

Plongรฉe Multi-Niveaux

  • Segments multiples : Jusqu'ร  10 segments
  • Gaz multiples : Jusqu'ร  5 mรฉlanges diffรฉrents
  • Profondeur par segment : 0-100 mรจtres
  • Durรฉe par segment : 1-999 minutes

Taux de Descente/Remontรฉe

  • Descente : 20 m/min (configurable)
  • Remontรฉe : 10 m/min (configurable)
  • Palier de sรฉcuritรฉ : 3 minutes ร  5 mรจtres (automatique si applicable)

๐Ÿ”ฌ Calculs Effectuรฉs

Pour Chaque Plongรฉe

  1. Chargement des tissus : Calcul de la saturation en azote et hรฉlium
  2. Plafond de dรฉcompression : Profondeur minimale sรปre pour chaque tissu
  3. Paliers requis : Profondeur et durรฉe de chaque palier
  4. Temps total : Descente + fond + dรฉcompression + remontรฉe
  5. NDL : Limite sans dรฉcompression (plongรฉes simples)
  6. Avertissements : Toxicitรฉ O2, narcose, dรฉcompression excessive

Validations de Sรฉcuritรฉ

  • PpO2 : Vรฉrification de la pression partielle d'oxygรจne (< 1.4 bar en fond, < 1.6 bar en dรฉco)
  • Narcose : Calcul de la profondeur รฉquivalente narcotique (END)
  • Temps de dรฉcompression : Alerte si > 50% du temps total
  • Profondeur maximale : Vรฉrification du MOD pour chaque gaz

๐ŸŽจ Interface Utilisateur

Sections Principales

  1. Panneau de saisie : Configuration des paramรจtres de plongรฉe
  2. Rรฉsultats : Affichage du profil calculรฉ
  3. Graphique : Visualisation du profil de plongรฉe
  4. Avertissements : Alertes de sรฉcuritรฉ
  5. Informations : Dรฉtails sur l'algorithme utilisรฉ

Thรจme et Design

  • Carbon Design System : Composants IBM Carbon
  • Thรจme sombre : Interface รฉlรฉgante et moderne
  • Responsive : Adaptรฉ ร  tous les รฉcrans
  • Accessibilitรฉ : Conforme aux standards WCAG

๐Ÿงช Exemples d'Utilisation

Plongรฉe Simple ร  l'Air

Profondeur : 30 mรจtres
Temps : 25 minutes
Gaz : Air (21% O2)
GF : 30/70

Plongรฉe Nitrox

Profondeur : 25 mรจtres
Temps : 40 minutes
Gaz : Nitrox 32 (32% O2)
GF : 40/80

Plongรฉe Multi-Niveaux

Segment 1 : 40m pendant 15 min (Trimix 18/45)
Segment 2 : 30m pendant 20 min (Trimix 18/45)
Segment 3 : 20m pendant 15 min (Nitrox 50)
GF : 30/70

๐Ÿ“š Ressources et Rรฉfรฉrences

Documentation Technique

Standards de Plongรฉe

  • PADI - Professional Association of Diving Instructors
  • SSI - Scuba Schools International
  • TDI - Technical Diving International

๐Ÿค Contribution

Les contributions sont les bienvenues ! N'hรฉsitez pas ร  :

  • Signaler des bugs
  • Proposer de nouvelles fonctionnalitรฉs
  • Amรฉliorer la documentation
  • Soumettre des pull requests

๐Ÿ“„ Licence

Ce projet est ร  des fins รฉducatives. Consultez le fichier LICENSE pour plus de dรฉtails.

๐Ÿ‘จโ€๐Ÿ’ป Dรฉveloppement

Technologies Utilisรฉes

  • Vue 3 avec <script setup> et Composition API
  • TypeScript pour la sรฉcuritรฉ des types
  • Vite pour un build ultra-rapide
  • Carbon Design System pour l'UI
  • Chart.js pour les visualisations

Bonnes Pratiques

  • Code TypeScript strict
  • Composants rรฉutilisables
  • Sรฉparation des prรฉoccupations
  • Tests unitaires (ร  venir)
  • Documentation inline

๐Ÿ“ž Support

Pour toute question ou problรจme :

  • Ouvrir une issue sur GitHub
  • Consulter la documentation
  • Contacter l'รฉquipe de dรฉveloppement

Rappel : Cette application est uniquement ร  des fins รฉducatives. Ne jamais l'utiliser pour planifier de vraies plongรฉes. Toujours utiliser des รฉquipements certifiรฉs et suivre une formation appropriรฉe.


๐Ÿคฟ Decompression Calculator (English Version)

A modern web application for calculating decompression dive profiles, based on the Bรผhlmann ZHL-16C algorithm with gradient factors.

Vue 3 TypeScript Vite

โš ๏ธ Important Warning

This application is for educational purposes only.

  • Never use this application to plan real dives
  • Always use certified dive computers
  • Follow proper dive planning procedures
  • Never dive beyond your training and certification level

๐ŸŒŸ Features

Decompression Calculations

  • Simple dives: Profile calculation for single-level dives
  • Multi-level dives: Support for dives with multiple depth segments
  • Multi-gas: Management of multiple gas mixes (Air, Nitrox, Trimix)
  • Bรผhlmann ZHL-16C Algorithm: Complete implementation with 16 tissue compartments
  • Gradient factors: Customizable gradient factors (GF Low/High)

Visualizations

  • Profile chart: Interactive dive profile visualization
  • Decompression stops: Detailed display of all required stops
  • Dive times: Calculation of total time, bottom time, and decompression time
  • No-decompression limit (NDL): Automatic calculation for simple dives

Gas Management

  • Custom mixes: Configuration of oxygen, nitrogen, and helium
  • Maximum operating depth (MOD): Automatic calculation based on PpO2
  • Gas switches: Support for gas changes during ascent
  • Safety validation: Oxygen toxicity and narcosis verification

User Interface

  • Modern design: Interface based on IBM's Carbon Design System
  • Responsive: Optimized for desktop, tablet, and mobile
  • Dark theme: Elegant interface with dark theme
  • Warnings: Alert system for dangerous conditions

๐Ÿš€ Installation

Prerequisites

  • Node.js (version 18 or higher)
  • npm or yarn

Installation Steps

  1. Clone the repository
git clone <repository-url>
cd decompression-calculator
  1. Install dependencies
npm install
  1. Start the development server
npm run dev
  1. Open in browser
http://localhost:5173

๐Ÿ“š Technical Documentation

For more details on architecture and implementation:

๐Ÿ“ฆ Available Scripts

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

๐Ÿ—๏ธ Technical Architecture

Technology Stack

  • Framework: Vue 3 with Composition API
  • Language: TypeScript
  • Build Tool: Vite
  • UI Framework: Carbon Design System
  • Charts: Chart.js with vue-chartjs
  • State Management: Pinia (ready to use)
  • Styling: Tailwind CSS + Carbon Styles

Project Structure

decompression-calculator/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ calculator/          # Calculator components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DiveCalculatorInput.vue
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ DiveProfileResults.vue
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GasManager.vue
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SegmentManager.vue
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ RateConfiguration.vue
โ”‚   โ”‚   โ”œโ”€โ”€ common/              # Common components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ WarningsDisplay.vue
โ”‚   โ”‚   โ””โ”€โ”€ visualizations/      # Visualizations
โ”‚   โ”‚       โ””โ”€โ”€ DiveProfileChart.vue
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ buhlmann/            # Bรผhlmann algorithm
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ constants.ts     # ZHL-16C constants
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ decompression.ts # Decompression calculations
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gradientFactors.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ tissueLoading.ts # Tissue loading
โ”‚   โ”‚   โ”œโ”€โ”€ conversions.ts       # Unit conversions
โ”‚   โ”‚   โ””โ”€โ”€ gasMix.ts           # Gas mix calculations
โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts            # TypeScript definitions
โ”‚   โ”œโ”€โ”€ App.vue                 # Main component
โ”‚   โ””โ”€โ”€ main.ts                 # Entry point
โ”œโ”€โ”€ public/                     # Static files
โ””โ”€โ”€ index.html                  # Main HTML

๐Ÿงฎ Bรผhlmann ZHL-16C Algorithm

Basic Principles

The Bรผhlmann ZHL-16C algorithm models the absorption and elimination of inert gases in 16 different tissue compartments, each with specific half-times:

  • Fast compartments: 4 to 12.5 minutes (well-perfused tissues)
  • Slow compartments: 18.5 to 635 minutes (poorly-perfused tissues)

Gradient Factors

Gradient factors allow adjusting the conservatism of the profile:

  • GF Low: Applied at first stop (e.g., 30%)
  • GF High: Applied at surface (e.g., 70%)
  • Linear interpolation: Between the two values

Equations Used

Schreiner Equation (constant depth):

P_tissue = P_inspired + (P_initial - P_inspired) ร— e^(-kร—t)

Haldane Equation (depth change):

P_tissue = P_i0 + R ร— (t - 1/k) - (P_i0 - P_initial - R/k) ร— e^(-kร—t)

M-Value (tolerated ambient pressure):

M-value = a + (P_ambient / b)

๐Ÿ“Š Dive Parameters

Simple Dive

  • Depth: 0-100 meters
  • Bottom time: 1-999 minutes
  • Gas mix: Air, Nitrox, or custom Trimix
  • Gradient factors: GF Low (10-90%), GF High (50-100%)

Multi-Level Dive

  • Multiple segments: Up to 10 segments
  • Multiple gases: Up to 5 different mixes
  • Depth per segment: 0-100 meters
  • Duration per segment: 1-999 minutes

Descent/Ascent Rates

  • Descent: 20 m/min (configurable)
  • Ascent: 10 m/min (configurable)
  • Safety stop: 3 minutes at 5 meters (automatic when applicable)

๐Ÿ”ฌ Calculations Performed

For Each Dive

  1. Tissue loading: Calculation of nitrogen and helium saturation
  2. Decompression ceiling: Minimum safe depth for each tissue
  3. Required stops: Depth and duration of each stop
  4. Total time: Descent + bottom + decompression + ascent
  5. NDL: No-decompression limit (simple dives)
  6. Warnings: O2 toxicity, narcosis, excessive decompression

Safety Validations

  • PpO2: Oxygen partial pressure verification (< 1.4 bar at depth, < 1.6 bar during deco)
  • Narcosis: Equivalent narcotic depth (END) calculation
  • Decompression time: Alert if > 50% of total time
  • Maximum depth: MOD verification for each gas

๐ŸŽจ User Interface

Main Sections

  1. Input panel: Dive parameter configuration
  2. Results: Calculated profile display
  3. Chart: Dive profile visualization
  4. Warnings: Safety alerts
  5. Information: Details about the algorithm used

Theme and Design

  • Carbon Design System: IBM Carbon components
  • Dark theme: Elegant and modern interface
  • Responsive: Adapted to all screens
  • Accessibility: WCAG standards compliant

๐Ÿงช Usage Examples

Simple Air Dive

Depth: 30 meters
Time: 25 minutes
Gas: Air (21% O2)
GF: 30/70

Nitrox Dive

Depth: 25 meters
Time: 40 minutes
Gas: Nitrox 32 (32% O2)
GF: 40/80

Multi-Level Dive

Segment 1: 40m for 15 min (Trimix 18/45)
Segment 2: 30m for 20 min (Trimix 18/45)
Segment 3: 20m for 15 min (Nitrox 50)
GF: 30/70

๐Ÿ“š Resources and References

Technical Documentation

Diving Standards

  • PADI - Professional Association of Diving Instructors
  • SSI - Scuba Schools International
  • TDI - Technical Diving International

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Propose new features
  • Improve documentation
  • Submit pull requests

๐Ÿ“„ License

This project is for educational purposes. See the LICENSE file for more details.

๐Ÿ‘จโ€๐Ÿ’ป Development

Technologies Used

  • Vue 3 with <script setup> and Composition API
  • TypeScript for type safety
  • Vite for ultra-fast builds
  • Carbon Design System for UI
  • Chart.js for visualizations

Best Practices

  • Strict TypeScript code
  • Reusable components
  • Separation of concerns
  • Unit tests (coming soon)
  • Inline documentation

๐Ÿ“ž Support

For any questions or issues:

  • Open an issue on GitHub
  • Consult the documentation
  • Contact the development team

Reminder: This application is for educational purposes only. Never use it to plan real dives. Always use certified equipment and follow proper training.

About

A Scuba diving application for calculating decompression dive profiles.

Resources

Stars

Watchers

Forks

Contributors