[PATCH] Planner notes - revise logic for gasmix output

Rick Walsh rickmwalsh at gmail.com
Fri Jun 19 22:30:58 PDT 2015


The logic for when to output a gasmix in the notes table is more
complicated than it seems at first.
-On a descent leg, the gas is the gas used for descent
-At a stop (calculated or user defined), the gas is the gas used for that
stop
-But on an ascent leg (if displayed), the gas is the gas that is ABOUT TO
BE USED
-The gas should not be repeated if it's the same gas as used on the last
row of the table
-Ascent legs should only be displayed if the display transitions option is
selected, OR if there is a gas change without a stop (the user can now set
a minimum duration for a gaschange, but zero is still allowed).

The existing code tries to track what gas is being used/switched to at each
waypoint, and whether the gas should be printed or postponed to the next
leg.  It works sometimes but not always.

This patch replaces the postponed gas logic with:
-Is this an ascent leg? (determines whether the applicable gas is the
preceding or following leg, and whether the leg should be displayed at all
if the transitions option isn't selected)
-Is it an ascent with a gaschange without a stop?
-Has the gas actually changed from the last output?
-Will the next leg be at the same level and same gas (in which case merge
them)?


I have been convinced that the zero time gas switch stop table entry is not
correct.  Instead it should be merged into the preceding ascent, which is
what this patch does.  It is now less of an issue since the user can set a
minimum duration for gas switches.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150620/124660c4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Planner-notes-revise-logic-for-gasmix-output.patch
Type: text/x-patch
Size: 6447 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150620/124660c4/attachment.bin>


More information about the subsurface mailing list