Dive Site Duplicates [was Re: Dive site management on daily build 4.4.2.669]

Dirk Hohndel dirk at hohndel.org
Wed Jun 17 05:41:27 PDT 2015


On Wed, Jun 17, 2015 at 02:29:56PM +0200, Davide DB wrote:
> On Tue, Jun 16, 2015 at 6:03 PM, Davide DB <dbdavide at gmail.com> wrote:
> >
> > Did you change the UUID algorithm?
> >
> > Comparing the two files I found same dives with different UUID's
> > Hummm maybe I'm doing something stupid here.
> >
> > <dive number='9' rating='3' visibility='2' tags='boat, oc, reef,
> > wreck' divesiteid='55f8ce21' date='2011-05-22' time='15:50:00'
> > duration='84:00 min'>
> > <dive number='9' rating='3' visibility='2' tags='boat, oc, reef,
> > wreck' divesiteid='59a1f629' date='2011-05-22' time='15:50:00'
> > duration='84:00 min'>
> 
> Into a V3 xml file, on some dives I find:
> 
> <divecomputer model='Suunto Vyper' deviceid='434babf7'
> diveid='451b0b76' date='2015-03-08' time='12:16:00'>
> 
> or
> 
> <divecomputer model='Suunto Vyper' deviceid='434babf7' diveid='167c16ae'>
> 
> What is a "diveid" parameter?

It's our way of identifying a specific dive, downloaded from your dive
computer. So when you download the same dive from the same divecomputer
again we can tell

> I found no other references inside my file.

Yes, this is not used to cross-reference the data in the XML file but it's
used at run time when communicating with a dive computer.

> Moreover some of divecomputer tags have a date and time params.

Depending on how long you have been using Subsurface, you may even have
dives with empty <divecomputer> tags with no data included - that's from
really early versions were we didn't store some of the data we store
today.

The divecomputer only has a date / time if it is different from the dive
itself. Similarly it may have a duration entry or not.

static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer *dc)
{
	put_format(b, "  <divecomputer");
	show_utf8(b, dc->model, " model='", "'", 1);
	if (dc->deviceid)
		put_format(b, " deviceid='%08x'", dc->deviceid);
	if (dc->diveid)
		put_format(b, " diveid='%08x'", dc->diveid);
	if (dc->when && dc->when != dive->when)
		show_date(b, dc->when);
	if (dc->duration.seconds && dc->duration.seconds != dive->dc.duration.seconds)
		put_duration(b, dc->duration, " duration='", " min'");

Here you can see how we write out the data if and only if they are
different from the corresponding data in the dive.

/D


More information about the subsurface mailing list