summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-07-22 17:58:19 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-23 08:20:56 -0700
commitdbb3f2dea20909ec6f5e4c3469cd6c3ac708fb7e (patch)
treeb41ab2cd5cde80925b31f192d79f632fae08128e
parent028568555f81f07f7bc504bd8f57292c9ee6ef5b (diff)
downloadsubsurface-dbb3f2dea20909ec6f5e4c3469cd6c3ac708fb7e.tar.gz
Tune the unit test on DivingLog import
At least in some cases the maximum sample depth can be more than recorded maximum depth on DivingLog XML export. Thus the maximum depth is doubled for unit detection. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--xslt/DivingLog.xslt7
1 files changed, 5 insertions, 2 deletions
diff --git a/xslt/DivingLog.xslt b/xslt/DivingLog.xslt
index 49f617c91..15ad651a9 100644
--- a/xslt/DivingLog.xslt
+++ b/xslt/DivingLog.xslt
@@ -157,7 +157,10 @@
<!-- Trying to detect if depth samples are in Imperial or Metric
units. This is based on an assumption that maximum depth of
a dive is recorded in metric and if samples contain bigger
- values, they must be imperial.
+ values, they must be imperial. However, we double the depth
+ for the test in some cases the maximum sample depth might be
+ a bit more than what is recorded as maximum depth for the
+ dive.
-->
<xsl:variable name="max">
@@ -169,7 +172,7 @@
<xsl:variable name="depthUnit">
<xsl:choose>
- <xsl:when test="$max &gt; Depth + 1">
+ <xsl:when test="$max &gt; Depth * 2 + 1">
<xsl:value-of select="'imperial'"/>
</xsl:when>
<xsl:otherwise>