Hello,

here is two little patches to get the CCR support slightly forward. One
fixes a bug in the Poseidon import, the other adds PPO2 info to Shearwater
import.

miika
From 3d7192731a6d8b255faae2112cf26ba77fec19d1 Mon Sep 17 00:00:00 2001
From: Miika Turkia <[email protected]>
Date: Tue, 4 Nov 2014 22:54:07 +0800
Subject: [PATCH 1/2] Include po2 on Shearwater import

Signed-off-by: Miika Turkia <[email protected]>
---
 xslt/shearwater.xslt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xslt/shearwater.xslt b/xslt/shearwater.xslt
index ae6501a..3083037 100644
--- a/xslt/shearwater.xslt
+++ b/xslt/shearwater.xslt
@@ -103,6 +103,16 @@
               </xsl:otherwise>
             </xsl:choose>
           </xsl:attribute>
+          <xsl:attribute name="po2">
+            <xsl:choose>
+              <xsl:when test="$units = 'imperial'">
+                <xsl:value-of select="concat(averagePPO2 div 14.5037738, ' bar')"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="concat(averagePPO2, ' bar')"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
         </sample>
       </xsl:for-each>
     </dive>
-- 
2.1.0

From 770090c9e2ba134d2898dc56cb0825d9eb842ef0 Mon Sep 17 00:00:00 2001
From: Miika Turkia <[email protected]>
Date: Thu, 6 Nov 2014 17:31:42 +0800
Subject: [PATCH 2/2] Reset counters when importing new MK6 log

Naturally the pressure counters and cylinder index must be reset to zero when
reading in a new Poseidon dive log.

Signed-off-by: Miika Turkia <[email protected]>
---
 file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/file.c b/file.c
index 60b79f2..5c4b7a1 100644
--- a/file.c
+++ b/file.c
@@ -430,7 +430,6 @@ char *parse_mkvi_value(const char *haystack, const char *needle)
 	return ret;
 }
 
-static int cur_cylinder_index;
 int parse_txt_file(const char *filename, const char *csv)
 {
 	struct memblock memtxt, memcsv;
@@ -449,7 +448,7 @@ int parse_txt_file(const char *filename, const char *csv)
 		int prev_depth = 0, cur_sampletime = 0, prev_setpoint = -1;
 		bool has_depth = false, has_setpoint = false;
 		char *lineptr;
-		static int diluent_pressure = 0, cylinder_pressure = 0;
+		int diluent_pressure = 0, cylinder_pressure = 0, cur_cylinder_index = 0;
 
 		struct dive *dive;
 		struct divecomputer *dc;
-- 
2.1.0

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to