dive planning update

Dirk Hohndel dirk at hohndel.org
Wed Jan 9 16:37:13 PST 2013


Ok, another couple of dive planning updates went into master.

I thought I had this done last night but still got a Valgrind
error. Looked again a few minutes ago and with a fresh mind the bug was
blatantly obvious. I should take more breaks :-)

Anyway, this is a pretty massive change to the first very hackish
attempt to do the planning. This now carefully tracks the available
gases and depth at which they can be used - and from the looks of it
creates fairly reasonable dive plans.

Try something like this:

50m 8 AIR
50m +10 AIR
30m <hit tab and leave time empty> 40
10m <"> 80

This tells Subsurface that you plan an 8 minutes descent to 50m. Hang
out there for 10 minutes and then make your way back up. You'll have two
more gases with you, EAN40 that you want to switch to at 30m and EAN80
that you'll switch to at 10m.

Depending on your GFlow and high setting (mine are the default 35/75)
you should get something like this dive:

<divelog program='subsurface' version='2'>
<settings>
</settings>
<dives>
<dive date='2013-01-10' time='01:33:28' duration='33:32 min'>
  <depth max='50.0 m' mean='26.703 m' />
  <surface pressure='1.013 bar' />
  <cylinder />
  <cylinder o2='40.0%' />
  <cylinder o2='80.0%' />
  <divecomputer model='Simulated Dive'>
  <event time='20:13 min' type='11' value='40' name='gaschange' />
  <event time='23:26 min' type='11' value='80' name='gaschange' />
  <sample time='8:00 min' depth='50.0 m' />
  <sample time='18:00 min' depth='50.0 m' />
  <sample time='18:13 min' depth='48.0 m' />
  <sample time='18:33 min' depth='45.0 m' />
  <sample time='18:53 min' depth='42.0 m' />
  <sample time='19:13 min' depth='39.0 m' />
  <sample time='19:33 min' depth='36.0 m' />
  <sample time='19:53 min' depth='33.0 m' />
  <sample time='20:13 min' depth='30.0 m' />
  <sample time='20:33 min' depth='27.0 m' />
  <sample time='20:53 min' depth='24.0 m' />
  <sample time='21:13 min' depth='21.0 m' />
  <sample time='21:33 min' depth='18.0 m' />
  <sample time='21:53 min' depth='15.0 m' />
  <sample time='22:13 min' depth='12.0 m' />
  <sample time='23:13 min' depth='12.0 m' />
  <sample time='23:26 min' depth='10.0 m' />
  <sample time='23:32 min' depth='9.0 m' />
  <sample time='25:32 min' depth='9.0 m' />
  <sample time='25:52 min' depth='6.0 m' />
  <sample time='27:52 min' depth='6.0 m' />
  <sample time='28:12 min' depth='3.0 m' />
  <sample time='33:12 min' depth='3.0 m' />
  <sample time='33:32 min' depth='0.0 m' />
  <sample time='33:32 min' depth='0.0 m' />
  </divecomputer>
</dive>
</dives>
</divelog>

Yes, there are lots of waypoints in there that aren't stops. Not trying
to cull the redundant ones made the algorithm a bit simpler and I don't
think they do any harm...

Play with the gases, surface pressure, depth and see how things change.

There's still more work to do:

- gas planning based on SAC rate
- ability to adjust the ascent speed
- ability to give a desired pO2 instead of a change depth for the gas
- CC support...

But I think this now is indeed already useful.


/D


More information about the subsurface mailing list