On Wed, Mar 11, 2015 at 12:13:17AM +0200, Yosef Hamza wrote: > On Tue, Mar 10, 2015 at 11:39 PM, Dirk Hohndel <[email protected]> wrote: > > > On Tue, Mar 10, 2015 at 11:08:14PM +0200, Yosef Hamza wrote: > > > > a) the events are ordered by time, so the moment you have one where > > time.seconds > 0 you can stop > > > > Yea I thought about that, But Gehad told me before that there was an issue > that can make events be out of order.
There is? That would be bad. Gehad, can you comment on that? > b) even easier, we have a helper function you could use: > > get_next_event(ev, "gaschange"); > > so you call this with current_dc->events > > if you get an event back AND its time stamp is 0, remove that event > > try again, again with current_dc->events as pointer > > repeat until you don't find a gas change > > > > That's a better solution indeed I didn't know about, I need to surf the > helper > functions more.. We have a lot of them. And not well structured, not consistently named, not well documented. There's almost a GSoC project hiding here in code cleanup... but the problem is that this would have to be done by a rather experienced developer whom I really trust... hard challenge for GSoC... > c) I wouldn't call replot() in the middle; while it's unlikely that there > > would be two gas changes at t=0, still one replot() would be sufficient, > > right? So I'd have a little flag (bool eventRemoved) and then call > > mark_divelist_changed() and replot() if eventRemoved is true. > > > > Makes sense? > > Yes. Excellent. > > I know that this might feel frustrating. You keep sending patches and I > > keep criticizing the code and not taking them. This really is intended to > > help you and to make sure you understand the code and the code we have in > > the end makes sense. Sure, I could just fix this myself (that would be a > > lot less work for me) - but it's unlikely that you'd learn something if I > > did that. > > No not at all, It give me valuable checkmarks when submitting patches :) :-) /D _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
