Subject: Improve XML output for Poseidon CCR dive logs

Correct output of start and end cylinder pressures and
of cylinder pressure data.
When being read back into Subsurface, the dive appears
to be the same as the original, saved dive log.

Signed-off-by: willem ferguson <[email protected]>

>From 4b9024efac5f5741322a33aeacb40232c183dbe1 Mon Sep 17 00:00:00 2001
From: willem ferguson <[email protected]>
Date: Tue, 18 Nov 2014 21:08:41 +0200
Subject: [PATCH 2/2] Improve XML output for Poseidon CCR dive logs

Correct output of start and end cylinder pressures and
of cylinder pressure data.
When being read back into Subsurface, the dive appears
to be the same as the original, saved dive log.

Signed-off-by: willem ferguson <[email protected]>
---
 save-xml.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/save-xml.c b/save-xml.c
index cf7ccfe..ed519f8 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -177,8 +177,8 @@ static void save_cylinder_info(struct membuffer *b, struct dive *dive)
 		put_pressure(b, cylinder->type.workingpressure, " workpressure='", " bar'");
 		show_utf8(b, description, " description='", "'", 1);
 		put_gasmix(b, &cylinder->gasmix);
-		put_pressure(b, cylinder->start, " start='", " bar'");
-		put_pressure(b, cylinder->end, " end='", " bar'");
+		put_pressure(b, (cylinder->start.mbar ? cylinder->start : cylinder->sample_start), " start='", " bar'");
+		put_pressure(b, (cylinder->end.mbar ? cylinder->end : cylinder->sample_end), " end='", " bar'");
 		if (cylinder->cylinder_use != OC_GAS)
 			show_utf8(b, cylinderuse_text[cylinder->cylinder_use], " use='", "'", 1);
 		put_format(b, " />\n");
@@ -214,8 +214,8 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl
 	put_format(b, "  <sample time='%u:%02u min'", FRACTION(sample->time.seconds, 60));
 	put_milli(b, " depth='", sample->depth.mm, " m'");
 	put_temperature(b, sample->temperature, " temp='", " C'");
-	put_pressure(b, sample->cylinderpressure, " pdiluent='", " bar'");
-	put_pressure(b, sample->o2cylinderpressure, " pressure='", " bar'");
+	put_pressure(b, sample->cylinderpressure, " pressure='", " bar'");
+	put_pressure(b, sample->o2cylinderpressure, " o2pressure='", " bar'");
 
 	/*
 	 * We only show sensor information for samples with pressure, and only if it
-- 
1.9.1

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

Reply via email to