On Sat, Feb 14, 2015 at 8:46 PM, Dirk Hohndel <[email protected]> wrote:

> oops, this messages got stuck in my outbox...
>
> /D
>
> On Sat, Feb 14, 2015 at 11:33:56AM +0200, Miika Turkia wrote:
> > If the dive site exists, we need to associate the uuid to current dive.
> >
> > Signed-off-by: Miika Turkia <[email protected]>
> > ---
> >  parse-xml.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/parse-xml.c b/parse-xml.c
> > index cfe3459..97d0c09 100644
> > --- a/parse-xml.c
> > +++ b/parse-xml.c
> > @@ -1226,6 +1226,10 @@ static void add_dive_site(char *buffer, struct
> dive *dive)
> >                       } else if (!same_string(ds->name, buffer)) {
> >                               // coin toss, let's just keep the first
> name we found
> >                               fprintf(stderr, "which means the dive
> already links to dive site of different name {%s} / {%s}\n", ds->name,
> buffer);
> > +                     } else {
> > +                             // add the existing dive site to the
> current dive
> > +                             fprintf(stderr, "we have an existing
> location, using {%s}\n", ds->name);
> > +                             dive->dive_site_uuid = uuid;
>
> Read the beginning of the function... if I'm not mistaken, ds is created
> from dive->dive_site_uuid... so there should be no reason to set it again.
> Am I missing something?
>

The attached log (2 dives) has same sites for both of the dives, but
opening it with current master does loose one of the locations. This occurs
during the conversion from old format, thus there is no uuid for the dive
currently being parsed. So we get the uuid by the site name, but never
assign that to the dive in case of duplicate location.

miika
<divelog program='subsurface' version='2'>
<settings>
<divecomputerid model='Suunto Vyper Air' deviceid='07c2a44a' serial='20400612' firmware='1.1.22'/>
<divecomputerid model='Suunto Stinger' deviceid='0b2a5494' serial='80901329' firmware='0.0.21' nickname='Stinkku'/>
<divecomputerid model='Suunto Vyper Air' deviceid='20993833' serial='99312861'/>
<divecomputerid model='Suunto Vyper Air' deviceid='f8e03453' nickname='Vyper uusi'/>
  <autogroup state='1' />
</settings>
<dives>
<trip date='2015-01-14' time='08:39:00' location='Philippines - Puerto Galera - Sabang Point'>
<dive number='658' rating='4' visibility='4' tags='boat' date='2015-01-14' time='08:39:00' duration='55:20 min'>
  <location>Philippines - Puerto Galera - Verde Island</location>
  <suit>7mm full + 3mm vest</suit>
  <cylinder size='11.094 l' workpressure='206.843 bar' description='AL80' o2='32.0%' start='202.0 bar' end='59.0 bar' />
  <weightsystem weight='2.7 kg' description='belt' />
  <weightsystem weight='2.6 kg' description='integrated' />
  <divecomputer model='Suunto Stinger' deviceid='0b2a5494' diveid='dd8ad1cf'>
  <depth max='31.09 m' mean='17.522 m' />
  <temperature air='26.0 C' water='24.0 C' />
  <sample time='0:00 min' depth='0.0 m' />
  <sample time='0:20 min' depth='2.134 m' />
  <sample time='0:40 min' depth='3.962 m' />
  <sample time='1:00 min' depth='5.791 m' />
  <sample time='1:20 min' depth='8.534 m' />
  <sample time='1:40 min' depth='10.363 m' />
  <sample time='2:00 min' depth='11.887 m' />
  <sample time='2:20 min' depth='14.021 m' />
  <sample time='2:40 min' depth='14.935 m' />
  <sample time='3:00 min' depth='16.764 m' />
  <sample time='3:20 min' depth='17.374 m' />
  <sample time='3:40 min' depth='17.983 m' />
  <sample time='4:00 min' depth='18.288 m' />
  <sample time='4:20 min' depth='18.288 m' />
  <sample time='4:40 min' depth='18.288 m' />
  <sample time='5:00 min' depth='19.202 m' />
  <sample time='5:20 min' depth='19.507 m' />
  <sample time='5:40 min' depth='19.507 m' />
  <sample time='6:00 min' depth='20.117 m' />
  <sample time='6:20 min' depth='19.507 m' />
  <sample time='6:40 min' depth='20.422 m' />
  <sample time='7:00 min' depth='20.726 m' />
  <sample time='7:20 min' depth='21.336 m' />
  <sample time='7:40 min' depth='21.946 m' />
  <sample time='8:00 min' depth='22.555 m' />
  <sample time='8:20 min' depth='24.689 m' />
  <sample time='8:40 min' depth='26.518 m' />
  <sample time='9:00 min' depth='27.737 m' />
  <sample time='9:20 min' depth='29.261 m' />
  <sample time='9:40 min' depth='30.175 m' />
  <sample time='10:00 min' depth='30.785 m' />
  <sample time='10:20 min' depth='31.09 m' temp='24.0 C' />
  <sample time='10:40 min' depth='30.785 m' />
  <sample time='11:00 min' depth='29.87 m' />
  <sample time='11:20 min' depth='30.785 m' />
  <sample time='11:40 min' depth='30.785 m' />
  <sample time='12:00 min' depth='30.785 m' />
  <sample time='12:20 min' depth='30.175 m' />
  <sample time='12:40 min' depth='29.566 m' />
  <sample time='13:00 min' depth='29.261 m' />
  <sample time='13:20 min' depth='28.956 m' />
  <sample time='13:40 min' depth='28.956 m' />
  <sample time='14:00 min' depth='28.651 m' />
  <sample time='14:20 min' depth='28.651 m' />
  <sample time='14:40 min' depth='28.956 m' />
  <sample time='15:00 min' depth='29.261 m' />
  <sample time='15:20 min' depth='29.261 m' />
  <sample time='15:40 min' depth='29.566 m' />
  <sample time='16:00 min' depth='28.956 m' />
  <sample time='16:20 min' depth='28.956 m' />
  <sample time='16:40 min' depth='28.956 m' />
  <sample time='17:00 min' depth='28.651 m' />
  <sample time='17:20 min' depth='28.042 m' />
  <sample time='17:40 min' depth='27.737 m' />
  <sample time='18:00 min' depth='27.737 m' />
  <sample time='18:20 min' depth='27.737 m' />
  <sample time='18:40 min' depth='27.432 m' />
  <sample time='19:00 min' depth='27.127 m' />
  <sample time='19:20 min' depth='26.213 m' />
  <sample time='19:40 min' depth='25.908 m' />
  <sample time='20:00 min' depth='24.994 m' />
  <sample time='20:20 min' depth='24.994 m' />
  <sample time='20:40 min' depth='24.994 m' />
  <sample time='21:00 min' depth='24.994 m' />
  <sample time='21:20 min' depth='24.994 m' />
  <sample time='21:40 min' depth='24.689 m' />
  <sample time='22:00 min' depth='24.689 m' />
  <sample time='22:20 min' depth='23.774 m' />
  <sample time='22:40 min' depth='23.774 m' />
  <sample time='23:00 min' depth='24.384 m' />
  <sample time='23:20 min' depth='24.384 m' />
  <sample time='23:40 min' depth='23.774 m' />
  <sample time='24:00 min' depth='23.165 m' />
  <sample time='24:20 min' depth='23.165 m' />
  <sample time='24:40 min' depth='23.165 m' />
  <sample time='25:00 min' depth='22.86 m' />
  <sample time='25:20 min' depth='22.86 m' />
  <sample time='25:40 min' depth='22.555 m' />
  <sample time='26:00 min' depth='22.555 m' />
  <sample time='26:20 min' depth='21.641 m' />
  <sample time='26:40 min' depth='20.117 m' />
  <sample time='27:00 min' depth='18.898 m' />
  <sample time='27:20 min' depth='19.507 m' />
  <sample time='27:40 min' depth='19.812 m' />
  <sample time='28:00 min' depth='20.117 m' />
  <sample time='28:20 min' depth='19.507 m' />
  <sample time='28:40 min' depth='19.507 m' />
  <sample time='29:00 min' depth='19.507 m' />
  <sample time='29:20 min' depth='19.507 m' />
  <sample time='29:40 min' depth='19.812 m' />
  <sample time='30:00 min' depth='20.422 m' />
  <sample time='30:20 min' depth='20.726 m' />
  <sample time='30:40 min' depth='20.117 m' />
  <sample time='31:00 min' depth='19.812 m' />
  <sample time='31:20 min' depth='19.507 m' />
  <sample time='31:40 min' depth='18.593 m' />
  <sample time='32:00 min' depth='18.593 m' />
  <sample time='32:20 min' depth='18.288 m' />
  <sample time='32:40 min' depth='17.983 m' />
  <sample time='33:00 min' depth='17.374 m' />
  <sample time='33:20 min' depth='17.069 m' />
  <sample time='33:40 min' depth='16.459 m' />
  <sample time='34:00 min' depth='15.85 m' />
  <sample time='34:20 min' depth='15.545 m' />
  <sample time='34:40 min' depth='15.545 m' />
  <sample time='35:00 min' depth='15.545 m' />
  <sample time='35:20 min' depth='15.85 m' />
  <sample time='35:40 min' depth='15.85 m' />
  <sample time='36:00 min' depth='15.85 m' />
  <sample time='36:20 min' depth='14.63 m' />
  <sample time='36:40 min' depth='14.63 m' />
  <sample time='37:00 min' depth='14.63 m' />
  <sample time='37:20 min' depth='14.63 m' />
  <sample time='37:40 min' depth='14.326 m' />
  <sample time='38:00 min' depth='13.716 m' />
  <sample time='38:20 min' depth='13.411 m' />
  <sample time='38:40 min' depth='13.106 m' />
  <sample time='39:00 min' depth='12.802 m' />
  <sample time='39:20 min' depth='12.192 m' />
  <sample time='39:40 min' depth='11.278 m' />
  <sample time='40:00 min' depth='10.668 m' />
  <sample time='40:20 min' depth='10.363 m' />
  <sample time='40:40 min' depth='10.363 m' />
  <sample time='41:00 min' depth='10.363 m' />
  <sample time='41:20 min' depth='10.363 m' />
  <sample time='41:40 min' depth='10.363 m' />
  <sample time='42:00 min' depth='10.058 m' />
  <sample time='42:20 min' depth='9.449 m' />
  <sample time='42:40 min' depth='9.449 m' />
  <sample time='43:00 min' depth='9.144 m' />
  <sample time='43:20 min' depth='9.144 m' />
  <sample time='43:40 min' depth='9.144 m' />
  <sample time='44:00 min' depth='9.144 m' />
  <sample time='44:20 min' depth='9.449 m' />
  <sample time='44:40 min' depth='10.363 m' />
  <sample time='45:00 min' depth='10.363 m' />
  <sample time='45:20 min' depth='10.363 m' />
  <sample time='45:40 min' depth='10.363 m' />
  <sample time='46:00 min' depth='10.363 m' />
  <sample time='46:20 min' depth='10.668 m' />
  <sample time='46:40 min' depth='10.973 m' />
  <sample time='47:00 min' depth='10.973 m' />
  <sample time='47:20 min' depth='10.363 m' />
  <sample time='47:40 min' depth='10.058 m' />
  <sample time='48:00 min' depth='8.534 m' />
  <sample time='48:20 min' depth='8.534 m' />
  <sample time='48:40 min' depth='8.23 m' />
  <sample time='49:00 min' depth='7.925 m' />
  <sample time='49:20 min' depth='7.315 m' />
  <sample time='49:40 min' depth='6.401 m' />
  <sample time='50:00 min' depth='5.182 m' />
  <sample time='50:20 min' depth='5.182 m' />
  <sample time='50:40 min' depth='4.877 m' />
  <sample time='51:00 min' depth='5.182 m' />
  <sample time='51:20 min' depth='4.877 m' />
  <sample time='51:40 min' depth='4.877 m' />
  <sample time='52:00 min' depth='4.877 m' />
  <sample time='52:20 min' depth='4.877 m' />
  <sample time='52:40 min' depth='4.572 m' />
  <sample time='53:00 min' depth='4.267 m' />
  <sample time='53:20 min' depth='4.267 m' />
  <sample time='53:40 min' depth='4.267 m' />
  <sample time='54:00 min' depth='4.267 m' />
  <sample time='54:20 min' depth='3.353 m' />
  <sample time='54:40 min' depth='3.353 m' />
  <sample time='55:00 min' depth='2.743 m' />
  <sample time='55:20 min' depth='0.0 m' />
  </divecomputer>
  <picture filename='/home/mturkia/Pictures/2015/Filippiinit/PuertoGalera/7/P1140135.jpg' offset='+11:24 min'/>
  <picture filename='/home/mturkia/Pictures/2015/Filippiinit/PuertoGalera/7/P1140143.jpg' offset='+46:36 min'/>
</dive>
<dive number='659' rating='4' visibility='4' tags='boat' date='2015-01-14' time='10:51:00' duration='57:00 min'>
  <location>Philippines - Puerto Galera - Verde Island</location>
  <suit>7mm full + 3mm vest</suit>
  <cylinder size='11.094 l' workpressure='206.843 bar' description='AL80' o2='31.0%' start='204.0 bar' end='68.0 bar' />
  <weightsystem weight='2.7 kg' description='belt' />
  <weightsystem weight='2.6 kg' description='integrated' />
  <divecomputer model='Suunto Stinger' deviceid='0b2a5494' diveid='67eff022'>
  <depth max='28.346 m' mean='16.186 m' />
  <temperature air='27.0 C' water='24.0 C' />
  <event time='0:20 min' type='7' name='violation' />
  <sample time='0:00 min' depth='0.0 m' />
  <sample time='0:20 min' depth='5.791 m' />
  <sample time='0:40 min' depth='11.278 m' />
  <sample time='1:00 min' depth='15.24 m' />
  <sample time='1:20 min' depth='16.154 m' />
  <sample time='1:40 min' depth='17.069 m' />
  <sample time='2:00 min' depth='17.678 m' />
  <sample time='2:20 min' depth='18.593 m' />
  <sample time='2:40 min' depth='19.507 m' />
  <sample time='3:00 min' depth='20.117 m' />
  <sample time='3:20 min' depth='20.117 m' />
  <sample time='3:40 min' depth='20.422 m' />
  <sample time='4:00 min' depth='20.726 m' />
  <sample time='4:20 min' depth='20.726 m' />
  <sample time='4:40 min' depth='21.031 m' />
  <sample time='5:00 min' depth='21.031 m' />
  <sample time='5:20 min' depth='22.86 m' />
  <sample time='5:40 min' depth='23.47 m' />
  <sample time='6:00 min' depth='23.47 m' />
  <sample time='6:20 min' depth='24.384 m' />
  <sample time='6:40 min' depth='24.994 m' />
  <sample time='7:00 min' depth='25.603 m' />
  <sample time='7:20 min' depth='26.213 m' />
  <sample time='7:40 min' depth='26.213 m' />
  <sample time='8:00 min' depth='26.518 m' />
  <sample time='8:20 min' depth='26.518 m' />
  <sample time='8:40 min' depth='26.518 m' />
  <sample time='9:00 min' depth='26.822 m' />
  <sample time='9:20 min' depth='26.822 m' />
  <sample time='9:40 min' depth='26.518 m' />
  <sample time='10:00 min' depth='26.518 m' />
  <sample time='10:20 min' depth='26.518 m' />
  <sample time='10:40 min' depth='26.213 m' />
  <sample time='11:00 min' depth='26.213 m' />
  <sample time='11:20 min' depth='26.213 m' />
  <sample time='11:40 min' depth='26.822 m' />
  <sample time='12:00 min' depth='27.127 m' />
  <sample time='12:20 min' depth='27.127 m' />
  <sample time='12:40 min' depth='27.432 m' />
  <sample time='13:00 min' depth='27.432 m' />
  <sample time='13:20 min' depth='27.737 m' />
  <sample time='13:40 min' depth='28.042 m' />
  <sample time='14:00 min' depth='28.042 m' />
  <sample time='14:20 min' depth='27.737 m' />
  <sample time='14:40 min' depth='27.737 m' />
  <sample time='15:00 min' depth='27.432 m' />
  <sample time='15:20 min' depth='27.127 m' />
  <sample time='15:40 min' depth='27.432 m' />
  <sample time='16:00 min' depth='28.042 m' />
  <sample time='16:20 min' depth='28.346 m' temp='24.0 C' />
  <sample time='16:40 min' depth='28.346 m' />
  <sample time='17:00 min' depth='28.346 m' />
  <sample time='17:20 min' depth='27.737 m' />
  <sample time='17:40 min' depth='26.822 m' />
  <sample time='18:00 min' depth='26.213 m' />
  <sample time='18:20 min' depth='26.213 m' />
  <sample time='18:40 min' depth='25.908 m' />
  <sample time='19:00 min' depth='26.213 m' />
  <sample time='19:20 min' depth='25.908 m' />
  <sample time='19:40 min' depth='25.908 m' />
  <sample time='20:00 min' depth='25.908 m' />
  <sample time='20:20 min' depth='25.908 m' />
  <sample time='20:40 min' depth='25.908 m' />
  <sample time='21:00 min' depth='25.908 m' />
  <sample time='21:20 min' depth='24.994 m' />
  <sample time='21:40 min' depth='24.689 m' />
  <sample time='22:00 min' depth='24.079 m' />
  <sample time='22:20 min' depth='22.86 m' />
  <sample time='22:40 min' depth='22.86 m' />
  <sample time='23:00 min' depth='22.555 m' />
  <sample time='23:20 min' depth='22.25 m' />
  <sample time='23:40 min' depth='21.031 m' />
  <sample time='24:00 min' depth='20.422 m' />
  <sample time='24:20 min' depth='20.117 m' />
  <sample time='24:40 min' depth='20.117 m' />
  <sample time='25:00 min' depth='19.202 m' />
  <sample time='25:20 min' depth='18.288 m' />
  <sample time='25:40 min' depth='17.374 m' />
  <sample time='26:00 min' depth='17.374 m' />
  <sample time='26:20 min' depth='16.764 m' />
  <sample time='26:40 min' depth='16.154 m' />
  <sample time='27:00 min' depth='15.85 m' />
  <sample time='27:20 min' depth='15.545 m' />
  <sample time='27:40 min' depth='15.545 m' />
  <sample time='28:00 min' depth='15.545 m' />
  <sample time='28:20 min' depth='15.545 m' />
  <sample time='28:40 min' depth='15.85 m' />
  <sample time='29:00 min' depth='15.85 m' />
  <sample time='29:20 min' depth='14.935 m' />
  <sample time='29:40 min' depth='14.326 m' />
  <sample time='30:00 min' depth='13.106 m' />
  <sample time='30:20 min' depth='12.802 m' />
  <sample time='30:40 min' depth='12.192 m' />
  <sample time='31:00 min' depth='12.497 m' />
  <sample time='31:20 min' depth='12.497 m' />
  <sample time='31:40 min' depth='12.497 m' />
  <sample time='32:00 min' depth='12.192 m' />
  <sample time='32:20 min' depth='11.582 m' />
  <sample time='32:40 min' depth='11.278 m' />
  <sample time='33:00 min' depth='11.278 m' />
  <sample time='33:20 min' depth='10.973 m' />
  <sample time='33:40 min' depth='11.278 m' />
  <sample time='34:00 min' depth='11.887 m' />
  <sample time='34:20 min' depth='10.973 m' />
  <sample time='34:40 min' depth='11.582 m' />
  <sample time='35:00 min' depth='11.582 m' />
  <sample time='35:20 min' depth='11.582 m' />
  <sample time='35:40 min' depth='11.582 m' />
  <sample time='36:00 min' depth='10.973 m' />
  <sample time='36:20 min' depth='10.363 m' />
  <sample time='36:40 min' depth='10.363 m' />
  <sample time='37:00 min' depth='10.058 m' />
  <sample time='37:20 min' depth='10.363 m' />
  <sample time='37:40 min' depth='10.363 m' />
  <sample time='38:00 min' depth='10.058 m' />
  <sample time='38:20 min' depth='10.058 m' />
  <sample time='38:40 min' depth='12.497 m' />
  <sample time='39:00 min' depth='12.802 m' />
  <sample time='39:20 min' depth='12.497 m' />
  <sample time='39:40 min' depth='12.497 m' />
  <sample time='40:00 min' depth='12.802 m' />
  <sample time='40:20 min' depth='12.802 m' />
  <sample time='40:40 min' depth='12.802 m' />
  <sample time='41:00 min' depth='11.582 m' />
  <sample time='41:20 min' depth='10.363 m' />
  <sample time='41:40 min' depth='9.754 m' />
  <sample time='42:00 min' depth='9.144 m' />
  <sample time='42:20 min' depth='8.534 m' />
  <sample time='42:40 min' depth='8.839 m' />
  <sample time='43:00 min' depth='8.534 m' />
  <sample time='43:20 min' depth='8.534 m' />
  <sample time='43:40 min' depth='8.839 m' />
  <sample time='44:00 min' depth='8.534 m' />
  <sample time='44:20 min' depth='8.23 m' />
  <sample time='44:40 min' depth='8.534 m' />
  <sample time='45:00 min' depth='9.144 m' />
  <sample time='45:20 min' depth='9.144 m' />
  <sample time='45:40 min' depth='9.144 m' />
  <sample time='46:00 min' depth='9.144 m' />
  <sample time='46:20 min' depth='8.839 m' />
  <sample time='46:40 min' depth='8.839 m' />
  <sample time='47:00 min' depth='9.144 m' />
  <sample time='47:20 min' depth='8.839 m' />
  <sample time='47:40 min' depth='9.144 m' />
  <sample time='48:00 min' depth='9.144 m' />
  <sample time='48:20 min' depth='8.534 m' />
  <sample time='48:40 min' depth='8.534 m' />
  <sample time='49:00 min' depth='7.925 m' />
  <sample time='49:20 min' depth='7.925 m' />
  <sample time='49:40 min' depth='7.62 m' />
  <sample time='50:00 min' depth='7.62 m' />
  <sample time='50:20 min' depth='7.62 m' />
  <sample time='50:40 min' depth='7.62 m' />
  <sample time='51:00 min' depth='7.315 m' />
  <sample time='51:20 min' depth='6.096 m' />
  <sample time='51:40 min' depth='5.486 m' />
  <sample time='52:00 min' depth='5.791 m' />
  <sample time='52:20 min' depth='5.791 m' />
  <sample time='52:40 min' depth='5.791 m' />
  <sample time='53:00 min' depth='5.791 m' />
  <sample time='53:20 min' depth='5.182 m' />
  <sample time='53:40 min' depth='5.182 m' />
  <sample time='54:00 min' depth='5.182 m' />
  <sample time='54:20 min' depth='5.486 m' />
  <sample time='54:40 min' depth='5.486 m' />
  <sample time='55:00 min' depth='4.877 m' />
  <sample time='55:20 min' depth='4.267 m' />
  <sample time='55:40 min' depth='3.962 m' />
  <sample time='56:00 min' depth='3.658 m' />
  <sample time='56:20 min' depth='3.048 m' />
  <sample time='56:40 min' depth='2.438 m' />
  <sample time='57:00 min' depth='0.0 m' temp='25.0 C' />
  </divecomputer>
  <picture filename='/home/mturkia/Pictures/2015/Filippiinit/PuertoGalera/7/P1140166.jpg' offset='+39:17 min'/>
</dive>
</trip>
</dives>
</divelog>
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to