freedive mode

Dirk Hohndel dirk at hohndel.org
Sun Oct 4 04:22:12 PDT 2015


Hi Giorgio,

thanks for the excellent bug report including a sample file.

I found and fixed the bug and also added another feature that you asked
for: when the dive computer reports your dive as "freedive" we now split
the dives with only 10 seconds at the surface (otherwise the threshold
stays 60 seconds). For the example file you provided we now get 69(!)
dives when splitting the first dive.

I pushed the changes to master. My plan is to cut Beta 3 later today which
will also contain this change.

BTW: have you considered joining our developer mailing list? We have gone
way past "user questions for the forum" here and are into software
development which might be better discussed there...

Thanks again for helping us figure this out - it looks like this one got
in just in time for Subsurface 4.5.

Let me know if this is now sufficient for what you had in mind (and what
can reasonably be added to 4.5). Post 4.5 I'd be willing to consider a
preferences setting that says "in freedive mode, automatically split dives
when importing from the dive computer". Given the UI change this would
require I really want to defer this... if there are enough people
interested we COULD do this for 4.5.1 - but more likely this is 4.6
material

/D

On Sun, Oct 04, 2015 at 02:54:50AM -0700, Giorgio Marzano wrote:
> Hi, again
> 
> checked out latest git 
> 
> It seems that now split is only working with dives (even inside a trip, 
> btw) with only one surface interval, thus only 2 "sub-dives"
> 
> If there is more it throws a segfault
> 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000005cd23d in DiveListView::splitDives (this=0x160a180) at 
> /home/gmarzano/src/subsurface/qt-ui/divelistview.cpp:625
> 625                     if (dive->selected)
> (gdb) list
> 620     {
> 621             int i;
> 622             struct dive *dive;
> 623
> 624             for_each_dive (i, dive) {
> 625                     if (dive->selected)
> 626                             split_dive(dive);
> 627             }
> 628             MainWindow::instance()->refreshProfile();
> 629             MainWindow::instance()->refreshDisplay();
> (gdb) print i
> $3 = 12
> (gdb) print dive
> $4 = (dive *) 0x73006e00000000
> (gdb) print *dive
> Cannot access memory at address 0x73006e00000000
> (gdb) 
> 
> 
> 
> I attach an xml file so you can try yourself. The second dive (Aug 27 2015) 
> only has 2 subdives. Any other dive has many subdives.
> 
> G
> 
> 
> 
> Il giorno sabato 3 ottobre 2015 13:14:22 UTC+2, Dirk ha scritto:
> >
> > On Sat, Oct 03, 2015 at 12:20:35AM -0700, Giorgio Marzano wrote: 
> > > 
> > > I managed to build from git with my version of libdivecomputer and tried 
> > > the split dive function. It is great! 
> >
> > I'm glad it works for you. 
> >
> > > Then i noticed the "trip" capability and I believe that it could be an 
> > easy 
> > > way to mimic freediving "session" concept. 
> > > 
> > > Sadly, if I create a trip and then try to split a dive inside it I get a 
> > > corde dump 
> > > 
> > > subsurface: /home/gmarzano/src/subsurface/divelist.c:665: 
> > > remove_dive_from_trip: Assertion `trip->nrdives > 0' failed. 
> > > Aborted (core dumped) 
> >
> > Oops. Apparently neither Linus nor I tested that. 
> > I just reproduced it and am now testing a fix. 
> >
> > > So you have to split a dive and then add each single dive in the new 
> > trip 
> > > 
> > > Moreover, trying to look at the core dump I noticed that the dive_cb 
> > > function handles a parameter called "devdata->create_new_trip" 
> > > 
> > > if (devdata->create_new_trip) { 
> > > if (!devdata->trip) 
> > > devdata->trip = create_and_hookup_trip_from_dive(dive); 
> > > else 
> > > add_dive_to_trip(dive, devdata->trip); 
> > > } 
> > > 
> > > but i couldn't find it anywhere else in the code. 
> >
> > This is called if in the Download from divecomputer dialog you ask 
> > Subsurface to put the downloaded dives in a separate trip - but that's not 
> > one trip per dive, it's all the dives that you download into their own 
> > trip. 
> >
> > > It could be another (and IMO better) way to handle freedive sessions. 
> > > Libdivecomputer could  return a list of single dives instead of merging 
> > > them and they will be automagically added in a single trip. Which part 
> > of 
> > > the SW is in charge to set the "create_new_trip" member of the devdata 
> > > structure? 
> >
> > Again, libdivecomputer questions are best answered by Jef. I don't know 
> > how he wants to handle this in the end. 
> >
> > /D 
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups "Subsurface Divelog" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to subsurface-divelog+unsubscribe at googlegroups.com.
> To post to this group, send email to subsurface-divelog at googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/subsurface-divelog/46ddc49f-657b-433a-aa41-ca5a9fe89586%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.




More information about the subsurface mailing list