understanding the sensor values in our samples

Linus Torvalds torvalds at linux-foundation.org
Thu Apr 28 09:32:54 PDT 2022


On Thu, Apr 28, 2022 at 9:25 AM Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Yes, I get that part. And assuming we are looking at a CCR dive I can
> assign some resemblance of sense to it. But if this is an OC dive, this
> is all not at all useful,

But for an OC dive, all it does is

 - set index 0 to 0 (or NO_SENSOR if we don't have any cylinders)

 - set index 1 to 1 (or NO_SENSOR if we have only one cylinder)

so it just basically sets up the identity mapping for the first sample.

IOW, on OC, it has absolutely nothing to do with the O2 cylinder.

Could the math be written differently and more explicitly? Oh yes it
could. We could just have some "if this is a CCR dive vs OC dive"
explicit logic. Instead it's doing that thing that should just work
for both.

> For the 90+% of all the OC dives that are "single tank, no gas switches,
> I'm just having fun" this is actively WRONG

See above. For those dives, all it does is

        sample->sensor[0] = 0;
        sample->sensor[1] = NO_SENSOR;

why do you think that's so wrong?

Of course, most people won't even have a sensor at all, so even
initializing that sensor[0] to 0 is likely then pointless, but if you
have no sensor values, it shouldn't matter.

             Linus


More information about the subsurface mailing list