-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
37 lines (24 loc) · 1.09 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This is a short example on the use of the Buhlmann class
// The tissues undergo a linear dive segment, and then the ceiling is printed
#include <iostream>
#include "src/model/compartments/tissues.h"
#include "src/model/algorithm/deco_algorithm.h"
using namespace DecoModel;
int main() {
uint8_t gas[] = {20, 20}; // {%O2, %He}
uint16_t depth = 60, time = 45; // 45 mins @ 60 metres
int8_t rate = 0; // No depth change
std::vector<uint8_t*> gases;
gases.push_back(gas);
Segment segment(depth, rate, time, gas); // Create dive segment
float GFHi = 0.8f, GFLo = 0.5f;
Buhlmann tissues(GFHi, GFLo); // Construct tissues
tissues.invoke_dive_segment(segment); // Invoke time at depth
uint16_t ceiling;
ceiling = tissues.get_ceiling(); // Calculate ascent ceiling
std::cout << "Ceiling is:" << std::endl;
std::cout << ceiling << std::endl;
std::cout << "Stops are" << std::endl;
std::vector<DecoStop> stops = get_deco_stops(tissues, depth, gases, 1);
return 0;
}