mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5c8ad329f5
commit
38cc8bdc40
1 changed files with 21 additions and 0 deletions
|
@ -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">
|
||||
|
|
Loading…
Add table
Reference in a new issue