diff --git a/examples/output_xml.c b/examples/output_xml.c index f4c312d..1b66056 100644 --- a/examples/output_xml.c +++ b/examples/output_xml.c @@ -171,6 +171,10 @@ sample_cb (dc_sample_type_t type, dc_sample_value_t value, void *userdata) value.deco.time, convert_depth(value.deco.depth, sampledata->units), decostop[value.deco.type]); + if (value.deco.tts) { + fprintf (sampledata->ostream, " %u\n", + value.deco.tts); + } break; case DC_SAMPLE_GASMIX: fprintf (sampledata->ostream, " %u\n", value.gasmix); diff --git a/include/libdivecomputer/parser.h b/include/libdivecomputer/parser.h index c4d0a72..4a727e7 100644 --- a/include/libdivecomputer/parser.h +++ b/include/libdivecomputer/parser.h @@ -257,6 +257,7 @@ typedef union dc_sample_value_t { unsigned int type; unsigned int time; double depth; + unsigned int tts; } deco; unsigned int gasmix; /* Gas mix index */ } dc_sample_value_t; diff --git a/src/atomics_cobalt_parser.c b/src/atomics_cobalt_parser.c index 194296e..2fab3b3 100644 --- a/src/atomics_cobalt_parser.c +++ b/src/atomics_cobalt_parser.c @@ -344,6 +344,7 @@ atomics_cobalt_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback sample.deco.type = DC_DECO_NDL; sample.deco.time = ndl; sample.deco.depth = 0.0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); offset += SZ_SEGMENT; diff --git a/src/cochran_commander_parser.c b/src/cochran_commander_parser.c index 271dc62..72151df 100644 --- a/src/cochran_commander_parser.c +++ b/src/cochran_commander_parser.c @@ -615,6 +615,7 @@ cochran_commander_parser_samples_foreach_tm (dc_parser_t *abstract, dc_sample_ca sample.deco.type = DC_DECO_DECOSTOP; sample.deco.time = 60; // We don't know the duration sample.deco.depth = deco_ceiling * FEET; + sample.deco.tts = 0; if (callback) callback(DC_SAMPLE_DECO, sample, userdata); break; case 0xAD: // Increment ceiling (shallower) @@ -623,6 +624,7 @@ cochran_commander_parser_samples_foreach_tm (dc_parser_t *abstract, dc_sample_ca sample.deco.type = DC_DECO_DECOSTOP; sample.deco.depth = deco_ceiling * FEET; sample.deco.time = 60; // We don't know the duration + sample.deco.tts = 0; if (callback) callback(DC_SAMPLE_DECO, sample, userdata); break; default: @@ -774,6 +776,7 @@ cochran_commander_parser_samples_foreach_emc (dc_parser_t *abstract, dc_sample_c sample.deco.type = DC_DECO_DECOSTOP; sample.deco.time = (array_uint16_le(s + 3) + 1) * 60; sample.deco.depth = deco_ceiling * FEET; + sample.deco.tts = 0; if (callback) callback(DC_SAMPLE_DECO, sample, userdata); break; case 0xAD: // Increment ceiling (shallower) @@ -782,6 +785,7 @@ cochran_commander_parser_samples_foreach_emc (dc_parser_t *abstract, dc_sample_c sample.deco.type = DC_DECO_DECOSTOP; sample.deco.depth = deco_ceiling * FEET; sample.deco.time = (array_uint16_le(s + 3) + 1) * 60; + sample.deco.tts = 0; if (callback) callback(DC_SAMPLE_DECO, sample, userdata); break; case 0xC0: // Switched to FO2 21% mode (surface) @@ -855,6 +859,7 @@ cochran_commander_parser_samples_foreach_emc (dc_parser_t *abstract, dc_sample_c sample.deco.type = DC_DECO_NDL; sample.deco.time = deco_time * 60; sample.deco.depth = 0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } break; @@ -865,6 +870,7 @@ cochran_commander_parser_samples_foreach_emc (dc_parser_t *abstract, dc_sample_c sample.deco.type = DC_DECO_DECOSTOP; sample.deco.depth = deco_ceiling * FEET; sample.deco.time = deco_time * 60; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } break; diff --git a/src/divesoft_freedom_parser.c b/src/divesoft_freedom_parser.c index 1f0b7b3..74ac136 100644 --- a/src/divesoft_freedom_parser.c +++ b/src/divesoft_freedom_parser.c @@ -978,6 +978,7 @@ divesoft_freedom_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba sample.deco.time = ndl * 60; sample.deco.depth = 0.0; } + sample.deco.tts = tts * 60; if (callback) callback(DC_SAMPLE_DECO, sample, userdata); // Setpoint diff --git a/src/divesystem_idive_parser.c b/src/divesystem_idive_parser.c index b9dfb08..892cda1 100644 --- a/src/divesystem_idive_parser.c +++ b/src/divesystem_idive_parser.c @@ -566,11 +566,13 @@ divesystem_idive_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba if (decostop) { sample.deco.type = DC_DECO_DECOSTOP; sample.deco.depth = decostop / 10.0; - sample.deco.time = apos4 ? decotime : tts; + sample.deco.time = decotime; + sample.deco.tts = tts; } else { sample.deco.type = DC_DECO_NDL; sample.deco.depth = 0.0; sample.deco.time = tts; + sample.deco.tts = 0; } if (callback) callback (DC_SAMPLE_DECO, sample, userdata); diff --git a/src/hw_ostc_parser.c b/src/hw_ostc_parser.c index 0ee02ac..1421a08 100644 --- a/src/hw_ostc_parser.c +++ b/src/hw_ostc_parser.c @@ -1053,6 +1053,7 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call sample.deco.depth = 0.0; } sample.deco.time = data[offset + 1] * 60; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); break; case PPO2: diff --git a/src/liquivision_lynx_parser.c b/src/liquivision_lynx_parser.c index 9958327..14c86ed 100644 --- a/src/liquivision_lynx_parser.c +++ b/src/liquivision_lynx_parser.c @@ -593,6 +593,7 @@ liquivision_lynx_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba sample.deco.depth = 0.0; } sample.deco.time = 0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); have_deco = 0; } diff --git a/src/mares_darwin_parser.c b/src/mares_darwin_parser.c index 6a87e46..56b68d3 100644 --- a/src/mares_darwin_parser.c +++ b/src/mares_darwin_parser.c @@ -282,6 +282,7 @@ mares_darwin_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t } sample.deco.time = 0; sample.deco.depth = 0.0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); if (parser->samplesize == 3) { diff --git a/src/mares_iconhd_parser.c b/src/mares_iconhd_parser.c index cb67504..9ffb1e6 100644 --- a/src/mares_iconhd_parser.c +++ b/src/mares_iconhd_parser.c @@ -1159,6 +1159,7 @@ mares_iconhd_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t sample.deco.depth = 0.0; } sample.deco.time = decotime * 60; + sample.deco.tts = tts; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); // Alarms diff --git a/src/mares_nemo_parser.c b/src/mares_nemo_parser.c index 9e906ac..a4c2d4b 100644 --- a/src/mares_nemo_parser.c +++ b/src/mares_nemo_parser.c @@ -422,6 +422,7 @@ mares_nemo_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c } sample.deco.time = 0; sample.deco.depth = 0.0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); // Pressure (1 bar). diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index 526a10f..272cfa2 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -964,6 +964,7 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ sample.deco.depth = 0.0; } sample.deco.time = decotime * 60; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } diff --git a/src/oceanic_veo250_parser.c b/src/oceanic_veo250_parser.c index 2eead46..5f1cac1 100644 --- a/src/oceanic_veo250_parser.c +++ b/src/oceanic_veo250_parser.c @@ -277,6 +277,7 @@ oceanic_veo250_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback sample.deco.depth = 0.0; } sample.deco.time = decotime * 60; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } diff --git a/src/oceanic_vtpro_parser.c b/src/oceanic_vtpro_parser.c index 75b3fc5..636f572 100644 --- a/src/oceanic_vtpro_parser.c +++ b/src/oceanic_vtpro_parser.c @@ -372,6 +372,7 @@ oceanic_vtpro_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ sample.deco.depth = 0.0; } sample.deco.time = decotime * 60; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } diff --git a/src/oceans_s1_parser.c b/src/oceans_s1_parser.c index 63c123f..ff034a2 100644 --- a/src/oceans_s1_parser.c +++ b/src/oceans_s1_parser.c @@ -298,6 +298,7 @@ oceans_s1_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca } sample.deco.depth = 0.0; sample.deco.time = 0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } } diff --git a/src/seac_screen_parser.c b/src/seac_screen_parser.c index dc2e781..dfe0cc3 100644 --- a/src/seac_screen_parser.c +++ b/src/seac_screen_parser.c @@ -377,6 +377,7 @@ seac_screen_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t sample.deco.time = ndl_tts; sample.deco.depth = 0; } + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); // CNS diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c index ab7752f..e8f9055 100644 --- a/src/shearwater_predator_parser.c +++ b/src/shearwater_predator_parser.c @@ -995,6 +995,7 @@ shearwater_predator_parser_samples_foreach (dc_parser_t *abstract, dc_sample_cal sample.deco.depth = 0.0; } sample.deco.time = data[offset + pnf + 9] * 60; + sample.deco.tts = array_uint16_be (data + offset + pnf + 4) * 60; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); // for logversion 7 and newer (introduced for Perdix AI) diff --git a/src/suunto_d9_parser.c b/src/suunto_d9_parser.c index 4de49c1..b61e994 100644 --- a/src/suunto_d9_parser.c +++ b/src/suunto_d9_parser.c @@ -811,6 +811,7 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca } sample.deco.time = 0; sample.deco.depth = 0.0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); time += interval_sample; diff --git a/src/suunto_eonsteel_parser.c b/src/suunto_eonsteel_parser.c index c7276fb..5edd8f6 100644 --- a/src/suunto_eonsteel_parser.c +++ b/src/suunto_eonsteel_parser.c @@ -510,6 +510,7 @@ static void sample_ndl(struct sample_data *info, short ndl) sample.deco.type = DC_DECO_NDL; sample.deco.time = ndl; + sample.deco.tts = 0; if (info->callback) info->callback(DC_SAMPLE_DECO, sample, info->userdata); } @@ -996,8 +997,9 @@ static int traverse_samples(unsigned short type, const struct type_desc *desc, c dc_sample_value_t sample = {0}; sample.deco.type = DC_DECO_DECOSTOP; - sample.deco.time = info->tts; + sample.deco.time = 0; sample.deco.depth = info->ceiling; + sample.deco.tts = info->tts; if (info->callback) info->callback(DC_SAMPLE_DECO, sample, info->userdata); } diff --git a/src/uwatec_memomouse_parser.c b/src/uwatec_memomouse_parser.c index 2c3d506..80c13d5 100644 --- a/src/uwatec_memomouse_parser.c +++ b/src/uwatec_memomouse_parser.c @@ -272,6 +272,7 @@ uwatec_memomouse_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba } sample.deco.time = 0; sample.deco.depth = 0.0; + sample.deco.tts = 0; if (callback) callback (DC_SAMPLE_DECO, sample, userdata); // Warnings