summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-31 08:19:39 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-31 10:32:27 -0700
commit21d8d26da160e7480d663d518e1b9d6b1fee2394 (patch)
tree1f45ae5edcaefd6f518479fb4d043f4fddc2f029 /xslt
parent232001a1f55793ec3d6897a307497b3fa796540f (diff)
downloadsubsurface-21d8d26da160e7480d663d518e1b9d6b1fee2394.tar.gz
CSV import: imperial support for cylinder pressure
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/manualcsv2xml.xslt36
1 files changed, 28 insertions, 8 deletions
diff --git a/xslt/manualcsv2xml.xslt b/xslt/manualcsv2xml.xslt
index 769092664..cae2b62e1 100644
--- a/xslt/manualcsv2xml.xslt
+++ b/xslt/manualcsv2xml.xslt
@@ -272,18 +272,38 @@
</xsl:if>
<xsl:if test="$startpressureField &gt; 0">
<xsl:attribute name="start">
- <xsl:call-template name="getFieldByIndex">
- <xsl:with-param name="index" select="$startpressureField"/>
- <xsl:with-param name="line" select="$line"/>
- </xsl:call-template>
+ <xsl:variable name="start">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$startpressureField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$units = 0">
+ <xsl:value-of select="$start"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="format-number($start div 14.5037738, '#.###')"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:if test="$endpressureField &gt; 0">
<xsl:attribute name="end">
- <xsl:call-template name="getFieldByIndex">
- <xsl:with-param name="index" select="$endpressureField"/>
- <xsl:with-param name="line" select="$line"/>
- </xsl:call-template>
+ <xsl:variable name="end">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$endpressureField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$units = 0">
+ <xsl:value-of select="$end"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="format-number($end div 14.5037738, '#.###')"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:if test="$o2Field &gt; 0">