diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2013-06-09 07:47:52 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-06-11 09:43:07 -0400 |
commit | 9066c8bad606ac31382016a1758d029ca334916a (patch) | |
tree | 177689b1cda375911fb80ad9b439eaa4f6d49eaf /xslt/uddf.xslt | |
parent | 72d0030509c4a335c263bed0151cf5366cf807ac (diff) | |
download | subsurface-9066c8bad606ac31382016a1758d029ca334916a.tar.gz |
Visibility scaling for UDDF import
Visibility is defined in meters in UDDF and we use scale up to 5 stars.
Thus the meters are scaled to our star rating using one-size-fits all
method.
< 1m => 1 star
<= 3m => 2 star
<= 5m => 3 star
<= 10m => 4 star
> 10m => 5 star
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/uddf.xslt')
-rw-r--r-- | xslt/uddf.xslt | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xslt/uddf.xslt b/xslt/uddf.xslt index dfffecfb0..274280169 100644 --- a/xslt/uddf.xslt +++ b/xslt/uddf.xslt @@ -128,7 +128,23 @@ <xsl:if test="condition/visibility != '' and condition/visibility != 0"> <xsl:attribute name="visibility"> - <xsl:value-of select="condition/visibility"/> + <xsl:choose> + <xsl:when test="condition/visibility < 1"> + <xsl:value-of select="1"/> + </xsl:when> + <xsl:when test="condition/visibility <= 3"> + <xsl:value-of select="2"/> + </xsl:when> + <xsl:when test="condition/visibility <= 5"> + <xsl:value-of select="3"/> + </xsl:when> + <xsl:when test="condition/visibility <= 10"> + <xsl:value-of select="4"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="5"/> + </xsl:otherwise> + </xsl:choose> </xsl:attribute> </xsl:if> |