mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add cylinder support for Shearwater XML import
This tries to grab the used cylinders when in open circuit mode. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d7d5c296dd
commit
4dc99a0b56
1 changed files with 20 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
|||
<xsl:output method="xml" indent="yes"/>
|
||||
<xsl:include href="commonTemplates.xsl"/>
|
||||
|
||||
<xsl:key name="gases" match="diveLogRecord" use="concat(fractionO2, '/', fractionHe)" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<divelog program='subsurface-import' version='2'>
|
||||
<dives>
|
||||
|
@ -74,6 +76,24 @@
|
|||
</xsl:attribute>
|
||||
</divecomputer>
|
||||
|
||||
<xsl:for-each select="diveLogRecords/diveLogRecord[generate-id() = generate-id(key('gases', concat(fractionO2, '/', fractionHe))[1])]">
|
||||
<xsl:if test="currentCircuitSetting = 1">
|
||||
<cylinder>
|
||||
<xsl:attribute name="description">
|
||||
<xsl:value-of select="concat(fractionO2 * 100, '/', fractionHe * 100)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="o2">
|
||||
<xsl:value-of select="concat(fractionO2 * 100, '%')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:if test="fractionHe != 0">
|
||||
<xsl:attribute name="he">
|
||||
<xsl:value-of select="concat(fractionHe * 100, '%')"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</cylinder>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="diveLogRecords/diveLogRecord">
|
||||
<sample>
|
||||
<xsl:attribute name="time">
|
||||
|
|
Loading…
Add table
Reference in a new issue