summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-10-19 07:07:07 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-19 07:07:07 -0700
commit5f44fdd9cf6fba073837cbc1d89c6ed3ea28dd76 (patch)
treeccf7ecf769b5b3240fa313233eff78c0f52c7881 /profile.c
parent839bcaaf70b763590509031208b6786288910bc3 (diff)
downloadsubsurface-5f44fdd9cf6fba073837cbc1d89c6ed3ea28dd76.tar.gz
Make planner work again for CCR dives
The latest CCR patches had rendered the planner not usable for CCR dives. This patch corrects this (and reenables the CCR set point column for segments). The problem was that a new member setpoint of struct divepoint had been introduced, but there was already po2 which had the same meaning. This patch merges the two and renames them setpoint to prevent future confusion. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/profile.c b/profile.c
index 93222f5f1..d64d1c7e7 100644
--- a/profile.c
+++ b/profile.c
@@ -558,12 +558,12 @@ struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *
entry->in_deco = sample->in_deco;
entry->cns = sample->cns;
if (dc->dctype == CCR) {
- entry->o2setpoint = sample->o2setpoint.mbar / 1000.0; // for rebreathers
+ entry->o2setpoint = sample->setpoint.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;
} else {
- entry->pressures.o2 = sample->po2.mbar / 1000.0;
+ entry->pressures.o2 = sample->setpoint.mbar / 1000.0;
}
/* FIXME! sensor index -> cylinder index translation! */
entry->cylinderindex = sample->sensor;
@@ -913,7 +913,7 @@ void fill_o2_values(struct divecomputer *dc, struct plot_info *pi, struct dive *
/* For CCR:
* In the samples from each dive computer, any duplicate values for the
* oxygen sensors were removed (i.e. set to 0) in order to conserve
- * storage space (see function fuxup_dive_dc). But for drawing the prodile
+ * storage space (see function fixup_dive_dc). But for drawing the profile
* a complete series of valid o2 pressure values is required. This function
* takes the oxygen sensor data and setpoint values from the structures
* of plotinfo and re-inserts the duplicate values set to 0 so
@@ -1008,10 +1008,9 @@ void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plo
check_gas_change_events(dive, dc, pi); /* Populate the gas index from the gas change events */
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("CCR DIVE: %s (%d O2 sensors)\n", dc->model, dc->no_o2sensors);
+ if (dc->dctype == CCR) /* For CCR dives.. */
populate_pressure_information(dive, dc, pi, DILUENT); /* .. calculate missing diluent gas pressure entries */
- }
+
fill_o2_values(dc, pi, dive); /* .. and insert the O2 sensor data having 0 values. */
calculate_sac(dive, pi); /* Calculate sac */
calculate_deco_information(dive, dc, pi, false); /* and ceiling information, using gradient factor values in Preferences) */