[PATCH 2/2] Use dynamic sample interval on divelogs.de export

Miika Turkia miika.turkia at gmail.com
Fri May 1 08:11:00 PDT 2015


Rounding always up should give us sensible sample interval as EON Steel
adds extra samples.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/divelogs-export.xslt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xslt/divelogs-export.xslt b/xslt/divelogs-export.xslt
index 7ae3423..8a0b792 100644
--- a/xslt/divelogs-export.xslt
+++ b/xslt/divelogs-export.xslt
@@ -222,7 +222,10 @@
     <SAMPLEINTERVAL>
       <xsl:choose>
         <xsl:when test="$special = 1">
-          <xsl:text>10</xsl:text>
+          <xsl:variable name="samples">
+            <xsl:value-of select="count(//sample/@time)"/>
+          </xsl:variable>
+          <xsl:value-of select="ceiling($duration div $samples)"/>
         </xsl:when>
         <xsl:otherwise>
           <xsl:variable name="first">
-- 
2.1.0



More information about the subsurface mailing list