diff options
author | Salvador Cuñat <salvador.cunat@gmail.com> | 2015-07-22 17:02:33 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-30 07:43:16 -0700 |
commit | cfac25626b209ee12201a30524d421d6a49a7b58 (patch) | |
tree | fa8557af47a88901d5c56c0730628396978cc722 /libdivecomputer.c | |
parent | 59a18ab000453cdbbe8b6ae621e999ee74abcd4c (diff) | |
download | subsurface-cfac25626b209ee12201a30524d421d6a49a7b58.tar.gz |
Add support for RBT reported sample value
RBT (Remaining Bottom Time) is a value calculated on the fly by some air
integrated divecomputers, for example Uwatec devices. This value is an
estimation based in some heuristic around time function pressure
gradients. This way, RBT would be the time a diver can spend at actual
depth without running out of gas (taking account of ascent, deco, if
required, and rock bottom gas reserve, if set).
Older Uwatec devices just made the calculus and only stored alarm events
if this time value reached zero, but modern devices store the value each
sample, in minutes.
It seems that Suunto Eon Steel is storing RBT values too, in seconds.
Libdivecomputer has supported RBT for a while, but Subsurface just
printed it to stdout and dropped it.
This adds support for RBT value on subsurface sample structure and shows
it in the profile's info box, right under TTS(calc), if selected, where
these two values can be easily compared by humans.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r-- | libdivecomputer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c index edefaab14..64e76e389 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -246,7 +246,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata) handle_event(dc, sample, value); break; case DC_SAMPLE_RBT: - printf(" <rbt>%u</rbt>\n", value.rbt); + sample->rbt.seconds = (!strncasecmp(dc->model, "suunto", 6)) ? value.rbt : value.rbt * 60; break; case DC_SAMPLE_HEARTBEAT: sample->heartbeat = value.heartbeat; |