[PATCH] Show MOD, EAD, END and EADD

Dirk Hohndel dirk at hohndel.org
Sun Jan 13 11:28:23 PST 2013


On Jan 13, 2013, at 10:57 AM, Jan Schubert wrote:

> This is a approach to get more familar with the code by implementing
> some basic stuff showing MOD, EAD, AND and EADD:
> 
> - MOD: Maximum Operation Depth based on a limit of 1.6bar as of now
> (will think about to make this configurable soon)
> - EAD: Equivalent Air Depth considering N2 and (!) O2 narcotic
> - END: Equivalent Nitrogen (Narcotic) Depth considering just N2 narcotic
> (ignoring O2)
> - EADD: Equivalent Air Density Depth
> 
> Please note that some people and even diving organisations have opposite
> definitions for EAD and END, but considering A stands for Air, I choosed
> the above. And considerung N for Nitrogen it also fits in this scheme.

Ok. You went with one config option to display all of them. Maybe not a bad idea.
But hardcoding the 1.6 is - most non-tech divers (and even some tech divers like
myself) want 1.4 for that…

> Some notes:
> 
> This patch moves N2_IN_AIR from deco.c to dive.h as this is already and
> might be used in several places. It also respecifies N2_IN_AIR to a more
> correct value of 78,084%, the former one also included all other gases
> than oxygen appearing in air. If someone needs to use the former value
> it would be more correct to use 1-O2_IN_AIR instead.

I'm surprised that you think that a difference of three and a half tenth of a permille 
matters… even at 100m that will change the calculated value by less than one
percent...

> It took me some time to recognize that depth is always stored in mm
> independent of using metric or imperial units and the conversion is not
> done automatically when printing/displaying the graph.
> All results rounded down to full meters. As the conversion to feet is
> done afterwards the depth in feet might me 1 or 2 feet to shallow sometimes.

Don't do that, please. Round when you display, not when you calculate. 

I also noticed that the 20cm offset for ceilings is hidden in this patch.
I don't want that hardcoded in the algorithm.

/D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4130 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130113/2b98feb3/attachment-0001.bin>


More information about the subsurface mailing list