[PATCH] Avoid plotting when ProfileWidget2::plotDive is called speciously.

K. "pestophagous" Heller pestophagous at gmail.com
Mon Oct 26 10:56:58 PDT 2015


On Fri, Oct 23, 2015 at 2:09 PM, Robert C. Helling <helling at atdotde.de> wrote:
> Hi,
>
> On 23 Oct 2015, at 07:24, K. pestophagous Heller <pestophagous at gmail.com>
> wrote:
>
> One indirect call site of plotDive, MainTab::acceptChanges, can
> trigger a replot several times during one pass through
> acceptChanges.  Avoiding some of the replots is both an
> optimization and a small bug-fix.  A replot could happen when
> displayed_dive is presently zeroed-out, which made no sense.
>
>
> this is a good idea but it is too blunt: With this, when you open the
> planner on an empty log (I do this quite often when I don’t want any
> previous dives influence my calculation), you don’t get any plot at all.
>

:)
Ouch (said the codebase upon receiving the patch).  Of course you are
right.  Definitely NAK.

Thanks.  I am grateful to receive this knowledge.

Over the longer term, I plan to keep my eye on how to sharpen my
currently-too-blunt idea. I don't see any simple way to adjust my
conditional statement to make this work for all cases right now.  So
this moves to the backburner for now.

On the bright side: i now know why you could not reproduce the "Too
many gas mixes" by following the steps I listed previously.  Back on
Oct 21, I had said that getting a deltaT of zero (between two
waypoints) and then hitting "Apply changes" was a *guaranteed* way to
see the false warning.  Now I realize there were some steps that I
took for granted.

steps:

1. make sure there is at least 1 dive in the Dive List.
2. make sure one dive (any one dive) is *selected* in the dive list.
3. go to Log → Add Dive
4. "click like crazy" on the dive you are adding, following Poltsi's
videos from: http://trac.subsurface-divelog.org/ticket/745
5. you know when your clicks are crazy enough because you will trigger
the failure of assertions shown here:
   https://github.com/pestophagous/subsurface/commit/6f2532fa8bf7215bba6250d64e13f16bbb7bb8e5
6. then click "Apply changes."

What I listed above as step 1 and step 2 were previously happening "by
habit" for me, and I did not realize they were necessary steps.

Clicking "apply changes" behaves differently depending on whether
there is a dive selected in the Dive List.

Since the new dive being edited/created due to "Add Dive" is (in
theory) completely different and separate from whichever dive is
selected in step 2, it does seem odd that having some (unrelated) dive
selected at the time of "apply changes" can influence the outcome. But
it does.

Here is the reproduction on 4.5 on a mac: http://screencast.com/t/uRaVjt33eHy

/K


More information about the subsurface mailing list