mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Multi cylinder support for CSV export
Fixes #2830 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
19cdab52b3
commit
889f36a57c
1 changed files with 92 additions and 84 deletions
|
@ -38,6 +38,7 @@
|
|||
$fs)"/>
|
||||
|
||||
<!-- Print cylinder info according to the amount of cylinders in dive -->
|
||||
<xsl:for-each select="dive/cylinder">
|
||||
<xsl:value-of select="concat(
|
||||
'"cylinder size (cuft)"',
|
||||
$fs,
|
||||
|
@ -49,6 +50,7 @@
|
|||
$fs,
|
||||
'"he (%)"',
|
||||
$fs)"/>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- Print rest of the header -->
|
||||
<xsl:value-of select="concat(
|
||||
|
@ -98,6 +100,7 @@
|
|||
$fs)"/>
|
||||
|
||||
<!-- Print cylinder info according to the amount of cylinders in dive -->
|
||||
<xsl:for-each select="dive/cylinder">
|
||||
<xsl:value-of select="concat(
|
||||
'"cylinder size (l)"',
|
||||
$fs,
|
||||
|
@ -109,6 +112,7 @@
|
|||
$fs,
|
||||
'"he (%)"',
|
||||
$fs)"/>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- Print rest of the header -->
|
||||
<xsl:value-of select="concat(
|
||||
|
@ -225,19 +229,20 @@
|
|||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:for-each select="cylinder">
|
||||
<xsl:choose>
|
||||
<xsl:when test="cylinder[1]/@start|cylinder[1]/@end != ''">
|
||||
<xsl:apply-templates select="cylinder[1]"/>
|
||||
<xsl:when test="@start|@end != ''">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$fs"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$units = 1">
|
||||
<xsl:value-of select="concat(format-number((substring-before(cylinder[1]/@size, ' ') div 14.7 * 3000) * 0.035315, '#.#'), '')"/>
|
||||
<xsl:value-of select="concat(format-number((substring-before(@size, ' ') div 14.7 * 3000) * 0.035315, '#.#'), '')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="substring-before(cylinder[1]/@size, ' ')"/>
|
||||
<xsl:value-of select="substring-before(@size, ' ')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>"</xsl:text>
|
||||
|
@ -246,8 +251,8 @@
|
|||
<xsl:choose>
|
||||
<xsl:when test="$units = 1">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring-before(divecomputer[1]/sample[@pressure]/@pressure, ' ') > 0">
|
||||
<xsl:value-of select="concat(format-number((substring-before(divecomputer[1]/sample[@pressure]/@pressure, ' ') * 14.5037738007), '#'), '')"/>
|
||||
<xsl:when test="substring-before(../divecomputer[1]/sample[@pressure]/@pressure, ' ') > 0">
|
||||
<xsl:value-of select="concat(format-number((substring-before(../divecomputer[1]/sample[@pressure]/@pressure, ' ') * 14.5037738007), '#'), '')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="''"/>
|
||||
|
@ -255,7 +260,7 @@
|
|||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure]/@pressure, ' ')"/>
|
||||
<xsl:value-of select="substring-before(../divecomputer[1]/sample[@pressure]/@pressure, ' ')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>"</xsl:text>
|
||||
|
@ -264,8 +269,8 @@
|
|||
<xsl:choose>
|
||||
<xsl:when test="$units = 1">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') > 0">
|
||||
<xsl:value-of select="concat(format-number((substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 14.5037738007), '#'), '')"/>
|
||||
<xsl:when test="substring-before(../divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') > 0">
|
||||
<xsl:value-of select="concat(format-number((substring-before(../divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 14.5037738007), '#'), '')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="''"/>
|
||||
|
@ -273,20 +278,22 @@
|
|||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ')"/>
|
||||
<xsl:value-of select="substring-before(../divecomputer[1]/sample[@pressure][last()]/@pressure, ' ')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="$fs"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="substring-before(cylinder[1]/@o2, '%')"/>
|
||||
<xsl:value-of select="substring-before(@o2, '%')"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="$fs"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="substring-before(cylinder[1]/@he, '%')"/>
|
||||
<xsl:value-of select="substring-before(@he, '%')"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:choose>
|
||||
<!-- Old location format -->
|
||||
<xsl:when test="location != ''">
|
||||
|
@ -469,6 +476,7 @@
|
|||
<xsl:value-of select="substring-before(@he, '%')"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="location">
|
||||
<xsl:value-of select="$fs"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
|
|
Loading…
Add table
Reference in a new issue