mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:03:24 +00:00
Fix bug in tankpressurebegin in UDDF export
There was a bug when the first sample doesn't contain pressure info. This fixes that by selecting the first with pressure info. Signed-off-by: Martin Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6c891c02e5
commit
5a3b010586
1 changed files with 13 additions and 16 deletions
|
@ -475,37 +475,34 @@
|
|||
</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(divecomputer[1]/sample/@pressure[1], ' ') * 100000"/>
|
||||
</tankpressurebegin>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="@start">
|
||||
<xsl:when test="@start">
|
||||
<tankpressurebegin>
|
||||
<xsl:value-of select="substring-before(@start, ' ') * 100000"/>
|
||||
</tankpressurebegin>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<tankpressurebegin>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure]/@pressure[1], ' ') * 100000"/>
|
||||
</tankpressurebegin>
|
||||
</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="@end">
|
||||
<xsl:when test="@end">
|
||||
<tankpressureend>
|
||||
<xsl:value-of select="substring-before(@end, ' ') * 100000"/>
|
||||
</tankpressureend>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<tankpressureend>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
|
||||
</tankpressureend>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue