mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Trim the dive to exclude surface time at beginning and end
We don't change any of the samples, we just don't plot (or consider for dive time / mean calculations) the samples at the beginning or end of the dive that are less than a certain threshold under water. Right now that's an arbitrary 75cm which seems to Do The Right Thing(tm) for the dives I tried this with - but I'm happy to look at other values if this causes problems for people with dive computers I do not have access to. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4c3dfee446
commit
7c09991876
3 changed files with 11 additions and 2 deletions
|
|
@ -1704,6 +1704,10 @@ static struct plot_info *create_plot_info(struct dive *dive, int nr_samples, str
|
|||
int delay = 0;
|
||||
struct sample *sample = dive_sample+i;
|
||||
|
||||
if (sample->time.seconds < dive->start || sample->time.seconds > dive->end) {
|
||||
pi_idx--;
|
||||
continue;
|
||||
}
|
||||
entry = pi->entry + i + pi_idx;
|
||||
while (ceil_ev && ceil_ev->time.seconds <= sample->time.seconds) {
|
||||
struct event *next_ceil_ev = get_next_event(ceil_ev->next, "ceiling");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue