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

Gaetan Bisson bisson at archlinux.org
Sun Jul 30 13:11:32 PDT 2017


[2017-07-30 11:22:34 -0700] Linus Torvalds:
> On Sun, Jul 30, 2017 at 10:51 AM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
> >
> > So I think the code now does exactly the right thing for your case. Except
> > for the equipment tab side, which doesn't show your two unused cylinders,
> > even though you filled in information for them. But that looks like a
> > pre-existing bug and probably has nothing to do with the recent pressure
> > graph changes.
> 
> 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.
> 
> 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.
> 
> 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)
> 
>  - if the cylinder has no data at all, we don't show it
> 
>  - 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.
> 
> 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.

I had indeed ticked the "show unused cylinders" option specifically for
the unused bailout case, but then I had to manually delete all the
virtual cylinders my OSTC3 reported after each dive... And I hadn't
realized life could be better!

Thanks a lot for this patch, I think the new logic makes a lot of sense.

Cheers.

-- 
Gaetan


More information about the subsurface mailing list