mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix more Suunto SDM xml conversion problems
Looking at the XML of the two dives Szymon Kosecki sent out to the subsurface list, I notice that our cylinder size conversion was wrong. It looks like CYLINDERUNITS is what determines whether the cylinder size is in metric (0) or imperial (1) units. Of course, if you gave a cylinder size in cuft and didn't give a working pressure, subsurface will just ignore the size as the random crap it is. We *could* default to a working pressure of 3000 psi, of course. This also picks up the CYLINDERDESCRIPTION value, although neither of Szymon's dives actually had any description. I need more SDE xml files to figure out how multi-cylinder dives look etc, but I think this gets most *simple* SDE files converted almost correctly now. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
12f2c2ed5c
commit
8a58dae3ae
1 changed files with 12 additions and 2 deletions
|
@ -86,10 +86,15 @@
|
|||
<xsl:value-of select="concat(HEPCT, '%')"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="CYLINDERDESCRIPTION != ''">
|
||||
<xsl:attribute name="description">
|
||||
<xsl:value-of select="CYLINDERDESCRIPTION"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="CYLINDERSIZE != ''">
|
||||
<xsl:attribute name="size">
|
||||
<xsl:choose>
|
||||
<xsl:when test="CYLINDERWORKPRESSURE = '0'">
|
||||
<xsl:when test="CYLINDERUNITS = '0'">
|
||||
<xsl:value-of select="concat(CYLINDERSIZE, ' l')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
@ -219,7 +224,12 @@
|
|||
<xsl:template name="cuft2l">
|
||||
<xsl:param name="size"/>
|
||||
<xsl:param name="pressure"/>
|
||||
<xsl:value-of select="concat(format-number((($size*28.3168466) div ($pressure div 1013.25)), '0.000'), ' l')" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="$pressure != '0'">
|
||||
<xsl:value-of select="concat(format-number((($size*28.3168466) div ($pressure div 1013.25)), '0.000'), ' l')" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>0</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!-- end cuft2l -->
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue