diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-03 11:34:20 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-08-03 13:29:25 -0700 |
commit | 8fe24055f025428eabd353f542ab7928cff0a8c1 (patch) | |
tree | 649071b7588c922d84399e7b5c3894616273e899 /marbledata | |
parent | b4063de452c4ebe5f554ffca5f807dc363136b09 (diff) | |
download | subsurface-8fe24055f025428eabd353f542ab7928cff0a8c1.tar.gz |
Fix Poseidon MkVI txt file import sensor pressures
When I unified the sample pressures in commit 11a0c0cc7018 ("Unify
sample pressure and o2pressure as pressure[2] array") I did all the
obvious conversions, including the conversion of the Poseidon txt file
import:
case POSEIDON_PRESSURE:
- sample->cylinderpressure.mbar = lrint(val * 1000);
+ sample->pressure[0].mbar = lrint(val * 1000);
break;
case POSEIDON_O2CYLINDER:
- sample->o2cylinderpressure.mbar = lrint(val * 1000);
+ sample->pressure[1].mbar = lrint(val * 1000);
break;
which was ObviouslyCorrect(tm).
But as so often is the case, obvious doesn't actually exist. The old
"o2cylinderpressure[]" model had an implicit sensor associated with it,
and that implicit sensor mapping wasn't obvious, and didn't get fixed.
It turns out that the way the Poseidon sensor mapping works, the O2
cylinder is cylinder 0, and the diluent cylinder is cylinder 1, so just
use the add_sample_pressure() helper to set both sensor index and
pressure value.
And since we now do all the sensor indexing right, we can also get rid
of some manual cylinder sample pressure code, because the generic dive
fixup will just DTRT. It used to screw up because the diluent sensor
number was wrong before, and the import code tried to work around that
by hand.
Reported-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'marbledata')
0 files changed, 0 insertions, 0 deletions