mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
SDM import: calculate duration if needed
Seems that DiveManager does not always return the dive duration in DIVETIMESEC field. In this case we can try to calculate the duration from sample count and interval. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
094ff8c681
commit
19400b8da1
1 changed files with 14 additions and 4 deletions
|
@ -25,10 +25,20 @@
|
|||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="duration">
|
||||
<xsl:call-template name="timeConvert">
|
||||
<xsl:with-param name="timeSec" select="DIVETIMESEC"/>
|
||||
<xsl:with-param name="units" select="$units"/>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="DIVETIMESEC != ''">
|
||||
<xsl:call-template name="timeConvert">
|
||||
<xsl:with-param name="timeSec" select="DIVETIMESEC"/>
|
||||
<xsl:with-param name="units" select="$units"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="timeConvert">
|
||||
<xsl:with-param name="timeSec" select="SAMPLECNT * SAMPLEINTERVAL"/>
|
||||
<xsl:with-param name="units" select="$units"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:choose>
|
||||
|
|
Loading…
Add table
Reference in a new issue