diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-10-25 12:02:08 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-25 13:22:59 +0900 |
commit | 2b1017c986bf10a490592fba7e85b14df86cd58d (patch) | |
tree | d7130a28fca1fea9c944e21797bb757448e7869e /deco.c | |
parent | cd1884b29cff57b225e1ab58d0b1dcad25669034 (diff) | |
download | subsurface-2b1017c986bf10a490592fba7e85b14df86cd58d.tar.gz |
Interpolate depth for samples that have no depth
When downloading from libdivecomputer, we used to initialize the depth
of a sample to the previous depth. However, at least for the Suunto EON
Steel, you can get sample times without any actual depth reading - the
time might be associated with some ranbdom event rather than a new depth
sample.
Rather than initialize these samples to have the same depth as the
previous one (and then perhaps getting a very sudden jump when the
*real* depth event comes in a second later), initialize the depth
samples to -1, and if that sample doesn't get a real depth, we'll create
an interpolated depth.
It is possible that we should just carry the sample around as not
actually having a depth, and instead just interpolate in the plot_info
generation, but at least right now we have a ton of code that "knows"
that every sample has a depth. Not the least of which is our own save
format.
So generating an interpolated depth seems the path of least resistance,
and at least makes the graph look correct - no odd staircase effect from
other events that happen in between depth samples.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'deco.c')
0 files changed, 0 insertions, 0 deletions