Merging Dives (P.S. -- multiple email addresses)

Dirk Hohndel dirk at hohndel.org
Sun Feb 15 17:41:13 PST 2015


On Sun, Feb 15, 2015 at 03:06:48PM -0800, Steve Butler wrote:
> My wife's DC recorded 4 separate dives (pool work for her Rescue Diver
> class) on Sunday Jan 29th.  She wanted them all merged into a single dive.
> 
> Her version of Subsurface will merge only 2 dives and then stops merging.
> v4.3.0.0  Once she merges the Dives 1&2 from the 29th it won't let her merge
> any more.  Not even the 2 pool dives (make up work) from Thursday Feb 5th.

So the way things work is that mergeDives() walks the dive list and will
try to merge the first two selected dive (so that's the oldest two dives)
and then tries to merge the next one into that merged dive, etc.

But for every pair of dives it's supposed to merge it calls
can_merge() and that only succeeds if there's less than 30 minutes between
the dives...

> I haven't stayed up with the current master but do have v4.4.0-67.

I think that's the last one before the Great Dive Site Disruption :-)

> Created a new log book and started downloading from her DC. Cancelled after
> a bit (didn't want all her dives) and selected just the 4 dives from Jan
> 29th and the 2 from Feb 5th.  Attached as Wanita1.xml.

I see... because of the rules for merging dives dive 1 and 2 can't be
merged - more than 30 minutes between the end of the first and the
beginning of the second. Then dives 2 and 3 get merged successfully.
And then we seem to have a bug because the duration of that merged dive is
now incorrect. It claims a duration of 850 seconds - a little over 14
minutes, which is the sum of the two durations, but not the sum duration
from beginning to end of the dive - we don't account for the surface
interval. And therefore a calculated end time is about ten minutes to
early and with that the merge fails.

Funnily enough, if you FIRST merge dive 3 and 4 and THEN merge dive 2 with
that merged dive, you can merge all three...

> I was able to merge the two dives from Feb 5th and then able to merge dives
> 3&4 from Jan 29th (working from most recent to oldest -- if I start with the
> oldest I can only merge the first two dives on Jan 29th and nothing more).
> 
> After renumbering the dives, saving out as Wanita2.xml and opening it back
> up I was only able to merge dive 2 into the merger of original dives 3/4.
> Could not get dive 1 included.  Attached as Wanita3.xml

That's because dive 1 does indeed end more than 30 minutes before dive 2
starts.

That's an arbitrary threshold, of course. It seemed to make sense to us...
if you have more than 30 minutes surface interval, it really doesn't seem
to be the same dive anymore...

> Note:  Both of us tried to highlight all 4 dives and merge them in one pass
> but it only merged the first two and then stopped merging.

Not the first two, the middle two.

> Questions:
> 1.  Should we be able to merge more than two dives in a single pass?

Yes, if it wasn't for the bug I mention and for the fact that the surface
interval between dive 1 and 2 is too long.

> 2.  Why do we have to renumber/save/close/open to get the second merge to
> work when working from oldest to newest (but not when working newest to
> oldest)?  [my version].

I don't have that. I can open the file, merge dives 3 and 4 and then merge
dive 2 with the resulting dive of that first merge.

> 3.  Should we be doing something else?  [I do need to go prune the grape
> vines.]

You should ask yourself why you want to merge these dives to begin with...
the idea behind merging was if you did a dive but for some reason had to
come to the surface and the silly computer decides to start a new dive,
whereas in reality you are just continuing the dive. > 30 minutes on the
surface seems not to fit that pattern.

> PS  Can my account have more than one email address?  Try as I do, my Ubuntu
> box and my phone don't seem to agree on which mail box emails are sent from.
> I suspect the one from my phone hangs up until the moderator releases it.
> 
> The phone email comes from kg7je at comcast.net
> Thunderbird claims this email is from kg7je at comcast.net with a reply-to of
> kg7je at arrl.net
> I think I registered with kg7je at arrl.net

Both of these emails are accepted for posting. And I don't see anything
from you in the moderation queue.

/D


More information about the subsurface mailing list