Add support for max and mean depths for CSV import

Add support of importing max and mean depths from DC header information.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2018-01-07 09:58:06 +02:00 committed by mturkia
parent 4a5b40c144
commit 5046fa34a4

View file

@ -31,6 +31,8 @@
<xsl:param name="Firmware" select="Firmware"/>
<xsl:param name="Serial" select="Serial"/>
<xsl:param name="GF" select="GF"/>
<xsl:param name="maxDepth" select="maxDepth"/>
<xsl:param name="meanDepth" select="meanDepth"/>
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
@ -189,6 +191,35 @@
</extradata>
</xsl:if>
<xsl:if test="string-length($maxDepth) &gt; 0 or string-length($meanDepth) &gt; 0">
<depth>
<xsl:if test="string-length($maxDepth) &gt; 0">
<xsl:attribute name="max">
<xsl:choose>
<xsl:when test="$units = 0">
<xsl:value-of select="translate($maxDepth, ',', '.')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round(translate(translate($maxDepth, translate($maxDepth, '0123456789,.', ''), ''), ',', '.') * 0.3048 * 1000) div 1000"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length($meanDepth) &gt; 0">
<xsl:attribute name="mean">
<xsl:choose>
<xsl:when test="$units = 0">
<xsl:value-of select="translate($meanDepth, ',', '.')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round(translate(translate($meanDepth, translate($meanDepth, '0123456789,.', ''), ''), ',', '.') * 0.3048 * 1000) div 1000"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
</depth>
</xsl:if>
<xsl:call-template name="printLine">
<xsl:with-param name="line" select="substring-before(//csv, $lf)"/>
<xsl:with-param name="lineno" select="'1'"/>