subsurface/dives/sac-test.xml
Linus Torvalds 6d548d2028 Correctly calculate SAC rate in the presense of surface events
This assumes that you are not breathing your cylinders while at the
surface, which may or may not be correct, but is usually the right
thing.  Regardless, we're better off giving a conservative (higher) SAC
rate estimate for a diver that breathes his cylinder at the surface too
than giving an artificially low one because the diver ended up using his
snorkel and we didn't take that into account.

NOTE! This basically calculates a better duration and average depth than
the ones we end up showing in the dive list.  Maybe we should actually
show this "no-surface-time" duration and average depth instead of the
ones we do show?

That's a separate question, though.

Added a test-case for the surface case to the sac-test.xml dives.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 11:09:52 -08:00

69 lines
2.9 KiB
XML

<divelog program='subsurface' version='2'>
<settings>
</settings>
<dives>
<dive number='1' date='2013-02-24' time='09:26:04' duration='25:00 min'>
<location>SAC test dive 1</location>
<notes>SAC should be 20l/min (0.7063 cuft/min)
We have exactly 100 ATM of gas in a 10l cylinder, average 10m for 25min</notes>
<cylinder size='10 l' description='10l' start='202.6 bar' end='101.3 bar' />
<divecomputer>
<depth max='10.0 m' mean='10.0 m' />
<sample time='0:00 min' depth='10.0 m' />
<sample time='5:00 min' depth='10.0 m' />
<sample time='10:00 min' depth='10.0 m' />
<sample time='15:00 min' depth='10.0 m' />
<sample time='20:00 min' depth='10.0 m' />
<sample time='25:00 min' depth='10.0 m' />
</divecomputer>
</dive>
<dive number='2' date='2013-02-24' time='10:26:04' duration='25:00 min'>
<location>SAC test dive 2</location>
<notes>SAC should be 20l/min (0.7063 cuft/min)
We have exactly 100 ATM of gas in a 10l cylinder, average 10m for 25min</notes>
<cylinder size='10 l' description='10l' start='202.6 bar' end='101.3 bar' />
<divecomputer>
<depth max='20.0 m' mean='10.0 m' />
<sample time='0:00 min' depth='0.0 m' />
<sample time='12:30 min' depth='20.0 m' />
<sample time='25:00 min' depth='0.0 m' />
</divecomputer>
</dive>
<dive number='3' date='2013-02-24' time='11:26:04' duration='25:00 min'>
<location>SAC test dive 3</location>
<notes>SAC should be 20l/min (0.7063 cuft/min)
We have exactly 100 ATM of gas in 15l of cylinder, average 20m for 25min</notes>
<cylinder size='10 l' description='10l' start='202.6 bar' end='101.3 bar' />
<cylinder size='5 l' description='10l' start='202.6 bar' end='101.3 bar' />
<divecomputer>
<event time='17:00 min' name='gaschange' />
<depth max='20.0 m' mean='10.0 m' />
<sample time='0:00 min' depth='0.0 m' />
<sample time='5:00 min' depth='20.0 m' />
<sample time='10:00 min' depth='40.0 m' />
<sample time='15:00 min' depth='0.0 m' />
<sample time='20:00 min' depth='40.0 m' />
<sample time='25:00 min' depth='0.0 m' />
</divecomputer>
</dive>
<dive number='4' date='2013-02-24' time='12:26:04' duration='25:00 min'>
<location>SAC test dive 3</location>
<notes>SAC should be 20l/min (0.7063 cuft/min)
This adds a 5-minute surface time to the middle of the dive.
We have exactly 100 ATM of gas in 15l of cylinder, average 20m for 25min</notes>
<cylinder size='10 l' description='10l' start='202.6 bar' end='101.3 bar' />
<cylinder size='5 l' description='10l' start='202.6 bar' end='101.3 bar' />
<divecomputer>
<event time='22:00 min' name='gaschange' />
<depth max='20.0 m' mean='10.0 m' />
<sample time='0:00 min' depth='0.0 m' />
<sample time='5:00 min' depth='20.0 m' />
<sample time='10:00 min' depth='40.0 m' />
<sample time='15:00 min' depth='0.0 m' />
<sample time='20:00 min' depth='0.0 m' />
<sample time='25:00 min' depth='40.0 m' />
<sample time='30:00 min' depth='0.0 m' />
</divecomputer>
</dive>
</dives>
</divelog>