Few bugs and a feature req from testing Subsurface

Dirk Hohndel dirk at hohndel.org
Sat Mar 15 13:45:54 PDT 2014


On Sat, 2014-03-15 at 13:38 -0700, Linus Torvalds wrote:
> 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.

Brain fart. You are of course correct. Thanks for catching this.

> > 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.

Agreed. We talked about overhauling this part of Subsurface since the
early 2.x days. No one ever took the time to come up with a clean design
of HOW this should work. Just using the libdivecomputer events and then
complaining about them seemed always easier :-)

> 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)

Well, we have /some/ ability to change them in the UI (actually, I think
part of that got lost in the new profile, something else to check).

/D



More information about the subsurface mailing list