[Patch] Fix planner notes gas change output logic
Rick Walsh
rickmwalsh at gmail.com
Wed Jun 17 08:22:55 PDT 2015
Robert,
On 16 June 2015 at 22:46, Robert Helling <helling at atdotde.de> wrote:
> No, unfortunately, this is not correct either.
>
> I acknowledge the bug that you describe (the gas change to EAN80 should be
> displayed at 9m depth). But your suggested patch breaks something else
> (which was the original motivation for the ‘postponed’ logic:
>
> Start with air.
>
> Descend to 20m
> Stay there for 5min
> Then switch gas to EAN80 and stay another 10min
> Then switch back to air and stay a further 5min
> ascent [planner ascends to 9m, should switch there back to EAN80 and then
> to the surface].
>
> In my understanding the plan should then look like this:
>
> depth
> runtime
> duration
> gas
> 20m
> 1min
> 1min
> air
> 20m
> 5min
> 4min
> 20m
> 15min
> 10min
> EAN80
> 20m
> 20min
> 5min
>
> air
> 9m
> 22min
> 2min
> EAN80
> 0m
> 28min
> 7min
>
>
>
> I agree that this logic currently is completely incomprehensible. Will
> look at this later tonight again.
>
In the attached patch I have tried to simplify the logic and get it to do
the right thing. Rather than tracking whether a gaschange has been
delayed, it compares the gas used to the last printed gas. Can you please
have a look?
For your example above, with 45/85 gradient factors
depth
duration
runtime
gas
20m
1min
1min
air
20m
5min
5min
20m
10min
15min
EAN80
20m
5min
20min
air
9m
1min
21min
6m
17min
39min
EAN80
0m
2min
41min
Note that it skips the 9m gas change at 21min because there is no deco stop
and very short legs are skipped (existing logic in the code).
And displaying transitions:
depth
duration
runtime
gas
20m
1min
1min
air
20m
5min
5min
20m
10min
15min
EAN80
20m
5min
20min
air
9m
1min
21min
6m
0min
22min
EAN80
6m
17min
39min
0m
2min
41min
A more serious profile
depth
duration
runtime
gas
70m
2min
2min
(18/20)
70m
23min
25min
40m
5min
30min
40m
20min
50min
EAN28
21m
5min
55min
EAN50
18m
7min
63min
15m
12min
75min
12m
17min
92min
9m
25min
118min
6m
69min
187min
oxygen
0m
2min
189min
Cheers,
Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150618/87f45335/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Improve-planner-notes-gas-change-logic.patch
Type: text/x-patch
Size: 3076 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150618/87f45335/attachment-0001.bin>
More information about the subsurface
mailing list