mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
init_deco correctly identify previous dives and report overlapping dives
When changing the date/time of a dive in the planner the dive may end up in a totaly new position in respect to date/time of other dives in dive list table. It can be moved to the past or the future before or after other existing dives. It also could overlap with an existing dive. This change enables identification of a new "virtual" dive list position and based on this starts looking for previous dives. Then it (as before the change) does init the deco calculation with any applicable previous dive and surface interval. If some of these applicable dives overlap it returns a neg. surface time which is then used in the planner notes to prohibit display of results. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
59845c1343
commit
4158a4c7de
6 changed files with 138 additions and 51 deletions
|
@ -127,7 +127,7 @@ void interpolate_transition(struct dive *dive, duration_t t0, duration_t t1, dep
|
|||
}
|
||||
|
||||
/* returns the tissue tolerance at the end of this (partial) dive */
|
||||
unsigned int tissue_at_end(struct dive *dive, struct deco_state **cached_datap)
|
||||
int tissue_at_end(struct dive *dive, struct deco_state **cached_datap)
|
||||
{
|
||||
struct divecomputer *dc;
|
||||
struct sample *sample, *psample;
|
||||
|
@ -135,7 +135,7 @@ unsigned int tissue_at_end(struct dive *dive, struct deco_state **cached_datap)
|
|||
depth_t lastdepth = {};
|
||||
duration_t t0 = {}, t1 = {};
|
||||
struct gasmix gas;
|
||||
unsigned int surface_interval = 0;
|
||||
int surface_interval = 0;
|
||||
|
||||
if (!dive)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue