It was a mistake to save it - and I did it just because other dive
managers did. It's a totally nonsensical measure, and nobody cares.
The only thing that matters is the size of the cylinder, and the
*actual* pressures. Those give actual air consumption numbers, and are
meaningful and unambiguous.
So the "working pressure" for a cylinder is pointless except for two
things:
- if you don't know the actual physical size, you need the "working
pressure" along with the air size (eg "85 cuft") in order to compute
the physical size. So we do use the working pressure on *input* from
systems that report cylinder sizes that way.
- People may well want to know what kind of cylinder they were diving,
and again, you can make a good guess about this from the working
pressure. So saving information like "HP100+" for the cylinder would
be a good thing.
But notice how in neither case do we actually want to save the working
pressure itself. And in fact saving it actually makes the output format
ambiguous: if we give both size and working pressure, what does 'size'
mean? Is it physical size in liters, or air size in cu ft?
So saving working pressure is just wrong. Get rid of it.
I'm going to add some kind of "cylinder description" thing, which we can
save instead (and perhaps guess standard cylinders from input like the
working pressure from dive logs that don't do this sanely - which is all
of them, as far as I can tell).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
for (i = 0; i < MAX_CYLINDERS; i++) {
cylinder_t *cylinder = dive->cylinder+i;
int volume = cylinder->type.size.mliter;
- int pressure = cylinder->type.workingpressure.mbar;
int o2 = cylinder->gasmix.o2.permille;
int he = cylinder->gasmix.he.permille;
if (he)
fprintf(f, " he='%u.%u%%'", FRACTION(he, 10));
}
- if (volume) {
+ if (volume)
fprintf(f, " size='%u.%03u l'", FRACTION(volume, 1000));
- if (pressure)
- fprintf(f, " workpressure='%u.%03u bar'", FRACTION(pressure, 1000));
- }
fprintf(f, " />\n");
}
}