mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Support for multiple cylinders on UDDF export
Adding support for multiple cylinders on UDDF export. This also adds a cylinder reference to the tankdata to enable mix lookups. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
683227d2aa
commit
16d7f5e86e
1 changed files with 46 additions and 31 deletions
|
@ -359,43 +359,58 @@
|
|||
</xsl:for-each>
|
||||
</samples>
|
||||
|
||||
<tankdata>
|
||||
<xsl:if test="cylinder[1]/@size">
|
||||
<tankvolume>
|
||||
<xsl:value-of select="substring-before(cylinder[1]/@size, ' ')"/>
|
||||
</tankvolume>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="divecomputer[1]/sample/@pressure != ''">
|
||||
<tankpressurebegin>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample/@pressure[1], ' ') * 100000"/>
|
||||
</tankpressurebegin>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="cylinder[1]/@start">
|
||||
<xsl:for-each select="cylinder">
|
||||
<tankdata>
|
||||
<link>
|
||||
<xsl:attribute name="ref">
|
||||
<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:attribute>
|
||||
</link>
|
||||
|
||||
<xsl:if test="@size">
|
||||
<tankvolume>
|
||||
<xsl:value-of select="substring-before(@size, ' ')"/>
|
||||
</tankvolume>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="divecomputer[1]/sample/@pressure != ''">
|
||||
<tankpressurebegin>
|
||||
<xsl:value-of select="substring-before(cylinder[1]/@start, ' ') * 100000"/>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample/@pressure[1], ' ') * 100000"/>
|
||||
</tankpressurebegin>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="@start">
|
||||
<tankpressurebegin>
|
||||
<xsl:value-of select="substring-before(@start, ' ') * 100000"/>
|
||||
</tankpressurebegin>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(divecomputer[1]/sample[@pressure]) > 0">
|
||||
<tankpressureend>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
|
||||
</tankpressureend>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="cylinder[1]/@end">
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(divecomputer[1]/sample[@pressure]) > 0">
|
||||
<tankpressureend>
|
||||
<xsl:value-of select="substring-before(cylinder[1]/@end, ' ') * 100000"/>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
|
||||
</tankpressureend>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="@end">
|
||||
<tankpressureend>
|
||||
<xsl:value-of select="substring-before(@end, ' ') * 100000"/>
|
||||
</tankpressureend>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</tankdata>
|
||||
</tankdata>
|
||||
</xsl:for-each>
|
||||
|
||||
<informationafterdive>
|
||||
<xsl:if test="node()/depth/@max != ''">
|
||||
|
|
Loading…
Reference in a new issue