diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-30 10:41:20 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-30 16:37:45 -0700 |
commit | 8f0d71ce2b36bbd23e3e5d5d520bcb793797cad6 (patch) | |
tree | 9d4714e4bb13fca12916b67a15d42400f870b3f6 /profile-widget/divecartesianaxis.cpp | |
parent | 5b28fcea3a731a3c031604df4bdca4b95684e2ea (diff) | |
download | subsurface-8f0d71ce2b36bbd23e3e5d5d520bcb793797cad6.tar.gz |
Fix another cylinder pressure plotting special case
The core to plot manually entered pressures without any sample data did
the obvious thing: it ended the pressures at the end of the dive as
indicated by the last sample.
However, that obvious thing didn't actually work, because sometimes the
last sample is long long after the dive has actually ended, and we have
no plot_info data for that.
This depends on the dive computer used: most dive computers will not
report samples after the end (even if they may internally remember them
in case the diver just came up to the surface temporarily), but some
definitely do. The OSTC3 is a prime example of that.
Anyway, the code was fragile and wrong - even if passed a time past the
end of the plot_info data, "add_plot_pressure()" should just have
associated that with the last entry instead. Which also allows us to
simplify the whole endtime logic entirely, and just use INT_MAX for it.
Gaetan Bisson's test-case also showed another oddity: we would plot the
gas pressure even for cylinders that had no has use (ie beginning and
ending pressures were the same). That's kind of pointless in so many
ways. So limit the manual pressure population to cylinders that
actually have seen use.
Reported-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/divecartesianaxis.cpp')
0 files changed, 0 insertions, 0 deletions