Improve automatic dive merging logic

Linus Torvalds torvalds at linux-foundation.org
Tue Dec 4 12:26:28 PST 2012


This tunes the heuristics for when to merge two dives together into a
single dive. We used to just look at the date, and say "if they're
within one minute of each other, try to merge". This looks at the
actual dive data, and tries to see just how much sense it makes to
merge the dive.

It also checks if the dives to be merged use different dive computers,
and if so relaxes the one minute to five, since most people aren't
quite as OCD as I am, and don't tend to set their dive computers quite
that exactly to the same time and date.

I'm sure people can come up with other heuristics, but this should
make that easier too.

NOTE! If you have things like wrong timezones etc, and the
divecomputer dates are thus off by hours rather than by a couple of
minutes, this will still not merge them. For that kind of situation,
we'd need some kind of manual merge option. Note that that is *not*
the same as the current "merge two adjacent dives" together, which
joins two separate dives into one *longer* dive with a surface
interval in between.

That kind of manual merge UI makes sense, but is independent of this
partical change.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

This gets my three dive computers merging nicely and automatically for
the dives where I had all three with me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 3926 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20121204/f83c34d9/attachment.obj>


More information about the subsurface mailing list