mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive computer import improvements
Parse dive computer information or divelog generator information and include it as divecomputerid and divecomputer as appropriate. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e89c2fd656
commit
aa02798e2a
3 changed files with 43 additions and 19 deletions
|
@ -5,12 +5,30 @@
|
|||
|
||||
<xsl:template match="/">
|
||||
<divelog program="subsurface" version="2">
|
||||
<settings>
|
||||
<divecomputerid deviceid="ffffffff">
|
||||
<xsl:apply-templates select="/PROFILE/DEVICE|/profile/device"/>
|
||||
</divecomputerid>
|
||||
</settings>
|
||||
<dives>
|
||||
<xsl:apply-templates select="/PROFILE/REPGROUP/DIVE|/profile/repgroup/dive"/>
|
||||
</dives>
|
||||
</divelog>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="DEVICE|device">
|
||||
<xsl:if test="MODEL|model != ''">
|
||||
<xsl:attribute name="model">
|
||||
<xsl:value-of select="MODEL|model"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="version|VERSION != ''">
|
||||
<xsl:attribute name="serial">
|
||||
<xsl:value-of select="VERSION|version"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="DIVE|dive">
|
||||
<dive>
|
||||
<xsl:attribute name="date">
|
||||
|
@ -39,6 +57,12 @@
|
|||
</temperature>
|
||||
</xsl:if>
|
||||
|
||||
<divecomputer deviceid="ffffffff">
|
||||
<xsl:attribute name="model">
|
||||
<xsl:value-of select="/PROFILE/DEVICE/MODEL|/profile/device/model"/>
|
||||
</xsl:attribute>
|
||||
</divecomputer>
|
||||
|
||||
<xsl:for-each select="GASES/MIX|gases/mix">
|
||||
<cylinder>
|
||||
<xsl:attribute name="description">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue