1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

CSV import: convert cylinder size from imperial

This will convert cylinder size when importing from imperial units. I am
using default working pressure of 3000 PSI that is not precisely
correct, but should be close enough for the most common aluminium
cylinders.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2016-05-02 20:11:32 +03:00 committed by Dirk Hohndel
parent 7dde9b25d8
commit 98f93be0c4

View file

@ -264,10 +264,20 @@
<cylinder>
<xsl:if test="$cylindersizeField &gt; 0">
<xsl:attribute name="size">
<xsl:call-template name="getFieldByIndex">
<xsl:with-param name="index" select="$cylindersizeField"/>
<xsl:with-param name="line" select="$line"/>
</xsl:call-template>
<xsl:variable name="size">
<xsl:call-template name="getFieldByIndex">
<xsl:with-param name="index" select="$cylindersizeField"/>
<xsl:with-param name="line" select="$line"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$units = 0">
<xsl:value-of select="$size"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number((translate($size, translate($size, '0123456789', ''), '') * 14.7 div 3000) div 0.35315, '#.#')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:if test="$startpressureField &gt; 0">