Merge branch 'testdata' of git://github.com/dirkhh/subsurface

* 'testdata' of git://github.com/dirkhh/subsurface:
  Correctly plot dives ending below the surface
This commit is contained in:
Linus Torvalds 2011-11-09 12:31:06 -06:00
commit d03a92728f
9 changed files with 54 additions and 11 deletions

View file

@ -2,6 +2,7 @@
<program name='subsurface' version='1'></program> <program name='subsurface' version='1'></program>
<dive number='1' date='2011-01-01' time='09:00:00' duration='30:00 min'> <dive number='1' date='2011-01-01' time='09:00:00' duration='30:00 min'>
<depth max='30.00 m' mean='15.00 m' /> <depth max='30.00 m' mean='15.00 m' />
<location>Second test dive, this one with location</location> <location>First test dive, this one with location</location>
<notes>Yes, the previous dive is dive 0, that one with no location.</notes>
</dive> </dive>
</dives> </dives>

View file

@ -3,7 +3,7 @@
<dive number='11' date='2011-01-01' time='19:00:00' duration='30:00 min'> <dive number='11' date='2011-01-01' time='19:00:00' duration='30:00 min'>
<depth max='30.0 m' mean='15.0 m' /> <depth max='30.0 m' mean='15.0 m' />
<temperature air='27.0 C' water='26.0 C' /> <temperature air='27.0 C' water='26.0 C' />
<location>10th test dive, 3 tanks, 2 tank changes</location> <location>11th test dive, 3 tanks, 2 tank changes</location>
<notes>Shows three pressure plots, each from 200 to 100bar and gaschange events at 10 and 20 min mark.</notes> <notes>Shows three pressure plots, each from 200 to 100bar and gaschange events at 10 and 20 min mark.</notes>
<cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />
<cylinder o2='50.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='50.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />

View file

@ -3,7 +3,7 @@
<dive number='12' date='2011-01-01' time='20:00:00' duration='30:00 min'> <dive number='12' date='2011-01-01' time='20:00:00' duration='30:00 min'>
<depth max='30.0 m' mean='15.0 m' /> <depth max='30.0 m' mean='15.0 m' />
<temperature air='27.0 C' water='26.0 C' /> <temperature air='27.0 C' water='26.0 C' />
<location>10th test dive, 3 tanks, 3 tank changes</location> <location>12th test dive, 3 tanks, 3 tank changes</location>
<notes>Shows three pressure plots, each from 200 to 100bar and gaschange events at 10, 20 and 25 min mark. Last change is back to first tank.</notes> <notes>Shows three pressure plots, each from 200 to 100bar and gaschange events at 10, 20 and 25 min mark. Last change is back to first tank.</notes>
<cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />
<cylinder o2='50.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='50.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />

View file

@ -3,7 +3,7 @@
<dive number='13' date='2011-01-01' time='21:00:00' duration='30:00 min'> <dive number='13' date='2011-01-01' time='21:00:00' duration='30:00 min'>
<depth max='30.0 m' mean='15.0 m' /> <depth max='30.0 m' mean='15.0 m' />
<temperature air='27.0 C' water='26.0 C' /> <temperature air='27.0 C' water='26.0 C' />
<location>10th test dive, 3 tanks, 3 tank changes</location> <location>13th test dive, 3 tanks, 3 tank changes</location>
<notes>Shows three pressure plots, each from 200 to 100bar and gaschange events at 10, 20 and 25 min mark. Last change is back to first tank <notes>Shows three pressure plots, each from 200 to 100bar and gaschange events at 10, 20 and 25 min mark. Last change is back to first tank
Now with samples. We have a sample at the first tank change but not the 2nd and 3rd</notes> Now with samples. We have a sample at the first tank change but not the 2nd and 3rd</notes>
<cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />

39
dives/test14.xml Normal file
View file

@ -0,0 +1,39 @@
<dives>
<program name='subsurface' version='1'></program>
<dive number='14' date='2011-01-01' time='22:00:00' duration='30:00 min'>
<depth max='30.0 m' mean='15.0 m' />
<temperature air='27.0 C' water='26.0 C' />
<location>14th test dive - no depth 0 samples</location>
<notes>This should show 1m depth at the 30min mark and then a tick up to the surface 20sec later</notes>
<sample time='1:00 min' temp='27.0 C' depth='5 m' />
<sample time='2:00 min' temp='26.0 C' depth='10 m' />
<sample time='3:00 min' temp='25.0 C' depth='15 m' />
<sample time='4:00 min' temp='24.0 C' depth='20 m' />
<sample time='5:00 min' temp='24.0 C' depth='25 m' />
<sample time='6:00 min' temp='23.0 C' depth='30 m' />
<sample time='7:00 min' depth='30 m' />
<sample time='8:00 min' depth='30 m' />
<sample time='9:00 min' depth='30 m' />
<sample time='10:00 min' depth='30 m' />
<sample time='11:00 min' depth='30 m' />
<sample time='12:00 min' depth='30 m' />
<sample time='13:00 min' depth='30 m' />
<sample time='14:00 min' temp='26.0 C' depth='10 m' />
<sample time='15:00 min' depth='15 m' />
<sample time='16:00 min' depth='5 m' />
<sample time='17:00 min' depth='10 m' />
<sample time='18:00 min' depth='10 m' />
<sample time='19:00 min' depth='10 m' />
<sample time='20:00 min' depth='10 m' />
<sample time='21:00 min' depth='10 m' />
<sample time='22:00 min' depth='5 m' />
<sample time='23:00 min' depth='5 m' />
<sample time='24:00 min' depth='5 m' />
<sample time='25:00 min' depth='5 m' />
<sample time='26:00 min' depth='5 m' />
<sample time='27:00 min' depth='5 m' />
<sample time='28:00 min' temp='26.0 C' depth='5 m' />
<sample time='29:00 min' temp='26.5 C' depth='2.5 m' />
<sample time='30:00 min' temp='26.0 C' depth='1 m' />
</dive>
</dives>

