Samples should be inside divecomputer on Shearwater import

Data read from a divecomputer is moved inside the divecomputer tag

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2014-12-07 10:40:25 +02:00 committed by Dirk Hohndel
parent 4dc99a0b56
commit b03423dd96

View file

@ -67,15 +67,6 @@
</xsl:attribute> </xsl:attribute>
</surface> </surface>
<divecomputer>
<xsl:attribute name="model">
<xsl:value-of select="'Shearwater'"/>
</xsl:attribute>
<xsl:attribute name="deviceid">
<xsl:value-of select="computerSerial"/>
</xsl:attribute>
</divecomputer>
<xsl:for-each select="diveLogRecords/diveLogRecord[generate-id() = generate-id(key('gases', concat(fractionO2, '/', fractionHe))[1])]"> <xsl:for-each select="diveLogRecords/diveLogRecord[generate-id() = generate-id(key('gases', concat(fractionO2, '/', fractionHe))[1])]">
<xsl:if test="currentCircuitSetting = 1"> <xsl:if test="currentCircuitSetting = 1">
<cylinder> <cylinder>
@ -94,49 +85,58 @@
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="diveLogRecords/diveLogRecord"> <divecomputer>
<sample> <xsl:attribute name="model">
<xsl:attribute name="time"> <xsl:value-of select="'Shearwater'"/>
<xsl:call-template name="sec2time"> </xsl:attribute>
<xsl:with-param name="timeSec"> <xsl:attribute name="deviceid">
<xsl:value-of select="currentTime"/> <xsl:value-of select="computerSerial"/>
</xsl:with-param> </xsl:attribute>
</xsl:call-template>
</xsl:attribute> <xsl:for-each select="diveLogRecords/diveLogRecord">
<xsl:attribute name="depth"> <sample>
<xsl:choose> <xsl:attribute name="time">
<xsl:when test="$units = 'imperial'"> <xsl:call-template name="sec2time">
<xsl:value-of select="format-number(currentDepth * 0.3048, '0.00')"/> <xsl:with-param name="timeSec">
</xsl:when> <xsl:value-of select="currentTime"/>
<xsl:otherwise> </xsl:with-param>
<xsl:value-of select="currentDepth"/> </xsl:call-template>
</xsl:otherwise> </xsl:attribute>
</xsl:choose> <xsl:attribute name="depth">
</xsl:attribute>
<xsl:attribute name="temp">
<xsl:choose>
<xsl:when test="$units = 'imperial'">
<xsl:value-of select="concat(format-number((waterTemp - 32) * 5 div 9, '0.0'), ' C')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="waterTemp"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="currentCircuitSetting = 0">
<xsl:attribute name="po2">
<xsl:choose> <xsl:choose>
<xsl:when test="$units = 'imperial'"> <xsl:when test="$units = 'imperial'">
<xsl:value-of select="concat(averagePPO2 div 14.5037738, ' bar')"/> <xsl:value-of select="format-number(currentDepth * 0.3048, '0.00')"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="concat(averagePPO2, ' bar')"/> <xsl:value-of select="currentDepth"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
</xsl:if> <xsl:attribute name="temp">
</sample> <xsl:choose>
</xsl:for-each> <xsl:when test="$units = 'imperial'">
<xsl:value-of select="concat(format-number((waterTemp - 32) * 5 div 9, '0.0'), ' C')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="waterTemp"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="currentCircuitSetting = 0">
<xsl:attribute name="po2">
<xsl:choose>
<xsl:when test="$units = 'imperial'">
<xsl:value-of select="concat(averagePPO2 div 14.5037738, ' bar')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(averagePPO2, ' bar')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
</sample>
</xsl:for-each>
</divecomputer>
</dive> </dive>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>