Remove the deprecated gas change events
The new gas mix sample has been around for a while now, and we're not going to maintain the deprecated events forever.
This commit is contained in:
parent
590882cd1d
commit
d0dbd1f6fd
@ -1,5 +1,5 @@
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
|
||||
AM_CFLAGS = $(LIBUSB_CFLAGS) $(HIDAPI_CFLAGS) -DENABLE_DEPRECATED
|
||||
AM_CFLAGS = $(LIBUSB_CFLAGS) $(HIDAPI_CFLAGS)
|
||||
|
||||
lib_LTLIBRARIES = libdivecomputer.la
|
||||
|
||||
|
||||
@ -297,15 +297,6 @@ atomics_cobalt_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback
|
||||
}
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int o2 = data[SZ_HEADER + SZ_GASMIX * idx + 4];
|
||||
unsigned int he = data[SZ_HEADER + SZ_GASMIX * idx + 5];
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
gasmix_previous = gasmix;
|
||||
}
|
||||
|
||||
|
||||
@ -218,13 +218,6 @@ cressi_edy_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c
|
||||
if (idx != gasmix) {
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = bcd2dec(data[0x17 - idx]);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
gasmix = idx;
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,13 +261,6 @@ diverite_nitekq_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callbac
|
||||
if (gasmix != gasmix_previous) {
|
||||
sample.gasmix = gasmix;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = oxygen[gasmix] | (helium[gasmix] << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
gasmix_previous = gasmix;
|
||||
}
|
||||
|
||||
|
||||
@ -266,13 +266,6 @@ divesystem_idive_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba
|
||||
|
||||
sample.gasmix = i;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
o2_previous = o2;
|
||||
he_previous = he;
|
||||
}
|
||||
|
||||
@ -638,16 +638,6 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
|
||||
if (time == samplerate && parser->initial != UNDEFINED) {
|
||||
sample.gasmix = parser->initial;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int idx = parser->initial;
|
||||
unsigned int o2 = parser->gasmix[idx].oxygen;
|
||||
unsigned int he = parser->gasmix[idx].helium;
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Depth (mbar).
|
||||
@ -735,13 +725,6 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
|
||||
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
offset += 2;
|
||||
length -= 2;
|
||||
}
|
||||
@ -760,15 +743,6 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
|
||||
idx--; /* Convert to a zero based index. */
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int o2 = parser->gasmix[idx].oxygen;
|
||||
unsigned int he = parser->gasmix[idx].helium;
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
offset++;
|
||||
length--;
|
||||
}
|
||||
@ -808,13 +782,6 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
|
||||
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
offset += 2;
|
||||
length -= 2;
|
||||
}
|
||||
@ -920,13 +887,6 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
|
||||
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
offset += 2;
|
||||
length -= 2;
|
||||
}
|
||||
|
||||
@ -501,12 +501,6 @@ mares_iconhd_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
||||
if (gasmix != gasmix_previous) {
|
||||
sample.gasmix = gasmix;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE;
|
||||
sample.event.time = 0;
|
||||
sample.event.value = parser->oxygen[gasmix];
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
gasmix_previous = gasmix;
|
||||
}
|
||||
}
|
||||
|
||||
@ -841,15 +841,6 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
|
||||
}
|
||||
sample.gasmix = gasmix - 1;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int o2 = parser->oxygen[gasmix - 1];
|
||||
unsigned int he = parser->helium[gasmix - 1];
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
gasmix_previous = gasmix;
|
||||
}
|
||||
|
||||
|
||||
@ -458,13 +458,6 @@ shearwater_predator_parser_samples_foreach (dc_parser_t *abstract, dc_sample_cal
|
||||
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
o2_previous = o2;
|
||||
he_previous = he;
|
||||
}
|
||||
|
||||
@ -525,14 +525,6 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca
|
||||
}
|
||||
sample.gasmix = parser->gasmix;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int he = parser->helium[parser->gasmix];
|
||||
unsigned int o2 = parser->oxygen[parser->gasmix];
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Events
|
||||
@ -715,12 +707,6 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca
|
||||
}
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE;
|
||||
sample.event.time = seconds;
|
||||
sample.event.value = o2;
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
offset += 2;
|
||||
break;
|
||||
case 0x06: // Gas Change
|
||||
@ -747,12 +733,6 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca
|
||||
}
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = seconds;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
offset += length;
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -613,16 +613,6 @@ static void sample_gas_switch_event(struct sample_data *info, unsigned short idx
|
||||
|
||||
sample.gasmix = idx - 1;
|
||||
if (info->callback) info->callback(DC_SAMPLE_GASMIX, sample, info->userdata);
|
||||
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int o2 = 100 * eon->cache.gasmix[idx-1].oxygen;
|
||||
unsigned int he = 100 * eon->cache.gasmix[idx-1].helium;
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (info->callback) info->callback(DC_SAMPLE_EVENT, sample, info->userdata);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -394,12 +394,7 @@ suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
||||
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE;
|
||||
sample.event.value = o2;
|
||||
#else
|
||||
sample.event.type = SAMPLE_EVENT_NONE;
|
||||
#endif
|
||||
break;
|
||||
default: // Unknown
|
||||
WARNING (abstract->context, "Unknown event");
|
||||
|
||||
@ -1153,15 +1153,6 @@ uwatec_smart_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
||||
}
|
||||
sample.gasmix = idx;
|
||||
if (callback) callback (DC_SAMPLE_GASMIX, sample, userdata);
|
||||
#ifdef ENABLE_DEPRECATED
|
||||
unsigned int o2 = parser->gasmix[idx].oxygen;
|
||||
unsigned int he = parser->gasmix[idx].helium;
|
||||
sample.event.type = SAMPLE_EVENT_GASCHANGE2;
|
||||
sample.event.time = 0;
|
||||
sample.event.flags = 0;
|
||||
sample.event.value = o2 | (he << 16);
|
||||
if (callback) callback (DC_SAMPLE_EVENT, sample, userdata);
|
||||
#endif
|
||||
gasmix_previous = gasmix;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user