On 16 July, 2014 - Dirk Hohndel wrote: > On Wed, Jul 16, 2014 at 11:22:32PM +0200, Anton Lundin wrote: > > This started out yesterday with me looking at dives/test20.xml and saw > > that the gasname text in the info box is wrong there. It uses the > > gaschange event data via get_gasmix_from_event and then on to gasname. > > > > The problem with using the result from get_gasmix_from_event is that it > > doesn't care about the difference between SAMPLE_EVENT_GASCHANGE and > > SAMPLE_EVENT_GASCHANGE2, and thus doesn't map the gaschange event to the > > cylinder its changing to. > > ??? That sounds odd... > > > I dug around and found the same type of assumption in lots of places > > allover the code. A while back pre 4.0 somewhere i fixed up > > get_cylinder_index to do the right thing and switched all the places to > > using it, but now we have reverted to using event data again. > > I don't think using event data is WRONG per se - as long as it's done > correctly. After all, that's how we track gas changes. >
You can't use the event data straight off right now. Eg. SAMPLE_EVENT_GASCHANGE only contains the oxygen part of the gas, and in that case you wouldn't be able to distinguish between air and 21/35. > > Should we stop supporting SAMPLE_EVENT_GASCHANGE and converting > > everything into actually relying on having the exact correct gas in the > > event? > > It should be there. I'm lost why / where you think it isn't. > I must be missing something. > If your cylinder says 32.1% and your gaschange event says 33%, what should we say that the diver is breathing? In the get_cylinder_idx we map that gaschange event to the closest matching cylinder, aka we say that the diver is breathing 32.1% , if we use the gaschange event straight off, we would say the diver is breathing 33%. The difference is even greater if we look at SAMPLE_EVENT_GASCHANGE switches. There the event could say 18% where the cylinder mapping says 18/45. > > The other option is to stop looking at whats in the event and start only > > looking at what gas is mapped to different times in the dive. We can't > > do both, and mix and match them. > > Well, post 4.2 I really want to change the way we deal with events, but it > sounds like this is somewhat independednt from that intended change. > > But I think I need to understand better the actual underlying issue before > I can make any sane suggestions... > The patch i sent earlier about the tool tip is the only _really_ visible i found, but there are probably more bugs out there, but they are going to be a bit more invasive to fix, so the question is, should we go with mostly/probably right for 4.2 or should we fix them before 4.2? //Anton -- Anton Lundin +46702-161604 _______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
