Update sample_start and sample_end pressures

When we merge dives, the sample_start and sample_end pressures are only
used in-memory for displaying data to the user. However, we should
update them as well as this will show the user the correct data in the
equipment/cylinder and i.e. SAC calculation.

Fixes #577

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2017-09-30 15:21:26 +03:00 committed by Lubomir I. Ivanov
parent 571918feaa
commit 325c4459ad

View file

@ -2155,6 +2155,11 @@ static void merge_one_cylinder(cylinder_t *a, cylinder_t *b)
a->start.mbar = b->start.mbar;
if (!a->end.mbar)
a->end.mbar = b->end.mbar;
if (a->sample_start.mbar && b->sample_start.mbar)
a->sample_start.mbar = a->sample_start.mbar > b->sample_start.mbar ? a->sample_start.mbar : b->sample_start.mbar;
if (a->sample_end.mbar && b->sample_end.mbar)
a->sample_end.mbar = a->sample_end.mbar < b->sample_end.mbar ? a->sample_end.mbar : b->sample_end.mbar;
}
/*