diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-07-22 17:58:19 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-23 08:20:56 -0700 |
commit | dbb3f2dea20909ec6f5e4c3469cd6c3ac708fb7e (patch) | |
tree | b41ab2cd5cde80925b31f192d79f632fae08128e | |
parent | 028568555f81f07f7bc504bd8f57292c9ee6ef5b (diff) | |
download | subsurface-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.xslt | 7 |
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 > Depth + 1"> + <xsl:when test="$max > Depth * 2 + 1"> <xsl:value-of select="'imperial'"/> </xsl:when> <xsl:otherwise> |