aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar willem ferguson <willemferguson@zoology.up.ac.za>2014-11-17 21:04:36 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-18 08:57:21 +0000
commit514a0e582a7c7a0a1c3b576382c4c4f4ed3da0ec (patch)
tree536f7593511eb0e71a73d82ee4c1de1a296a5ca5 /file.c
parent55763d3da1c0f154b209c8c8d1ddc97b6ee0c2d7 (diff)
downloadsubsurface-514a0e582a7c7a0a1c3b576382c4c4f4ed3da0ec.tar.gz
Fix issues in CCR handling
In commit 0d7c192e6edc ("For CCR dives, the diluent cylinder is the current cylinder") a few things got broken. This tries to undo those changes and adds expanded XML output. 1) Calculate correct partial pressure of oxygen to be plotted on dive profile, taking into account the oxygen sensor data. Currently, erroneously, OC PO2 values are shown, due to an erroneous calling parameter to fill_pressures(). 2) Read start and end cylinder pressured correctly. some wrong assignments were done in file.c. This is now corrected and the correct cylinder pressures are shown in the equipment tab. 3) Write correct cylinder pressures to XML. Currently the data for the two cylinders are written to XML the wrong way round (diluent pressures = oxygen and vice versa). 4) Expand XML output: a) Write oxygen sensor data to XML b) Write no_of_02sensors to XML Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 97095fd6c..4fe4d3526 100644
--- a/file.c
+++ b/file.c
@@ -597,7 +597,7 @@ int parse_txt_file(const char *filename, const char *csv)
case 13:
add_sample_data(sample, POSEIDON_O2CYLINDER, value);
if (!o2cylinder_pressure) {
- dive->cylinder[1].sample_start.mbar = value * 1000;
+ dive->cylinder[0].sample_start.mbar = value * 1000;
o2cylinder_pressure = value;
} else
o2cylinder_pressure = value;
@@ -605,7 +605,7 @@ int parse_txt_file(const char *filename, const char *csv)
case 14:
add_sample_data(sample, POSEIDON_PRESSURE, value);
if (!cylinder_pressure) {
- dive->cylinder[0].sample_start.mbar = value * 1000;
+ dive->cylinder[1].sample_start.mbar = value * 1000;
cylinder_pressure = value;
} else
cylinder_pressure = value;