Fix merging of weight systems
dirk at hohndel.org
Mon Oct 29 11:36:14 PDT 2012
Linus Torvalds <torvalds at linux-foundation.org> writes:
> There might be better ways to merge weights if both dives have weight
> information, but this is "good enough" for the sane cases of having
> *one* of the dives have weigth information, and picking it from there.
Actually, that's an interesting comment as I looked into the same thing
for another reason just a few minutes ago.
Turns out that on the Uemis you can add weight information on the dive
computer and we can indeed parse that from Subsurface. So there it is
entirely possible (even likely) that you have manually entered weight
info with the correct weight description, yet you get weight info from
the computer on a new download with description "unknown". I think the
right thing to do is:
if both have weight info
if the total weight is the same
keep the one that doesn't have "unknown" as description
All other cases: accumulate all of the weight info from both "dives"
More information about the subsurface