summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-22 13:45:53 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-22 16:26:38 -0700
commita93641b7222e767d6a3a1be598cd8099d8517059 (patch)
treefc6893f49513b99d221f2e0fc23f46a58c743dd7 /dive.h
parent15463fdeb26ed1b5fdff62e4721a6dbbc507cefc (diff)
downloadsubsurface-a93641b7222e767d6a3a1be598cd8099d8517059.tar.gz
Calculate OTUs for every dive
The calculation assumes that the cylinderindex in each sample tells us which PO2 the dive was breathing at that time. This needs to be verified with dives where there is an actual gas switch. No idea where to display them, yet. Far fewer people will care about this than care about SAC - does this still rate a spot in the dive_list? I guess I could make it part of the dive_info - but it's not editable. It doesn't seem to fit with the equipment page (even though this is the one editable field that is related - nitrox %) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index e1a5bc007..1766cff82 100644
--- a/dive.h
+++ b/dive.h
@@ -134,6 +134,11 @@ static inline int to_PSI(pressure_t pressure)
return pressure.mbar * 0.0145037738 + 0.5;
}
+static inline double to_ATM(pressure_t pressure)
+{
+ return pressure.mbar / 1013.25;
+}
+
struct sample {
duration_t time;
depth_t depth;
@@ -156,6 +161,7 @@ struct dive {
depth_t visibility;
temperature_t airtemp, watertemp;
cylinder_t cylinder[MAX_CYLINDERS];
+ double otu;
int samples, alloc_samples;
struct sample sample[];
};