Refine cylinder usage tests

Consider cylinder used also if the first and last sample pressure differ
enough

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2017-09-14 06:43:12 +03:00 committed by Dirk Hohndel
parent 96ed09bf14
commit a8ce78bf77

View file

@ -334,6 +334,10 @@ bool is_cylinder_used(struct dive *dive, int idx)
if ((dive->cylinder[idx].start.mbar - dive->cylinder[idx].end.mbar) > SOME_GAS)
return true;
if ((dive->cylinder[idx].sample_start.mbar - dive->cylinder[idx].sample_end.mbar) > SOME_GAS)
return true;
for_each_dc(dive, dc) {
if (has_gaschange_event(dive, dc, idx))
return true;