Treat a PSCR dive with sensors more like a CCR dive

PSCR dives with o2 sensors are more like CCR dives. The math is exactly
the same, its just a different diluent and a different po2.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
Anton Lundin 2018-03-05 21:23:23 +01:00 committed by Lubomir I. Ivanov
parent b48eb47178
commit 8de887c8ee

View file

@ -578,7 +578,7 @@ struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *
entry->tts = sample->tts.seconds;
entry->in_deco = sample->in_deco;
entry->cns = sample->cns;
if (dc->divemode == CCR) {
if (dc->divemode == CCR || (dc->divemode == PSCR && dc->no_o2sensors)) {
entry->o2pressure.mbar = entry->o2setpoint.mbar = sample->setpoint.mbar; // for rebreathers
entry->o2sensor[0].mbar = sample->o2sensor[0].mbar; // for up to three rebreather O2 sensors
entry->o2sensor[1].mbar = sample->o2sensor[1].mbar;
@ -1255,7 +1255,7 @@ void fill_o2_values(struct dive *dive, struct divecomputer *dc, struct plot_info
for (i = 0; i < pi->nr; i++) {
struct plot_data *entry = pi->entry + i;
if (dc->divemode == CCR) {
if (dc->divemode == CCR || (dc->divemode == PSCR && dc->no_o2sensors)) {
if (i == 0) { // For 1st iteration, initialise the last_sensor values
for (j = 0; j < dc->no_o2sensors; j++)
last_sensor[j].mbar = pi->entry->o2sensor[j].mbar;