messing with the gas / tank handling

Dirk Hohndel dirk at hohndel.org
Tue Oct 28 14:13:45 PDT 2014


Hey Linus,

Usually whenever I touch this code I break it. And then you have to fix
it later when you notice that I messed with things. So this time I'll
alert you directly.

Danger, danger, Dirk touched the gas / tank handling code!!!

Bug #742 shows that we got things pretty badly wrong for the Cobalt if the
primary gas used on a dive (or in the case of his sample data, the only
gas used on a dive) was not tank 0. We showed that ugly gas change, we
showed that two gases were used during the dive, we associated the
pressure from the samples with the wrong tank, etc.

I just pushed out a commit that pretends to fix this. And it makes sense
to me. But I'd really appreciate if you (or anyone else for that matter)
would take a look and double check that this is ok.

My biggest concern is the logic I added to fixup_dive_dc(). Because I
don't know if "sample->sensor == 0" means "we explicitly switched to
sensor 0" or "we don't know which sensor we are using (i.e., which tank
the sensor is connected to)".

The code there worked for all dives that I could find (I have a bunch of
Cobalt dives from a couple of years ago when I got a Cobalt as a loaner
for one of the tech classes we did).

And it works with all my other multitank dives.

Still - there is too much black magic in the way we handle gases / tanks.

/D


More information about the subsurface mailing list