[Patches] Planner preferences and deco stops at 10ft increments

Dirk Hohndel dirk at hohndel.org
Sun Jul 5 06:55:41 PDT 2015


Hi Rick,

On Sun, Jul 05, 2015 at 08:39:15AM +1000, Rick Walsh wrote:
> On 4 July 2015 at 23:42, Dirk Hohndel <dirk at hohndel.org> wrote:
> > We have macros to make this easier: M_OR_FT(3, 10) gives you the correct
> > value for 3m if the user has things set up for meters and 10ft if the user
> > is in imperial mode. This may not work for the "simply copy the table"
> > approach that you have taken, but I figure I'd point this out in case it
> > could be useful elsewhere.
>
> My setting of the last depth stop depth when 'last stop at 20ft' is
> selected demonstrates why that macro is useful.  I was accidentally setting
> it to 6080 mm, rather than 6096 mm, which meant that there was a
> mini-ascent in the calculated profile.  The attached patch uses the M_OR_FT
> macro, fixing this issue.

:-)

> We could use the same macro to loop through the entire decostoplevels
> array, but that would be less efficient than what is done currently.  If
> you're happy with the memcpy method, I think we should use that.  And in
> case you're wondering, I didn't make the same mistake setting the
> decostoplevels_imperial array.

I'm not in love with the memcopy - it might have been more elegant to just
use a pointer to point to the correct array. But your solution does make
the "last stop at..." solution slightly easier. In the end I don't really
care. I did change the hard coded array length to be simply calculated by
the compiler to be the same length as the metric array.  While it's
unlikely that we'd add more deco levels that seemed just too much of an
accident waiting to happen.

> I have also reattached the read-planner-preferences patch to save mixing
> patches from different emails, but it is unchanged from before.

Thanks for doing that. I applied both of them after reformatting the
commit messages.

Can you please make sure in the future that they are edited with a line
length of no more than 78?

Thanks

/D


More information about the subsurface mailing list