deco code rewrite

Dirk Hohndel dirk at hohndel.org
Thu Dec 6 07:03:23 PST 2012


On Dec 6, 2012, at 4:42 AM, Jef Driesen wrote:

> On 2012-12-05 23:20, Jan Schubert wrote:
>> I already proceeded with the Shearwater Predator, see attached screenshot.
>> Not mentioning the "known issues" there is some other "interessting" things:
>> 
>> - seems there are a lot (!) of events reported
>> - seems there are at least some events taken false, there has been for
>> sure no gaschange in this dive
> 
> That's my fault. The predator stores the active gas on each sample, and generating the GASCHANGE2 event on each sample was the quick and easy solution for the first version. But later on, I completely forgot about that (or I was too concentrated on the new design, where the gaschange event will be dropped in favor of an active gas sample) :-)

:-)

> I'll fix this and only generate an event when the gas actually changes.

Good.

>> - also pO2, pN2 and pHe are wrong
> 
> Currently only the OC gases are reported by libdivecomputer. I didn't really know how to deal with this. At first, I just wanted to pick either the OC or CC gas mixes, depending on the dive mode. But there is no such setting in the header, only in the samples. Apparently the user can switch from CC to OC during the dive (confirmed by Shearwater), so this is going to be a bit more tricky. Maybe the easiest is to just report both sets, until we have some better solution?

I guess this is for bailout? Your CC fails, you switch to OC?
I think reporting all of the gases would work for now - things could still go wrong since in the current API design we still only get the O2% (or actually O2 & He%) and not a gas index. But it would certainly be an improvement.

> The percentages in the GASCHANGE2 event will always be correct, because the percentages are directly stored in the sample data. The OC/CC gases defined in the header are not used for the events.

Subsurface would still like to match the gas with specific tanks so we can do SAC calculations, etc.

> PS: As I'm not a rebreather (or technical) diver, I can definitely use some help in that area, to make sure libdivecomputer will also supports those features that technical divers need.

You and me, both :-)

/D


More information about the subsurface mailing list