Sanitize and fix cylinder pressure overview

Doing per-dive cylinder start/end pressures is insane, when we can have
up to eight cylinders.  The cylinder start/end pressure cannot be per
dive, it needs to be per cylinder.

This makes the save format cleaner too, we have all the cylinder data in
just one place.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2011-09-05 09:12:54 -07:00
parent 0f832f15d1
commit 5f79a804b9
5 changed files with 40 additions and 29 deletions

View file

@ -645,9 +645,9 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
return;
if (MATCH(".watertemp", temperature, &dive->watertemp))
return;
if (MATCH(".cylinderstartpressure", pressure, &dive->beginning_pressure))
if (MATCH(".cylinderstartpressure", pressure, &dive->cylinder[0].start))
return;
if (MATCH(".cylinderendpressure", pressure, &dive->end_pressure))
if (MATCH(".cylinderendpressure", pressure, &dive->cylinder[0].end))
return;
if (MATCH(".location", utf8_string, &dive->location))
return;
@ -660,6 +660,10 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
return;
if (MATCH(".cylinder.description", utf8_string, &dive->cylinder[cylinder_index].type.description))
return;
if (MATCH(".cylinder.start", pressure, &dive->cylinder[cylinder_index].start))
return;
if (MATCH(".cylinder.end", pressure, &dive->cylinder[cylinder_index].end))
return;
if (MATCH(".o2", gasmix, &dive->cylinder[cylinder_index].gasmix.o2))
return;