mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: add a special NO_SENSOR value for sample::sensor
The sensor member of sample refers to a cylinder from which the pressure was read. However, some dives don't even have a cylinder. Therefore, introduce a special NO_SENSOR value for these dives. Since the cylinder is given as a uint8_t, 0xff seems to be a sensible choice. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
48c2929f48
commit
7e11a35371
3 changed files with 8 additions and 5 deletions
|
@ -1657,9 +1657,10 @@ static void sample_renumber(struct sample *s, int i, const int mapping[])
|
|||
int j;
|
||||
|
||||
for (j = 0; j < MAX_SENSORS; j++) {
|
||||
int sensor;
|
||||
int sensor = -1;
|
||||
|
||||
sensor = mapping[s->sensor[j]];
|
||||
if (s->sensor[j] != NO_SENSOR)
|
||||
sensor = mapping[s->sensor[j]];
|
||||
if (sensor == -1) {
|
||||
// Remove sensor and gas pressure info
|
||||
if (i == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue