summaryrefslogtreecommitdiffstats
path: root/xslt/uddf.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-12-10 08:18:53 +0200
committerGravatar mturkia <miika.turkia@gmail.com>2017-12-10 11:29:52 +0200
commit38cc8bdc40af408afb7904710d4db90eff20376e (patch)
tree3a5062f289869f7bf63ac84a906d104ff232e344 /xslt/uddf.xslt
parent5c8ad329f52b1a84f0c61b5c36fd252dd5fdac0a (diff)
downloadsubsurface-38cc8bdc40af408afb7904710d4db90eff20376e.tar.gz
Support dctype/divemode on UDDF import
This will grab the divemode information from the first waypoint within the dive that includes this info and uses it for dctype. Note that our dive type is not as fine grained as the one in UDDF. The latter allows one to switch divemode during the dive when we do not. However, one could argue that i.e. a rebreather dive should be a rebreather dive even if one switches to bailout gas at some point... Fixes #922 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/uddf.xslt')
-rw-r--r--xslt/uddf.xslt21
1 files changed, 21 insertions, 0 deletions
diff --git a/xslt/uddf.xslt b/xslt/uddf.xslt
index e5c0f33f1..912b0f4d3 100644
--- a/xslt/uddf.xslt
+++ b/xslt/uddf.xslt
@@ -359,6 +359,27 @@
</xsl:choose>
</xsl:attribute>
+ <!-- Divemode -->
+ <xsl:if test="samples/waypoint/divemode/@type|u:samples/u:waypoint/u:divemode/@type|u1:samples/u1:waypoint/u1:divemode/@type != ''">
+ <xsl:attribute name='dctype'>
+ <xsl:choose>
+ <xsl:when test="samples/waypoint/divemode/@type|u:samples/u:waypoint/u:divemode/@type|u1:samples/u1:waypoint/u1:divemode/@type = 'apnoe'
+ or samples/waypoint/divemode/@type|u:samples/u:waypoint/u:divemode/@type|u1:samples/u1:waypoint/u1:divemode/@type = 'apnea'">
+ <xsl:text>Freedive</xsl:text>
+ </xsl:when>
+ <xsl:when test="samples/waypoint/divemode/@type|u:samples/u:waypoint/u:divemode/@type|u1:samples/u1:waypoint/u1:divemode/@type = 'closedcircuit'">
+ <xsl:text>CCR</xsl:text>
+ </xsl:when>
+ <xsl:when test="samples/waypoint/divemode/@type|u:samples/u:waypoint/u:divemode/@type|u1:samples/u1:waypoint/u1:divemode/@type = 'semiclosedcircuit'">
+ <xsl:text>PSCR</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>OC</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+
<depth>
<xsl:for-each select="greatestdepth|informationafterdive/greatestdepth|u:greatestdepth|u:informationafterdive/u:greatestdepth|u1:greatestdepth|u1:informationafterdive/u1:greatestdepth|max_depth">
<xsl:attribute name="max">