Depth validation in planner

Robert C. Helling helling at lmu.de
Wed Feb 13 05:04:47 PST 2013


On Wed, 13 Feb 2013, Robert C. Helling wrote:

> On Wed, 13 Feb 2013, Henrik Brautaset Aronsen wrote:
>
>> Here's a fix.   Does it look OK?  
>> 
>
> That fixes the immediate problem. You can still clock up significant deco by 
> staying for some hours at 300m, but hey, if this is what the user want...
>
> Still, I think an error message ("We don't do this type of diving. Go away!") 
> would be more appropriate. But that needs handling of error, translation etc 
> etc. So this is probably more for V 3.1.

Just noticed another problem: I tried to plan a dive to 300m for 1000min. 
After the bottom time the ceiling is at 226m. Still, the planner ascents 
to the deepest stop in decostoplevels[], i.e. 90m. I think we should catch 
this and produce an error.

Here is a patch that I hope fixes this by just refusing to plan such a 
dive. It does this by introducing a return value for plan() where 0 is 
error and 1 is ok. In such a case, it just does nothing.

I have to admit, however, that I did not try to understand the full logic 
of dive planning. I might have therefore created a memory leak in the case 
we pull out of plan().

Best
Robert

PS:

Signed-off-by: Robert C. Helling <helling at atdotde.de>


-- 
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
                       Scientific Coordinator
 		      Ludwig Maximilians Universitaet Muenchen, Dept. Physik
print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
     stupid .sig\n";   http://www.atdotde.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: too_deep_dives.patch
Type: text/x-diff
Size: 2813 bytes
Desc: 
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130213/c0af3660/attachment.patch>


More information about the subsurface mailing list