Bug: Cylinder editor doesn't honor sorting

Linus Torvalds torvalds at linux-foundation.org
Sun Dec 11 18:10:47 PST 2011


On Sun, Dec 11, 2011 at 5:42 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>>
>> - "air"
>> - "32" - EAN32
>> - "32+50": one cylinder EAN32, one EAN50
>
> So what would be air + deco gas? "air+50" or "21+50"?

I could go either way. There's no risk of "not a nitrox diver" for
that case, so numbers aren't scary or particularly misleading, and
"21+50" works fine. At the same time, the single cylinder *would* have
been called just "air", so I don't think "air+50" would be all that
hard to read or misleading either.

That said, currently we do this thing oddly for "air plus trimix". If
you do one cylinder of air, and one cylinder of 10/70, we will
actually show it as "10/70" in the divelist, because the "air" part is
considered to be a totally uninteresting gas, and the "dive_gas()"
function will consider it a zero (not a 21), and thus pick the "10%
oxygen" as the highest oxygen percentage.

And I actually think that's the *right* thing from a user perspective,
exactly because "21%" is such an uninteresting case. But it's worth
noting as another example of why air really is *special* - it's not
really the same thing as "EAN21" at all.

We currently sort "air" as 21% nitrox, but I was actually considering
sorting it as zero too (it wouldn't matter in practice, but it would
mean that any nitrox blend - including a hypoxic one - would sort
separately from air). Of course, that sorting issue probably doesn't
matter in practice: if *all* your cylinders are hypoxic, you're
unlikely to come back alive, so nobody will care how that odd case of
"max O2% < 21%" would sort. But from a UI perspective, it probably
wold be correct to sort air as the "zero gas" - which is how we
maintain it internally in subsurface.

I know you added a comment about how you don't like air being
internally handled as "0 permille O2" inside subsurface, but it's
actually done that way on purpose, and I think it's the right thing to
do even if some people think air is just EAN21. It means that we can
do things like this:

   if (he)
     trimix
   else if (o2)
     nitrox
   else
      air

and it all works out correctly.

(It also means that the whole confusion about "air is 21% oxygen" vs
"air is 20.9% oxygen" just goes away. Air is just air, it has no
oxygen percentage associated with it in subsurface).

                  Linus


More information about the subsurface mailing list