[PATCH] Survive CCR dive logs w/o marked DILUENT/OXYGEN cylinders

Dirk Hohndel dirk at hohndel.org
Sun Nov 23 11:29:45 PST 2014


On Sun, Nov 23, 2014 at 07:46:32PM +0100, Robert C. Helling wrote:
> > Look at the line RIGHT before the first inserted line... I'll move your
> > code one line higher :-)
> 
> Argh. It’s not good to do these things when tired and a rush.

Tell me about it. I run into that all the time :-)

> > Regarding your question if we can simply return from
> > fill_missing_tank_pressures() if there is no O2 cylinder... I think we
> > should. I actually wonder if we shouldn't have a test way higher up in the
> > stack that says something like "if this is a CCR dive and we don't have a
> > diluent cylinder and an O2 cylinder, something is seriously messed up...
> 
> I think it is fine not having those cylinders defined, like it is fine
> to have an OC dive with no cylinder information at all (in which case we
> assume to breath air and don’t attempt to plot cylinder pressures). 

That seems sane. So we need to make sure that all accesses take this into
account.

> Similarly, I would assume air as diluent in an unspecified amount and
> some O2 cylinder (again without gas usage calculation). I had seriously
> considered to make all arrays of size MAX_CYLINDERS one bigger and
> reserve cylinder[MAX_CYLINDERS] as a secret default O2 cylinder for CCR
> dives or return MAX_CYLINDERS rather than -1 so all code could simply
> work without error check. That option would have been better than
> calling a random used/defined cylinder O2 but I don’t think it would
> have bought us anything than confusion.

That seems hackish to me. I'd much rather have the code work with no
cylinders defined.

/D


More information about the subsurface mailing list