On Thu, Jul 03, 2014 at 12:21:13PM +0200, Robert Helling wrote: > > when you are done, could you help me with #585? The problem seems to be the > following: > > in divelist.c there is the function init_decompression() which is supposed to > go through the dive list and find dives that still influence tissue loadings > of the current dive (in this case: in the planner). The rule is that we > assume that after 48h all tissues are back to their surface values. So from > the current dive we go back in time to find a surface interval of at least 48 > hours. After that interval we take all the tissue loadings into account. > There seem to be two problems: > > 1) A minor one: the “going back in time” is done as a loop with > > while (i && —i) > > where i is the index in the dive list. Here, it seems to me i==0 is a > perfectly fine value, it is the first entry in the dive list. So the > condition should rather be > > while (i >= 0 && --i >= 0)
Yes, but that's equivalent to what we have. while (i && --i) allows i = 1 which gets decremented to 0 before the loop starts. > Could somebody please confirm/refute this? refute :-) > 2) In the planner (this is why I write this), there seems to be a bogus dive > in the dive list present which seems to be related to the dive that is > currently planned and which for me is exactly one hour before the default > date of the planner (i.e. now). That dive is then counted as influencing the > deco of the planned one which is of course wrong. It seems to me this is one > of the “staging dive” or “current dive”. As I know you are looking into this, > I will not try to mess with trying to get rid of this dive or ignore it for > pre saturation of tissues. May I just draw your attention to this problem and > ask you to tell me when your open heart surgery has stabilized enough for me > to further investigate this point? Thanks - this problem will go away. There will be no stagingDive and the freshly added / planned dive won't be on the divelist until it gets saved. And may I just say that this is why I insist on that disclaimer? This seems like a serious issue to me that hadn't been found in many attempts to test and to compare to other planners... /D _______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
