aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar willem ferguson <willemferguson@zoology.up.ac.za>2014-10-11 09:49:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-11 07:12:04 -0400
commit46bb02e8fc2878bc94f4f2543db74e20104eb6f2 (patch)
tree8b5e671c974ad1b5ed07c3de8622fb0270378571 /profile.c
parent2282035a4d07548cb1677b16c5df97c7f98ea498 (diff)
downloadsubsurface-46bb02e8fc2878bc94f4f2543db74e20104eb6f2.tar.gz
CCR patch: Import and store oxygen sensor data
This patch allows the importing of oxygen sensor and setpoint data from Poseidon CCR dive logs. 1) Change parse-xml.c to read up to three oxygen sensor values from xml. and to store the information in sample structures 2) Change parse-xml.c to read o2 setpoint values fro xml and to store it in sample structures 3) Change dive.c to delete all sensor and setpoint values where subsequent samples have sensor/setpoint values that are the same. 4) Change profile.c to store the sensor/setpoint values from the samples into plotinfo. 5) Change the sample Poseidon xml log in the dives directory to ensure the correct order and hierarchy of the dive and divecomputer nodes. [Dirk Hohndel: minor cleanup, removed debug code, whitespace] Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 3e557252b..9bd33b83e 100644
--- a/profile.c
+++ b/profile.c
@@ -551,6 +551,11 @@ struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *
entry->in_deco = sample->in_deco;
entry->cns = sample->cns;
entry->pressures.o2 = sample->po2.mbar / 1000.0;
+ entry->o2setpoint = sample->o2setpoint.mbar / 1000.0; // for rebreathers
+ entry->o2sensor[0] = sample->o2sensor[0].mbar / 1000.0; // for up to three rebreather O2 sensors
+ entry->o2sensor[1] = sample->o2sensor[1].mbar / 1000.0;
+ entry->o2sensor[2] = sample->o2sensor[2].mbar / 1000.0;
+
/* FIXME! sensor index -> cylinder index translation! */
entry->cylinderindex = sample->sensor;
SENSOR_PRESSURE(entry) = sample->cylinderpressure.mbar;
@@ -909,7 +914,7 @@ void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plo
setup_gas_sensor_pressure(dive, dc, pi); /* Try to populate our gas pressure knowledge */
populate_pressure_information(dive, dc, pi, NONDILUENT); /* .. calculate missing pressure entries for all gasses except diluent */
if (dc->dctype == CCR) { /* For CCR dives.. */
- printf("REBREATHER; %d O2 sensors\n", dc->no_o2sensors);
+ printf("CCR DIVE: %s (%d O2 sensors)\n", dc->model, dc->no_o2sensors);
populate_pressure_information(dive, dc, pi, DILUENT); /* .. calculate missing diluent gas pressure entries */
// fill_o2_values(dc, pi); /* .. and insert the O2 sensor data having 0 values. */
}