Add support for DC_SAMPLE_TTS - time to surface in seconds
Several dive computers support this, so why not have the proper interface for it in libdivecomputer? Triggered by the fact that the Python scripts to generate XML files from the Garmin FIT files can import this information, but the native libdivecomputer model couldn't. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f6ea5f514a
commit
86540206db
@ -46,9 +46,13 @@ typedef enum dc_sample_type_t {
|
||||
DC_SAMPLE_PPO2,
|
||||
DC_SAMPLE_CNS,
|
||||
DC_SAMPLE_DECO,
|
||||
DC_SAMPLE_GASMIX
|
||||
DC_SAMPLE_GASMIX,
|
||||
DC_SAMPLE_TTS, // time to surface in seconds
|
||||
} dc_sample_type_t;
|
||||
|
||||
// Make it easy to test support compile-time with "#ifdef DC_SAMPLE_TTS"
|
||||
#define DC_SAMPLE_TTS DC_SAMPLE_TTS
|
||||
|
||||
typedef enum dc_field_type_t {
|
||||
DC_FIELD_DIVETIME,
|
||||
DC_FIELD_MAXDEPTH,
|
||||
|
||||
@ -399,7 +399,14 @@ DECLARE_FIELD(RECORD, next_stop_time, UINT32) // seconds
|
||||
garmin->record_data.pending |= RECORD_DECO;
|
||||
garmin->record_data.stop_time = data;
|
||||
}
|
||||
DECLARE_FIELD(RECORD, tts, UINT32) { } // seconds
|
||||
DECLARE_FIELD(RECORD, tts, UINT32)
|
||||
{
|
||||
if (garmin->callback) {
|
||||
dc_sample_value_t sample = {0};
|
||||
sample.time = data;
|
||||
garmin->callback(DC_SAMPLE_TTS, sample, garmin->userdata);
|
||||
}
|
||||
}
|
||||
DECLARE_FIELD(RECORD, ndl, UINT32) // s
|
||||
{
|
||||
if (garmin->callback) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user