mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Guess imperial cylinder sizes on CSV import
This patch uses pre-defined working pressures on cylinders to roughly calculate the size in liters. Imperial selection is ignored here as we can use the prefix to detect if the value seems like imperial unit (and the type of cylinder varies based on location, not divers preference in unit). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
da42b0b79d
commit
c5d3d923a0
1 changed files with 19 additions and 1 deletions
|
@ -218,9 +218,27 @@
|
|||
<xsl:with-param name="line" select="$line"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- ALxxx -> xxx cuft at 3000 psi
|
||||
LPxxx -> xxx cuft at 2400 psi
|
||||
HPxxx -> xxx cuft at 3440 psi -->
|
||||
|
||||
<xsl:if test="$size != ''">
|
||||
<xsl:attribute name="size">
|
||||
<xsl:value-of select="$size"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring($size, 1, 2) = 'AL'">
|
||||
<xsl:value-of select="format-number((translate($size, translate($size, '0123456789', ''), '') * 14.7 div 3000) div 0.035315, '#.#')"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="substring($size, 1, 2) = 'LP'">
|
||||
<xsl:value-of select="format-number((translate($size, translate($size, '0123456789', ''), '') * 14.7 div 2400) div 0.035315, '#.#')"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="substring($size, 1, 2) = 'HP'">
|
||||
<xsl:value-of select="format-number((translate($size, translate($size, '0123456789', ''), '') * 14.7 div 3440) div 0.035315, '#.#')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$size"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="$start != ''">
|
||||
|
|
Loading…
Reference in a new issue