summaryrefslogtreecommitdiffstats
path: root/xslt/shearwater.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-12-07 08:48:14 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-07 09:45:58 -0600
commit4dc99a0b568ac04158e11f8448f03b692cb3c341 (patch)
tree169f9955321bf64be6030a30515e9924a318d27d /xslt/shearwater.xslt
parentd7d5c296ddd80a4e2818920de35c22c63dbe7017 (diff)
downloadsubsurface-4dc99a0b568ac04158e11f8448f03b692cb3c341.tar.gz
Add cylinder support for Shearwater XML import
This tries to grab the used cylinders when in open circuit mode. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/shearwater.xslt')
-rw-r--r--xslt/shearwater.xslt20
1 files changed, 20 insertions, 0 deletions
diff --git a/xslt/shearwater.xslt b/xslt/shearwater.xslt
index 2bbe5643d..0c655ade0 100644
--- a/xslt/shearwater.xslt
+++ b/xslt/shearwater.xslt
@@ -3,6 +3,8 @@
<xsl:output method="xml" indent="yes"/>
<xsl:include href="commonTemplates.xsl"/>
+ <xsl:key name="gases" match="diveLogRecord" use="concat(fractionO2, '/', fractionHe)" />
+
<xsl:template match="/">
<divelog program='subsurface-import' version='2'>
<dives>
@@ -74,6 +76,24 @@
</xsl:attribute>
</divecomputer>
+ <xsl:for-each select="diveLogRecords/diveLogRecord[generate-id() = generate-id(key('gases', concat(fractionO2, '/', fractionHe))[1])]">
+ <xsl:if test="currentCircuitSetting = 1">
+ <cylinder>
+ <xsl:attribute name="description">
+ <xsl:value-of select="concat(fractionO2 * 100, '/', fractionHe * 100)"/>
+ </xsl:attribute>
+ <xsl:attribute name="o2">
+ <xsl:value-of select="concat(fractionO2 * 100, '%')"/>
+ </xsl:attribute>
+ <xsl:if test="fractionHe != 0">
+ <xsl:attribute name="he">
+ <xsl:value-of select="concat(fractionHe * 100, '%')"/>
+ </xsl:attribute>
+ </xsl:if>
+ </cylinder>
+ </xsl:if>
+ </xsl:for-each>
+
<xsl:for-each select="diveLogRecords/diveLogRecord">
<sample>
<xsl:attribute name="time">