Don't force the first divecomputer to CCR just because there's po2 value

The existing code was bogus as it used cur_dive->dc instead of cur_dc
(i.e., it always changed the first dive computer, even if the po2 was
found in a different one).

But fundamentally I consider this bogus. We are not doing the right thing
here - some dive computer send us pO2 values that are just the calculated
pO2 at a depth and NOT a setpoint, yet we pretend those are setpoints and
then turn these dives into CCR dives.

This needs to done differently.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-02-13 21:07:22 -08:00
parent 1527cd0d05
commit 6dd6e90684

View file

@ -935,10 +935,8 @@ static void try_to_fill_sample(struct sample *sample, const char *name, char *bu
return;
if (MATCH("sensor3.sample", double_to_o2pressure, &sample->o2sensor[2])) // up to 3 CCR sensors
return;
if (MATCH("po2.sample", double_to_o2pressure, &sample->setpoint)) {
cur_dive->dc.divemode = CCR;
if (MATCH("po2.sample", double_to_o2pressure, &sample->setpoint))
return;
}
if (MATCH("heartbeat", get_uint8, &sample->heartbeat))
return;
if (MATCH("bearing", get_bearing, &sample->bearing))