summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-06-09 07:47:52 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-21 08:44:33 -0700
commit79e0e24a0d21309c563f7ad20c8c2933d2c3efcb (patch)
treecb43e85aa05f3d2786e3389be94ec6cddedd1c53
parentbca1c780049a4eadd4dc2aa11d3b41051916000e (diff)
downloadsubsurface-79e0e24a0d21309c563f7ad20c8c2933d2c3efcb.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>
-rw-r--r--xslt/uddf.xslt18
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 &lt; 1">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="condition/visibility &lt;= 3">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="condition/visibility &lt;= 5">
+ <xsl:value-of select="3"/>
+ </xsl:when>
+ <xsl:when test="condition/visibility &lt;= 10">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="5"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
</xsl:if>