diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-10-27 18:19:53 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-27 09:32:22 -0700 |
commit | 8b6d49092bb62fb70990b887dc8b739b22b1c9b4 (patch) | |
tree | 68c8c3a98098471308376496c95c2feb13bbe973 | |
parent | 1f1bb71d78523e4d131444092be44efb3b27b4e8 (diff) | |
download | subsurface-8b6d49092bb62fb70990b887dc8b739b22b1c9b4.tar.gz |
Do not zero setpoint value when duplicate
We cannot zero setpoint value upon import if the current and previous
values are zero. This is because on setpoint context a value of 0 means
open circuit.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | dive.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -1092,7 +1092,7 @@ static void fixup_dive_dc(struct dive *dive, struct divecomputer *dc) int maxdepth = dc->maxdepth.mm; int mintemp = 0; int lastdepth = 0; - int lasto2val[3] = { 0, 0, 0 }, lasto2setpoint = 0; + int lasto2val[3] = { 0, 0, 0 }; int lasttemp = 0, lastpressure = 0, lastdiluentpressure = 0; int pressure_delta[MAX_CYLINDERS] = { INT_MAX, }; @@ -1166,15 +1166,6 @@ static void fixup_dive_dc(struct dive *dive, struct divecomputer *dc) } } - // If there are consecutive identical CCR O2 setpoint readings, throw away the redundant ones. - o2val = sample->setpoint.mbar; - if (o2val) { - if (lasto2setpoint == o2val) - sample->setpoint.mbar = 0; - else - lasto2setpoint = o2val; - } - update_min_max_temperatures(dive, sample->temperature); depthtime += (time - lasttime) * (lastdepth + depth) / 2; |