Fix cylinder printout information

Linus Torvalds torvalds at linux-foundation.org
Thu Jan 3 13:01:49 PST 2013


On Thu, Jan 3, 2013 at 12:50 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Yes, I think the latter is what people are looking for (how many liters
> of air at 1atm they consumed).
>
> Why would you need a working pressure to do that if you have a wet
> volume. I'm missing something here...

You need to calculate the percentage of the gas used, so you need a
reference pressure for the pressure difference.

And no, you can't just use the starting pressure. So we'd need to be
able to know what air usage "half a cylinder" worth would actually be.

But if "expanded size at one ATM" is the correct thing, then we don't
need it, and the patch does the right thing.

> BTW: I notice that we are printing OTUs and CNS... wouldn't it be even
> more interesting to print the SAC rate above those two?

Probably.

Oh, and I just noticed a buglet in my patch: if we print out the
pressure difference (because we do not have a cylinder size), we don't
initialize the precision. We should print out pressures without
decimals.

The attached patch fixes that, and also avoids a NULL pointer printout
(which on Linux will just print out "(null)" if there is no cylinder
type descriptor string. It also cleans things up a bit and uses the
"cyl" pointer instead of repeating the "dive->cylinder[n]" thing.

Add my sign-off and some random commit message.

                      Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 1641 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130103/0bdc59e1/attachment.obj>


More information about the subsurface mailing list