From 514a0e582a7c7a0a1c3b576382c4c4f4ed3da0ec Mon Sep 17 00:00:00 2001 From: willem ferguson Date: Mon, 17 Nov 2014 21:04:36 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'file.c') 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; -- cgit v1.2.3-70-g09d2