[PATCH 6/4] Fix another cylinder pressure plotting special case

Dirk Hohndel dirk at hohndel.org
Sun Jul 30 16:41:56 PDT 2017


On Sun, Jul 30, 2017 at 11:22:34AM -0700, Linus Torvalds wrote:
> 
> Oh. And that's not a bug, it's a "feature".
> 
> We have a "display_unused_tanks" preference setting, which disables
> showing of tanks that aren't actively used during the dive.

Yep. Because quite a few dive computers give you a ton of gas mixes (which
we then interpret as cylinders) which aren't used...

> So the crazy code will initially show them as you add them (because it
> has logic to always show manually added cylinders), but then as you
> read the xml file again, it will stop showing them, because now they
> are no longer manually added, and their gas use indicates they weren't
> used during the dive.
> 
> That's not a great feature.

It's a feature that made sense when we added it.

> This attached patch may or may not be an improvement. Dirk?
> 
> The new logic is basically:
> 
>  - if the cylinder is "used", it is always shown (so gas pressure has
> changed, or we have gas switch events to it, or it's the first gas and
> we had no switches away from it or whatever)

OK

>  - if the cylinder has no data at all, we don't show it

But "no data at all" does not include "first and only cylinder", right? If
someone has a simple dive computer with only one gas, so no gas switches,
but also no pressure data, and because of "air" we have no values for
O2/He, either - that still is shown, correct?

>  - if it has pressure information - even if that pressure information
> indicates that it wasn't used - it's shown
> 
>  - I left the "manually added" case
> 
>  - if it's not used, and has no pressure information, but does have a
> type name and size, we fall back to the "prefs.display_unused_tanks"
> thing.

That all seems sensible

> I personally think this is an improvement, and it now shows all four
> cylinders that Gaetan had on his CCR dive, even if the bailout
> cylinders weren't actually used.
> 
> Gaetan had filled in cylinder pressures and everything, I think we
> should show them by default.

Yes

> I *think* that display_unused_tanks preference setting came from some
> dive computers always showing every cylinder they could support, so
> you ended up with 8 (or whatever) cylinders with just the default
> cylinder information, even though none of them were actually used. But
> having pressure data definitely means that they are more than just
> placeholders..

Exactly.

Can you send this as "7/4" in your current series? Signed off with a
commit message?

/D


More information about the subsurface mailing list