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>
This commit is contained in:
Dirk Hohndel 2011-09-22 13:45:53 -07:00
parent 15463fdeb2
commit a93641b722
3 changed files with 29 additions and 2 deletions

View file

@ -1051,7 +1051,7 @@ static void match_standard_cylinder(cylinder_type_t *type)
return;
cuft = type->size.mliter / 28317.0;
cuft *= type->workingpressure.mbar / 1013.25;
cuft *= to_ATM(type->workingpressure);
psi = type->workingpressure.mbar / 68.95;
switch (psi) {
@ -1106,7 +1106,7 @@ static void sanitize_cylinder_type(cylinder_type_t *type)
if (input_units.volume == CUFT || import_source == SUUNTO) {
volume_of_air = type->size.mliter * 28.317; /* milli-cu ft to milliliter */
atm = type->workingpressure.mbar / 1013.25; /* working pressure in atm */
atm = to_ATM(type->workingpressure); /* working pressure in atm */
volume = volume_of_air / atm; /* milliliters at 1 atm: "true size" */
type->size.mliter = volume + 0.5;
}