[PATCH 2/3] Parse MacDive gas usage from gases list

Miika Turkia miika.turkia at gmail.com
Wed May 6 07:38:44 PDT 2015


Gas change events can be parsed properly from the gases list with clear
information on what the gas mixture was.

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

diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index 21f827b..7e0e4c6 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -208,6 +208,21 @@
         </cylinder>
       </xsl:for-each>
 
+      <xsl:for-each select="gases/gas">
+        <event name="gaschange">
+          <xsl:attribute name="time">
+            <xsl:call-template name="sec2time">
+              <xsl:with-param name="timeSec">
+                <xsl:value-of select="sum(preceding-sibling::gas/duration)"/>
+              </xsl:with-param>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:attribute name="value">
+            <xsl:value-of select="helium * 65536 + oxygen"/>
+          </xsl:attribute>
+        </event>
+      </xsl:for-each>
+
       <xsl:if test="diveMaster">
         <divemaster>
           <xsl:value-of select="diveMaster"/>
-- 
2.1.4



More information about the subsurface mailing list