[PATCH 2/2] Parse the MacDive gaschange values

Miika Turkia miika.turkia at gmail.com
Mon May 4 13:37:31 PDT 2015


Fixes #869

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/MacDive.xslt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 9e3d33e..3e2c462 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -428,6 +428,24 @@
                   </xsl:otherwise>
                 </xsl:choose>
               </xsl:attribute>
+              <xsl:if test="alarm = 'gas_change'">
+                <xsl:attribute name="value">
+                  <xsl:choose>
+                    <xsl:when test="contains(extra, 'EAN')">
+                      <xsl:value-of select="translate(extra, translate(extra, '1234567890', ''), '')"/>
+                    </xsl:when>
+                    <xsl:when test="contains(extra, 'Trimix')">
+                      <xsl:variable name="trimix">
+                        <xsl:value-of select="translate(extra, translate(extra, '1234567890/', ''), '')"/>
+                      </xsl:variable>
+                      <xsl:value-of select="substring-after($trimix, '/') * 65536 + substring-before($trimix, '/')"/>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:value-of select="extra"/>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:attribute>
+              </xsl:if>
             </event>
           </xsl:if>
         </xsl:for-each>
-- 
2.1.4



More information about the subsurface mailing list