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
|
@ -566,9 +566,9 @@ static void populate_plot_entries(const struct dive *dive, const struct divecomp
|
|||
} else {
|
||||
entry->pressures.o2 = sample->setpoint.mbar / 1000.0;
|
||||
}
|
||||
if (sample->pressure[0].mbar)
|
||||
if (sample->pressure[0].mbar && sample->sensor[0] != NO_SENSOR)
|
||||
set_plot_pressure_data(pi, idx, SENSOR_PR, sample->sensor[0], sample->pressure[0].mbar);
|
||||
if (sample->pressure[1].mbar)
|
||||
if (sample->pressure[1].mbar && sample->sensor[1] != NO_SENSOR)
|
||||
set_plot_pressure_data(pi, idx, SENSOR_PR, sample->sensor[1], sample->pressure[1].mbar);
|
||||
if (sample->temperature.mkelvin)
|
||||
entry->temperature = lasttemp = sample->temperature.mkelvin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue