summaryrefslogtreecommitdiffstats
path: root/xslt/divelogs-export.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-10-12 22:19:26 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-12 15:48:27 -0400
commit8ae5b816bd343a0cd2d447ac0067d50f8aa4cfbf (patch)
treed8e9b278cb07834110b23086851d6bb73cc5089a /xslt/divelogs-export.xslt
parentbc9df4652ffe0cc9d6f579bfd66a4857be57d3b2 (diff)
downloadsubsurface-8ae5b816bd343a0cd2d447ac0067d50f8aa4cfbf.tar.gz
Export additional tanks to divelogs.de
All recorded cylinders are exported to divelogs.de. This potentially includes cylinders that have not been used. The start and end pressure for additional cylinders is taken from the cylinder information. Main tank gets this information from first and last pressure reading or from the cylinder information if samples are not available. This should be ok when there is only one cylinder with pressure sensor, but does not probably work for people having multiple sensors. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/divelogs-export.xslt')
-rw-r--r--xslt/divelogs-export.xslt46
1 files changed, 46 insertions, 0 deletions
diff --git a/xslt/divelogs-export.xslt b/xslt/divelogs-export.xslt
index ec39ba243..b3b8dfa5e 100644
--- a/xslt/divelogs-export.xslt
+++ b/xslt/divelogs-export.xslt
@@ -107,6 +107,49 @@
</xsl:choose>
</CYLINDERENDPRESSURE>
+ <ADDITIONALTANKS>
+ <xsl:for-each select="cylinder[position() != $cylinder]">
+ <xsl:variable name="cur_cyl">
+ <xsl:value-of select="position()"/>
+ </xsl:variable>
+
+ <TANK>
+ <CYLINDERDESCRIPTION>
+ <xsl:value-of select="@description"/>
+ </CYLINDERDESCRIPTION>
+
+ <xsl:variable name="dbl">
+ <xsl:choose>
+ <xsl:when test="substring(@description, 1, 1) = 'D' and substring-before(substring(@description, 2), ' ') * 2 = substring-before(@size, ' ')">
+ <xsl:value-of select="'2'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'1'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <DBLTANK>
+ <xsl:value-of select="$dbl - 1"/>
+ </DBLTANK>
+ <CYLINDERSIZE>
+ <xsl:value-of select="substring-before(@size, ' ') div $dbl"/>
+ </CYLINDERSIZE>
+ <CYLINDERSTARTPRESSURE>
+ <xsl:value-of select="@start"/>
+ </CYLINDERSTARTPRESSURE>
+ <CYLINDERENDPRESSURE>
+ <xsl:value-of select="@end"/>
+ </CYLINDERENDPRESSURE>
+ <O2PCT>
+ <xsl:value-of select="substring-before(@o2, '%')"/>
+ </O2PCT>
+ <HEPCT>
+ <xsl:value-of select="substring-before(@he, '%')"/>
+ </HEPCT>
+ </TANK>
+ </xsl:for-each>
+ </ADDITIONALTANKS>
+
<WEIGHT>
<xsl:call-template name="sum">
<xsl:with-param name="values" select="weightsystem/@weight"/>
@@ -115,6 +158,9 @@
<O2PCT>
<xsl:value-of select="substring-before(cylinder[position() = $cylinder]/@o2, '%')"/>
</O2PCT>
+ <HEPCT>
+ <xsl:value-of select="substring-before(cylinder[position() = $cylinder]/@he, '%')"/>
+ </HEPCT>
<LOGNOTES>
<xsl:value-of select="notes"/>
</LOGNOTES>