deco rewrite [was Re: Meaning of GF settings]

Dirk Hohndel dirk at hohndel.org
Tue Jan 8 14:22:14 PST 2013


"Robert C. Helling" <helling at atdotde.de> writes:

> On Jan 8, 2013, at 6:37 PM, Dirk Hohndel wrote:
>
> Dirk,
>
>> I just pushed out a commit with the following commit message. Please
>> take a quick look to make sure that you are ok with the changes to the
>> comments at the top of the file and that I didn't mess anything up with
>> the one actual change that I made (described in the last paragraph of
>> the commit message).
>
> looks good. You did set buehlmann_config.last_deco_stop_in_mtr back to
> 3 (I had set it to 0 as this looks nice for smooth==TRUE). Was that on
> purpose?

That was a mistake. I actually noticed that while working on the
planning code.

Will fix in a moment.
 
> Two more questions: I kept the convention of using doubles and units
> of meters and bars rather than integers and mbar and mm and only
> change back to those in deco_allowed_depth as otherwise those
> Buehlmann constants that are dimension-full would have to be changed
> as well and I would be a bit worried that the increments in
> add_segment might be small compared to 1mbar. I hope this is ok. Was
> my assumption correct that even when set to imperial units subsurface
> internally works with SI units since otherwise we would need imperial
> units for those constants as well?

a) yes, I think keeping this code in doubles is wise. I briefly looked
at converting to mm/mbar integer math but was too worried about
unintended consequences
b) yes, Subsurface only uses insane units during the display phase, not
internally. Linus and I learned to dive in the US and therefore tend to
have our computers (except of course for the OSTC) in ft / psi, but we
still have enough common sense left to do all the math in SI units.

> You say the first version of deco.c was based on code by Matthias
> Heinrichs. I had a brief look at the OSTC firmware but I could not
> recognize any code fragment. Do you know if he uses that code or
> similar for his dive computers in any way? If he does I would let him
> know that I believe that code has problems.

This was code from the DR5 that he was kind enough to allow me to reuse
(as the OSTC code had limitations because of the slower CPU used in that
dive computer.

Matthias is subscribed to this mailing list and I am sure he is
following all these discussions with interest.

I did indeed find an error in their code - but that was in a special
case that actually never could be hit in their firmware.

I am reasonably confident (:-( ) that all the other bugs were introduced
by my changes to their code to make it work inside Subsurface. So I
would NOT draw any conclusions from the code that you replaced to the
code that is used by Heinrichs and Weikamp... there is a reason the file
said "based on" instead of "this is code from"

/D


More information about the subsurface mailing list