[PATCH] Planner notes - revise logic for gasmix output

Robert C. Helling helling at atdotde.de
Mon Jun 22 14:09:19 PDT 2015


Hi Rick,

> On 21 Jun 2015, at 03:13, Dirk Hohndel <dirk at hohndel.org> wrote:
> 
> Robert, I consider you the maintainer of the planner. I took Rick's rather
> straight forward looking patches earlier, but would you take a look at
> this one before I apply it?

I am currently looking at the patch and write down things I notice.

The gas change looks good for our case of a switch at a depth without a stop (even when mandatory stop time is set to 0). But when I turn on displayed transitions I would expect the gas change to be shown on the stop rather than on the upwards transition that leads to it (as the later is only the place to print it if there is no stop for it). I attached a patch (to be applied on top of yours or for yours to be amended with it) to fix that.



My compiler gives a warning that in that very long if statement there is || next to && and thus some parenthesis might add clarity. I would like to chime in here and also suggest to break that condition over several more lines essentially with one part of the || statement per line and to add comments there so we will not be as confused again when we look at this in a few months.

Another stylistic thing: The bool gaschange is not a good name anymore and should be renamed to something like gaschange_after and a similar abbreviation gaschange_before could be introduced. Here is a second patch for that:



But apart from that, this finally seems to do the right thing. Thanks a lot for sorting this out!

Best
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150622/9bb3e7ab/attachment-0003.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-When-displaying-transitions-show-the-gaschange-at-the-.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150622/9bb3e7ab/attachment-0002.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150622/9bb3e7ab/attachment-0004.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-Refactor-to-use-gaschage_before-and-gaschange_after.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150622/9bb3e7ab/attachment-0003.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150622/9bb3e7ab/attachment-0005.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150622/9bb3e7ab/attachment-0001.sig>


More information about the subsurface mailing list