View file

@ -2,7 +2,7 @@
<program name='subsurface' version='1'></program> <program name='subsurface' version='1'></program>
<dive number='2' date='2011-01-01' time='10:00:00' duration='30:00 min'> <dive number='2' date='2011-01-01' time='10:00:00' duration='30:00 min'>
<depth max='30.00 m' mean='15.00 m' /> <depth max='30.00 m' mean='15.00 m' />
<location>3rd test dive, add cylinder with no start/end pressure</location> <location>2nd test dive, add cylinder with no start/end pressure</location>
<cylinder size='9.987 l' workpressure='206.843 bar' description='AL72' /> <cylinder size='9.987 l' workpressure='206.843 bar' description='AL72' />
</dive> </dive>
</dives> </dives>

View file

@ -3,7 +3,7 @@
<dive number='4' date='2011-01-01' time='12:00:00' duration='30:00 min'> <dive number='4' date='2011-01-01' time='12:00:00' duration='30:00 min'>
<depth max='30.0 m' mean='15.0 m' /> <depth max='30.0 m' mean='15.0 m' />
<temperature air='27.0 C' water='26.0 C' /> <temperature air='27.0 C' water='26.0 C' />
<location>4rd test dive, add temp</location> <location>4th test dive, add temp</location>
<notes>SAC should be 0.46 cuft/min or 13.1 l/min</notes> <notes>SAC should be 0.46 cuft/min or 13.1 l/min</notes>
<cylinder size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />
</dive> </dive>

View file

@ -3,7 +3,7 @@
<dive number='9' date='2011-01-01' time='17:00:00' duration='30:00 min'> <dive number='9' date='2011-01-01' time='17:00:00' duration='30:00 min'>
<depth max='30.0 m' mean='15.0 m' /> <depth max='30.0 m' mean='15.0 m' />
<temperature air='27.0 C' water='26.0 C' /> <temperature air='27.0 C' water='26.0 C' />
<location>8th test dive, with temperature in samples</location> <location>9th test dive, with temperature in samples</location>
<notes>End temperature is not plotted as correct text</notes> <notes>End temperature is not plotted as correct text</notes>
<cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='33.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />
<cylinder o2='50.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' /> <cylinder o2='50.0%' size='9.987 l' workpressure='206.843 bar' description='AL72' start='200.0 bar' end='100.0 bar' />

View file

@ -1098,7 +1098,7 @@ static struct plot_info *create_plot_info(struct dive *dive, int nr_samples, str
entry->temperature = sample->temperature.mkelvin; entry->temperature = sample->temperature.mkelvin;
if (depth || lastdepth) if (depth || lastdepth)
lastindex = i+pi_idx; lastindex = i + pi_idx;
lastdepth = depth; lastdepth = depth;
if (depth > pi->maxdepth) if (depth > pi->maxdepth)
@ -1162,9 +1162,12 @@ static struct plot_info *create_plot_info(struct dive *dive, int nr_samples, str
i = nr + 2; i = nr + 2;
pi->entry[i].sec = sec + 20; pi->entry[i].sec = sec + 20;
pi->entry[i+1].sec = sec + 40; pi->entry[i+1].sec = sec + 40;
/* the number of actual entries - we may have allocated more if there /* the number of actual entries - some computers have lots of
* were gas change events, but this is how many were filled */ * depth 0 samples at the end of a dive, we want to make sure
* we have exactly one of them at the end */
pi->nr = lastindex+1; pi->nr = lastindex+1;
while (pi->nr <= i+2 && pi->entry[pi->nr-1].depth > 0)
pi->nr++;
pi->maxtime = pi->entry[lastindex].sec; pi->maxtime = pi->entry[lastindex].sec;
pi->endpressure = pi->minpressure = dive->cylinder[0].end.mbar; pi->endpressure = pi->minpressure = dive->cylinder[0].end.mbar;