mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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>
This commit is contained in:
parent
028568555f
commit
dbb3f2dea2
1 changed files with 5 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue