[PATCH] Treat headings properly when importing Suunto logs
Miika Turkia
miika.turkia at gmail.com
Tue Jan 1 12:50:24 PST 2013
This patch will convert a heading bookmark to Subsurface format.
Suunto's bookmark uses "Heading: <degrees>" format and was previously
set as the full event name. Now the resulting event will look like:
<event name="heading" value="333°" time="0:58 min"/>
Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
I assume the resulting format is proper for Subsurface but did not see
any samples, thus not sure. I am also not sure how the degree character
(° or °) should be treated (after the numeric value). Currently it
is not displayed by Subsurface.
---
xslt/SuuntoSDM.xslt | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/xslt/SuuntoSDM.xslt b/xslt/SuuntoSDM.xslt
index 08da679..4ea8202 100644
--- a/xslt/SuuntoSDM.xslt
+++ b/xslt/SuuntoSDM.xslt
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="*"/>
- <xsl:output method="xml" indent="yes"/>
+ <xsl:output method="xml" indent="yes" encoding="ASCII"/>
<xsl:template match="/">
<dives>
@@ -200,6 +200,19 @@
</xsl:attribute>
</sample>
</xsl:when>
+ <xsl:when test="substring-before(BOOKMARK, ':') = 'Heading'">
+ <event name="heading">
+ <xsl:attribute name="value">
+ <xsl:value-of select="substring-after(BOOKMARK, ': ')"/>
+ </xsl:attribute>
+ <xsl:attribute name="time">
+ <xsl:call-template name="timeConvert">
+ <xsl:with-param name="timeSec" select="SAMPLETIME"/>
+ <xsl:with-param name="units" select="'si'"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </event>
+ </xsl:when>
<xsl:otherwise>
<xsl:if test="BOOKMARK != 'Surface'">
<event name="{BOOKMARK}">
--
1.7.9.5
More information about the subsurface
mailing list