Few bugs and a feature req from testing Subsurface

Linus Torvalds torvalds at linux-foundation.org
Sat Mar 15 13:38:42 PDT 2014


On Sat, Mar 15, 2014 at 1:23 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> OK, I just pushed out two commits that make these two changes.

Actually, I think the second one is buggy.

You did this:

    if (i == 0 && !get_tanksize(devdata, data, dive->cylinder, i))
        fill_default_cylinder(&dive->cylinder[i]);


but that also means that it only calls get_tanksize() for cylinder 0.
Which was almost certainly not what you intended.

> This comes back to our strained relationship with cylinders and gases.
> It is rather unfortunate that our cylinder switches are modeled as gas
> switches.

Well, actually, we're kind of ambiguous about it. We do have things like

  add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int
time, int idx);

where we talk about *indexes*, but then we model the events after the
dive computers, and most of those seem to be all about the gasmix.

We could do both, I guess. Right now we encode gas switches as event
type 25 (SAMPLE_EVENT_GASCHANGE2), and the "value" is the gas mix
encoding. But we could put the index into the "flags" field.

I dunno. We have other problems with events. Our event model just
isn't very good.

It _would_ be a good idea to have a better event model, and even to be
able to edit them in the GUI (move them around, delete them, add them)

                Linus


More information about the subsurface mailing list