Do a better job at creating plot info entries

Linus Torvalds torvalds at linux-foundation.org
Sun Jan 6 12:53:25 PST 2013


This simplifies - and improves - the code to generate the plot info
entries from the samples.

We used to generate exactly one plot info entry per sample, and then -
because the result doesn't have high enough granularity - we'd
generate additional plot info entries at gas change events etc.

Which resulted in all kinds of ugly special case logic. Not only for
the gas switch, btw: you can see the effects of this in the deco graph
(done at plot entry boundaries) and in the gas pressure curves.

So this throws that "do special plot entries for gas switch events"
code away entirely, and replaces it with a much more straightforward
model: we generate plot entries at a minimum of ten-second intervals.
If you have samples more often than that, you'll get more frequent
plot entries, but you'll never get less than that "every ten seconds".

As a result, the code is smaller and simpler (99 insertions, 161
deletions), and actually does a better job too.

You can see the difference especially in the test dives that only have
a few entries (or if you create a new dive without a dive computer,
using the "Add Dive" menu entry). Look at the deco graph of test-dive
20 before and after, for example. You can also see it very subtly in
the cylinder pressure curves going from line segments to curves on
that same dive.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 10865 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130106/c065a4ec/attachment.obj>


More information about the subsurface mailing list