mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
571918feaa
commit
325c4459ad
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue