diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-04 11:23:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-04 11:34:44 -0700 |
commit | ecff0922d43edeb361769755d49e84d1b02caa90 (patch) | |
tree | ec90530d92e5de00e570367bcbd27f90dda4db01 /save-xml.c | |
parent | 9961c7f89ce6353609383b16b9fbf3a30e4d8604 (diff) | |
download | subsurface-ecff0922d43edeb361769755d49e84d1b02caa90.tar.gz |
Don't save cylinder working pressure
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>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/save-xml.c b/save-xml.c index 5c05723b7..c33cbb0dd 100644 --- a/save-xml.c +++ b/save-xml.c @@ -127,7 +127,6 @@ 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; - int pressure = cylinder->type.workingpressure.mbar; int o2 = cylinder->gasmix.o2.permille; int he = cylinder->gasmix.he.permille; @@ -140,11 +139,8 @@ static void save_cylinder_info(FILE *f, struct dive *dive) 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"); } } |