Make a guess at the cylinder description from the size and pressure

I'll want to also add a way to override/set the cylinder type: both
manually by just setting a size in liters, and by picking from some list
of standard cylinder sizes.

For example, it looks like most of my dives are marked as having
12-liter cylinders.  That is probably some default from Suunto Dive
Manager, or from whatever Dirk did.  It's almost certainly not right for
any of them: as far as I know, the standard cylinders for Lahaina Divers
(which is likely most of the warm water dives) are AL72's for air, and
AL80's for Nitrox.

That would be a 10L and a 11.1L tank respectively, afaik.  I don't know
what a 12-liter tank would be or where that size comes from.

Anyway, the LP85+ tank designation for some of the dives looks more
likely: that's one of the common sizes I've used for local dives.  So
the size of that thing is much more probably correct.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2011-09-04 13:34:22 -07:00
parent f448b68de0
commit f8de487c2f
2 changed files with 62 additions and 10 deletions

View file

@ -127,6 +127,7 @@ static void save_cylinder_info(FILE *f, struct dive *dive)
for (i = 0; i < MAX_CYLINDERS; i++) {
cylinder_t *cylinder = dive->cylinder+i;
int volume = cylinder->type.size.mliter;
const char *description = cylinder->type.description;
int o2 = cylinder->gasmix.o2.permille;
int he = cylinder->gasmix.he.permille;
@ -141,6 +142,8 @@ static void save_cylinder_info(FILE *f, struct dive *dive)
}
if (volume)
fprintf(f, " size='%u.%03u l'", FRACTION(volume, 1000));
if (description)
fprintf(f, " name='%s'", description);
fprintf(f, " />\n");
}
}