[PATCH 1/2] Calculate VPM-B ceiling outside of planner

Rick Walsh rickmwalsh at gmail.com
Sat Oct 31 02:12:39 PDT 2015


Thanks again Robert,

On 30 October 2015 at 08:44, Robert C. Helling <helling at atdotde.de> wrote:

>
> On 29 Oct 2015, at 12:53, Rick Walsh <rickmwalsh at gmail.com> wrote:
>
> Comments added to commit
>
>
> What I already said on IRC:
>
> It should probably be
>
> if (prefs.deco_mode == VPMB && !in_planner() && entry->ceiling >= first_ceiling && first_iteration == true) {
>
>
>
> with a good initialisation for first_ceiling so this is true when it is
> first called (where no ceiling so far has been computed). Otherwise, at
> least for my real dives, the condition is never true (a breakpoint on the
> next statement was never reached).
>

Thanks for picking this up.  It's somewhat surprising it nearly worked
before.  Actually, the comparison should be (entry - 1)->ceiling >=
first_ceiling, because we want to run it after the first_ceiling has been
set.

To make things a bit simpler, I have shifted it down to after first_ceiling
has been set.  While we *could* recalculate first_ceiling at this point
based on the updated gradients, but there's no need as it will be picked up
in the next CVA iteration.


> Then, have a look at this file:
>
>
>
> This is the same dive planned once with VPM-B and once with Buehlmann
> 30/80. For the VPM-B the ceiling looks ok. The VPM-B version has a runtime
> of 55 as compared to that of Buehlmann which has 45. So I would expect to
> have in the end a TTS of about 10min. But it shows 37min (and a ceiling
> violation much earlier). Maybe that is what it is. But I am a bit surprised
> by thus behaviour.
>
> The problem was that the function calculate_ndl_tts keeps adding to
entry->tts_calc.  That's fine for stepping through the dive the first time,
but with iterating for the CVA, it needs to be reset to zero.  The attached
patch does that.

Cheers,

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151031/4625b8af/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Calculate-VPM-B-ceiling-outside-of-planner.patch
Type: text/x-patch
Size: 12046 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151031/4625b8af/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Profile-Display-VPM-B-rather-than-GF-when-in-VPM-B-m.patch
Type: text/x-patch
Size: 5568 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151031/4625b8af/attachment-0003.bin>


More information about the subsurface mailing list