summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-21 16:37:41 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-21 07:34:13 -0700
commit2fc54b68554a3a6499524cbe5dd53bad3d89567a (patch)
treee94237728f67756b39bbfff23d649ee8ad152ff6 /xslt
parent19b54dc9ef2944fd985976620d6542f4a8c88a1d (diff)
downloadsubsurface-2fc54b68554a3a6499524cbe5dd53bad3d89567a.tar.gz
Add setpoint support on CSV import (XSLT parsing)
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/csv2xml.xslt31
1 files changed, 22 insertions, 9 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 92542c246..c957421f9 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -15,6 +15,7 @@
<xsl:param name="ttsField" select="ttsField"/>
<xsl:param name="stopdepthField" select="stopdepthField"/>
<xsl:param name="pressureField" select="pressureField"/>
+ <xsl:param name="setpointField" select="setpointField"/>
<xsl:param name="date" select="date"/>
<xsl:param name="time" select="time"/>
<xsl:param name="units" select="units"/>
@@ -43,7 +44,7 @@
<xsl:value-of select="concat(substring($time, 2, 2), ':', substring($time, 4, 2))"/>
</xsl:attribute>
<divecomputer model="Imported from CSV" deviceid="ffffffff">
- <xsl:if test="$po2Field >= 0 or $o2sensor1Field >= 0 or $o2sensor2Field >= 0 or $o2sensor3Field >= 0">
+ <xsl:if test="$po2Field >= 0 or $setpointField >= 0 or $o2sensor1Field >= 0 or $o2sensor2Field >= 0 or $o2sensor3Field >= 0">
<xsl:attribute name="dctype">CCR</xsl:attribute>
<xsl:attribute name="no_o2sensors">
<xsl:copy-of select="number($o2sensor1Field >= 0) + number($o2sensor2Field >= 0) + number($o2sensor3Field >= 0)" />
@@ -200,14 +201,26 @@
</xsl:attribute>
</xsl:if>
- <xsl:if test="$po2Field >= 0">
- <xsl:attribute name="po2">
- <xsl:call-template name="getFieldByIndex">
- <xsl:with-param name="index" select="$po2Field"/>
- <xsl:with-param name="line" select="$line"/>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$setpointField >= 0">
+ <xsl:attribute name="po2">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$setpointField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$po2Field >= 0">
+ <xsl:attribute name="po2">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$po2Field"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:if test="$o2sensor1Field >= 0">
<xsl:attribute name="sensor1">