mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Shearwater cloud import: adjust to milliseconds
Seems that Shearwater cloud gives the sample time in milliseconds nowadays. Taking a wild guess, that this logic should suffice for us to be able to import old and newer XML logs. (Assuming that if the timestamp for the first sample is more than 100, timestamps are in milliseconds, otherwise in seconds.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
601f49ab84
commit
dbf7fa89a2
1 changed files with 13 additions and 2 deletions
|
@ -60,6 +60,17 @@
|
|||
<xsl:value-of select="concat(maxTime, ' min')"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:variable name="timeMultiplier">
|
||||
<xsl:choose>
|
||||
<xsl:when test="diveLogRecords/diveLogRecord[1]/currentTime > 100">
|
||||
<xsl:value-of select="'1000'"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="'1'"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<depth>
|
||||
<xsl:attribute name="max">
|
||||
<xsl:choose>
|
||||
|
@ -122,7 +133,7 @@
|
|||
<xsl:attribute name="time">
|
||||
<xsl:call-template name="sec2time">
|
||||
<xsl:with-param name="timeSec">
|
||||
<xsl:value-of select="currentTime"/>
|
||||
<xsl:value-of select="currentTime div $timeMultiplier"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
|
@ -141,7 +152,7 @@
|
|||
<xsl:attribute name="time">
|
||||
<xsl:call-template name="sec2time">
|
||||
<xsl:with-param name="timeSec">
|
||||
<xsl:value-of select="currentTime"/>
|
||||
<xsl:value-of select="currentTime div $timeMultiplier"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:attribute>
|
||||
|
|
Loading…
Add table
Reference in a new issue