Export only used cylinders to divelogs.de

This attempts to export only used cylinders to divelogs.de. The
detection is based only on o2 percentage as per our test dives. However,
the new cylinder id would be better, but that does not exist on old
dives.

Fixes #757

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2014-12-13 15:12:37 +02:00 committed by Dirk Hohndel
parent 3c9c1ec06f
commit aa76bbaa97

View file

@ -109,6 +109,17 @@
<ADDITIONALTANKS>
<xsl:for-each select="cylinder[position() != $cylinder]">
<xsl:variable name="gas">
<xsl:choose>
<xsl:when test="@o2 != ''">
<xsl:value-of select="substring-before(@o2, '.')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'21'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="following-sibling::divecomputer/event[@name='gaschange' and @value=$gas]">
<xsl:variable name="cur_cyl">
<xsl:value-of select="position()"/>
</xsl:variable>
@ -147,6 +158,7 @@
<xsl:value-of select="substring-before(@he, '%')"/>
</HEPCT>
</TANK>
</xsl:if>
</xsl:for-each>
</ADDITIONALTANKS>