mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Add support for air and water temps for CSV import
Add support of importing air and water temperatures from DC header information. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
5046fa34a4
commit
65c4891a71
1 changed files with 31 additions and 0 deletions
|
@ -33,6 +33,8 @@
|
|||
<xsl:param name="GF" select="GF"/>
|
||||
<xsl:param name="maxDepth" select="maxDepth"/>
|
||||
<xsl:param name="meanDepth" select="meanDepth"/>
|
||||
<xsl:param name="airTemp" select="airTemp"/>
|
||||
<xsl:param name="waterTemp" select="waterTemp"/>
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
|
||||
<xsl:variable name="lf"><xsl:text>
|
||||
|
@ -220,6 +222,35 @@
|
|||
</depth>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="string-length($airTemp) > 0 or string-length($waterTemp) > 0">
|
||||
<temperature>
|
||||
<xsl:if test="string-length($airTemp) > 0">
|
||||
<xsl:attribute name="air">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$units = 0">
|
||||
<xsl:value-of select="translate($airTemp, ',', '.')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat(format-number((translate(translate($airTemp, translate($airTemp, '0123456789,.', ''), ''), ',', '.') - 32) * 5 div 9, '0.0'), ' C')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="string-length($waterTemp) > 0">
|
||||
<xsl:attribute name="water">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$units = 0">
|
||||
<xsl:value-of select="translate($waterTemp, ',', '.')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat(format-number((translate(translate($waterTemp, translate($waterTemp, '0123456789,.', ''), ''), ',', '.') - 32) * 5 div 9, '0.0'), ' C')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</temperature>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:call-template name="printLine">
|
||||
<xsl:with-param name="line" select="substring-before(//csv, $lf)"/>
|
||||
<xsl:with-param name="lineno" select="'1'"/>
|
||||
|
|
Loading…
Reference in a new issue