Subsurface deco calculations

Linus Torvalds torvalds at linux-foundation.org
Wed Feb 8 11:42:31 PST 2017


On Wed, Feb 8, 2017 at 10:32 AM, Robert C. Helling
<robert at euve10195.vserver.de> wrote:
> Hi
>
>> Am 08.02.2017 um 18:53 schrieb Linus Torvalds <torvalds at linux-foundation.org>:
>>
>> I'll fix it, never fear. I'll just have to think more about it.
>
> An easy approach wound be to take the computer with the biggest number of used gases as base.

I rewrite the whole damn thing, I think it's the better for it.

There was magic special code for merging a planned dive, and I think
that was due to perhaps similar issues. I got rid of that special case
entirely, and hope that my fixed version JustWorks(tm).

Somebody should check the planned dive merging code, please..

And somebody should really double-check me on my code. I tried to make
it be fairly obvious, but I worry about (for example) the situation
where you have multiple cylinders with the same gas mix. Right now it
matches purely on mix, and will just match "in order". So if you have
multiple cylinders with the same mix, they'd better be in the same
order for the two dive computers to match correctly.

And the old merging code tried to just say "close enough" and merge
cylinders that didn't have the exact same mix. The new code doesn't -
so you might end up with more cylinders than you used to. But I think
that's better fixed up manually later (ie you had 31% on one dive
computer, and 32% on another for the same cylinder, now you end up
with two cylinders and you'd better just fix things up).

Will send patch as a follow-up to this, I just need to write a commit log.

             Linus


More information about the subsurface mailing list